Slang: The subset of Smalltalk that can translate to C or other languages (2019)
wiki.squeak.org
wiki.squeak.org
In a very real sense, the entire concept of an interpreted language in the modern sense is such an ugly kludge (much cleaner to "go all in" on the language, LISP machines being the notable predecessor) -- but do be aware of the tradeoff.
I'm taking your question as genuine, but you provided some fun value with that hehehehehe
> I can see why this is frustrating, especially to someone with no C exposure. But bear in mind that the C underpinnings are part of the reason why these languages are popular in the first place -- like Perl used to be before Python.
I the idea GP is proposing here is that because C is so cumbersome, that is why scripting languages became prominent in the first place. I don't think this many would argue with this.
> In a very real sense, the entire concept of an interpreted language in the modern sense is such an ugly kludge
Here GP is implying that if C were nicer/better, or if some other low level language would have risen to prominence, the scripting langauges would not have been "necessary" or desirable in the same way.
> (much cleaner to "go all in" on the language, LISP machines being the notable predecessor) -- but do be aware of the tradeoff.
Here I assume GP is referring to the work in the 80s on Lisp machines where the idea was to build machines from the ground up more suited to a different paradigm. And thus obviating the need for a cumbersome language such as C.
I personally wonder if GP is familiar the "worse is better" essay?
> I personally wonder if GP is familiar the "worse is better" essay?
I am, it was more or less the idea I was trying to get to. The comment I replied to was along the lines of "I'd like a uniform environment where everything is lisp/smalltalk/pharo/etc". My intention was to point out how that idea isn't as free from compromises as it might seem, which explains the dominant model of high-level scripting languages invoking components written mostly in C/C++. Which is a total eyesore, but also extremely practical.
Smalltalk embraced that from the surface of its skin to the deeps of its soul:
From Dan Ingalls Design Principles Behind Smalltalk https://www.cs.virginia.edu/~evans/cs655/readings/smalltalk....
"Uniform Metaphor: A language should be designed around a powerful metaphor that can be uniformly applied in all areas."
"Personal Mastery: If a system is to serve the creative spirit, it must be entirely comprehensible to a single individual."
"Messages: Computing should be viewed as an intrinsic capability of objects that can be uniformly invoked by sending messages."
> (except for a few control structures)
Blocks are available specifically for those limited control structures, like "if".
Well, you see, that's what I'm trying to do here...
The swiki is extremely old-school and simplistic and has suffered defacement issues in the past. Also, unfortunately, the overall Smalltalk community (at least the open source part) is both too small and at this time terribly fractured. Resources like the swiki have had little real attention for many many years.
> I recently opened up an issue of Skeptic Magazine and saw a headline, "Why there something rather than nothing". My first thought was, "Great job, guys." But, it's easy to make a typo, even in a headline. My second thought was, "If this were a wiki, I would correct it."
<https://meta.wikimedia.org/wiki/The_wiki_way>
Zero chance that I'm going to jump through hoops to enjoy the privilege of giving away something that is already meant solely to benefit others while expecting to get nothing in return—my only expectation being that it isn't a difficult/hostile experience.
> Resources like the swiki have had little real attention for many many years.
I hope you can appreciate the perverse irony of this remark.
If it was possible to give you access to a single page to fix some language or a misspelling that would be one thing. But the authorization on the swiki is far from granular. Once you have access you can change pretty much any page, including the starting page.
I was implementing a plugin for Pharo the other day and it really feels like metaprogramming in C.
I have pending in my to-do list making a blog post with a friendly how-to for making a HelloWorldPlugin so more people can play with it.
This means that you can run the code as Smalltalk-80 inside Squeak and use all the tools like the Smalltalk debugger. When you are sure that it is working, you translate it to C and compile it to machine code. Now you would use GDB to debug that but in theory you won't have to as the code should just work.
Note that running the Slang version of the VM inside Smalltalk-80 gives you a fully functioning Smalltalk that is about 600 times slower than the Smalltalk it is inside of. The idea for Squeak was that machines had become so much faster than in the 1970s/1980s that even with this slowdown you could actually use the simulated Smalltalk enough to find all bugs.
On earlier computers such a simulation would be so slow that it would take many minutes for a menu to be drawn on the screen when you pressed a mouse button, for example. You would not get enough done to run into all the bugs. By the late 1990s this was no longer the case.
$ ldd /usr/bin/mc
...
libslang.so.2 => /usr/lib/x86_64-linux-gnu/libslang.so.2
...
[1] https://github.com/hankem/S-Lang