--
You received this message because you are subscribed to the Google Groups "Newspeak Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to newspeaklangua...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/847590dc-fba9-4eb7-a603-17cb325ec48en%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/16812141-a574-4a78-a75a-4e36fb1983cbn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/0f0d43c3-6020-4187-8c65-09a8e3bced3fn%40googlegroups.com.
OK. So "platform" is a variable already given in the workspace?
Is there a way to list what variables are currently set there?
So I tried this :
[ | re ::= RegexMatcher usingPlatform: platform RxParser new. | re parse: 'abc'] value
And I got this error :MessageNotUnderstood: PlatformWithHopscotch RxParser
So I then tried this :
[ | re ::= (RegexMatcher usingPlatform: platform) RxParser new. | re parse: 'abc'] valueAnd I get this.MessageNotUnderstood: PlatformWithHopscotch squeakAny ideas what's happening here?
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/d4758424-2085-4023-b5c4-52b192776f53n%40googlegroups.com.
OK. I see that.So a lot of this squeak stuff it's getting seems like the generic collections etc.private Association = platform squeak Association.
private Map = platform squeak Dictionary.
private List = platform squeak OrderedCollection.
private Set = platform squeak Set.
private WriteStream = platform squeak WriteStream.
private ReadStream = platform squeak ReadStream.
private Transcript = platform squeak Transcript.
private MessageNotUnderstood = platform squeak MessageNotUnderstood.
Presumably the web / hopscotch version of NewSpeak has equivalents for all those that they could be replaced with?
I'm guessing the "platform" therefore is a wrapper for a lot of lower level infrastructure managing resources.
And maybe this is a stupid question, but looking around I see a fair few classes that seem to do something similar.You pass the platform to the factory method / constructor and then there seems to be a lot of boilerplate like this :(* imports *)
private Map = p collections Map.
private Presenter = p hopscotch Presenter.
private Subject = p hopscotch Subject.etc.Why do you not just store the Platform object itself in a slot, and only ask it for these other objects when you need them?
The other question is that in all these factories, the Platform gets explicitly asked with "squeak" or "hopscotch" etc. messages to get these UI elements like Presenter which means the code couples tightly to the UI.
Why isn't Platform an abstraction that hides all that?
So you can just say something like "p getPresenter" and have the platform itself know whether it's really running on Squeak and should give you a Squeak Presenter, or on a web wrapper for Hopscotch that should give you a Hopscotch Presenter, etc?
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/8e073686-b4e1-4c08-b964-9b295ed8066fn%40googlegroups.com.
So I thought I'd try changing the RegexMatcher class like this
private Association = (Collections usingPlatform: platform) Association.
(Ie. to try to pull the Association class out of the Collections top level class rather than pull it out of the platform argument. I see that Collections does have an Association class defined in it.)
But I'm getting an error : MessageNotUnderstood: RegexMatcher Collections
So presumably you can't see the Collections top-level class from inside the RegexMatcher top-level class? Is this correct? Even top-level classes are invisible to each other?
In which case how do you ever get access to them? Presumably this is why you pass "Platform" objects around? Because they are your only access to the rest of the system?
So I tried changing the line like this :
private Association = platform collections Association.
Ie. assuming I could pull Association out of whatever collections the platform has access to.
But I get this error :
MessageNotUnderstood: CollectionsForPrimordialSoup Association
Suggesting that the platform collections method returns CollectionsForPrimordialSoup rather than Collections.
And that that doesn't have an Association class. (It doesn't.)
So what am I meant to do here? If I just want an Association in my RegexMatcher world, do I have to get it from the platform object I've been passed? Or is there another way to get it?
And if I do have to get it from the platform, what do I do if the particular bag of Collections I'm passed, doesn't have it?
Is CollectionsForPrimordialSoup really meant to have everything that Collections has?
Or is it that the platform object "collections" message should really return the Collections top-level object?
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/0811560f-d72f-4b16-b70c-518b02942a7fn%40googlegroups.com.
Frustrated? Boy. You guys are crazy extremists, aren't you? :-)
I should have taken your name more seriously!
Yeah. I do understand what you're saying and the logic behind it. But I gotta say, it does feel like if I'm going to pick up a new highish level language to do something with, I shouldn't be having to start out by trying to figure out how to inject basic collections like lists and dictionaries into my code by threading them as arguments through my constructors.
Shouldn't these at least be part of the "few basic classes inherited from Object" that we can just rely on? Like a stdlib or prelude? I mean, the irony here is that, yes, I know this isn't Smalltalk. But AFAICT you are in the Smalltalk tradition, which is about empowering programmers and giving them a nice big library of toys to get going with. And AFAICT you DO have things like Associations and Lists to use off-the-shelf in your nice big library.
It's just that you've got a security model
that's so hardcore that you make us jump through hoops to actually get access to them. In about 3 mouse clicks in my first session, I can drill into, read and even change the source code of an Association class. But to actually get access to a scope containing one in order to use it, I have to spend hours getting my head around a strange and complex security model
and do reasoning about - I know you don't like the term but ... - "dependency injection". What's the "right way" to get access to this namespace in that part of the code? Etc.
But look, I'm not easily defeated. There are lots of things that look really good about Newspeak. I'm going to persevere. And yeah, obviously I like learning by trying to DO something and see if I can make it work. But I would say that if you care about having users and people adopting this language then having such a hard security model between people starting out, and being able to do anything serious, seems a big barrier to entry that you might want to think about.
Actually ... on further consideration ... I have more ... ;-)AFAICT this isn't about still being in alpha. It seems to me that this security model will always get in the way of programmers.
If I want to use any UI component in my own project I have to know how to get to it. Can I get it through the "platform" object? Well, who is responsible for making sure it's in the platform object in the first place? Suppose one third party developer creates a new UI widget in a new module. And I as another third party developer want to use it? I have to either wait for the core maintainers to put that third party widget into the default platform object? Or I have to add it as an explicit extra argument to my factory / constructor? Which pushes the responsibility onto the users of my code to add it every time they call my factory?Am I understanding this correctly?
There's no way that one third party developer can include another third party developer's module as a dependency without either getting the Newspeak maintainers to include it in the platform object? Or forcing the end user to explicitly think about it?
And if I write software that depends on 20 or 30 third party libraries, I'll have to write a factory with 30 specific arguments?
Which the user will have to explicitly pass to me when they use my code? And if I update my code to use a 31st library. I'll have to update my factory with a 31st argument, and break the code of everyone who currently uses it?I mean .... ¯\_(ツ)_/¯It can't really be like that ... can it?
--
You received this message because you are subscribed to the Google Groups "Newspeak Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to newspeaklangua...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/b1d43056-3ada-4f33-bd4e-b694fa0b4fd6n%40googlegroups.com.
The BIG issue is that if to "import" List into my class, I have to do it through an extra argument to the factory, I therefore have to change the signature of the factory. And then I'm going to break all the existing code that's already using that factory. Isn't that the case? And isn't that a massive issue?
In Java and Python adding a new dependency to a library is merely the concern of the authors of that library, and doesn't concern the users of that library.
I've been reading https://bracha.org/newspeak-modules.pdf and I see WHY you're doing things this way and the virtues you want from that. BUT that brittleness seems a very high price to pay.
Or ... maybe what I should understand from that paper (section 2.3) is that you don't intend for people people to publish "libraries" at all. Only full "Applications" which are basically immutable black boxes which users only access through their "main" function. Is that the model you're thinking of?
OK. Fair enough.I won't remember that pattern or be able to reinvent it off the top of my head,
but I can see how it does its thing.Obviously I look forward to the full write up or book-in-progress, but consider my mind at rest that there's a solution.One thing that would be interesting would be to see the full worked out example for a very toy MyMod1 class and the appropriate MyModules for it with examples of the code that calls the build and the code which uses the library package. I presume even though you aren't doing any of this in the codebase today, this pattern could start being used today. There's nothing extra it needs in the language?
Also, I wonder, as this looks quite boilerplate-y, whether it would be possible to code-generate MyModules for MyMod1 based on just the list of dependencies. So that you could have a "Librify This" button in the IDE that could turn any top-level class into a library.
--
You received this message because you are subscribed to the Google Groups "Newspeak Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to newspeaklangua...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/8b577758-da6c-487a-87ef-4055636dcee6n%40googlegroups.com.