A nice thing about Smalltalk and derived languages, like Pharo, is that they manage being written in themselves nearly down to metal, and that improves learnability a lot, as one can dive deep only knowing the language itself. I code mostly in Python, but sometimes is hard to take a deep dive there without smashing one's head against the C bedrock underneath, at least for somebody like me, that doesn't really know C.
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.
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 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?
Wow, I should work on my prose, that comment I wrote was really bad :-(
> 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.
I'm very much a beginner with Smalltalk but have used C since K&R. I'm having difficulty with the statement that Slang is a dialect of Smalltalk which "does not have blocks (except for a few control structures), message sending or even objects." How can you have even a subset of Smalltalk without these? Even something as basic as an "if" statement uses all three. I see the examples, but they don't shed much light. Or is the grammar wrong, so the sentence is intended to say that the C output does not have objects etc.?
I think they’re saying ifTrue: is an intrinsic in their transpiler, so the method call is skipped and replaced with a C statement. They could have chosen instead to generate C code that actually invokes a method on a receiver (using whatever their calling convention is for methods), which would be slower but monkey-patching would work as usual.
Who has an account on this wiki and how did you get it? The wiki pages have an Edit button, but it uses an HTTP auth prompt, and cancelling it doesn't provide any details about how to register. I also don't see anything after looking around elsewhere on the wiki itself, nor does Googling turn anything up.
Well, this isn't the right place to do it. At least introduce yourself on the squeak-dev or beginners email lists and ask for the ability to edit the swiki there. It would also help to mention your immediate plans.
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.
My immediate plans are (were) to, you know, edit the wiki.
> 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."
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.
Sure, but the swiki is a tool for the community. What makes you think you should be able to edit it without a fair amount of knowledge and experience that can really only be gained by participation within the community?
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.
The main goal for Slang was to be able to use the Smalltalk debugger instead of something like gdb. Since you are essentially writing C but with a Smalltalk syntax the code itself is not any simpler, so it is all about the tools.
Something about that I'm missing. You'd use something like gdb for debugging running C code but the Smalltalk debugger works in the image so which C running code would it be debugging?
Slang is Smalltalk-80 written as if it were C: all methods in a single class so they can be translated to C functions, no object allocations and so on.
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.
At first I thought 'what does an ncurses alternative have to do with Smalltalk' but it quickly dawned on me that this is another tool using the name 'Slang'. OK, the ncurses alternative is officially spelled 'S-Lang' [1] but in the vernacular it usually gets shorted to 'slang'. It is used by e.g. Midnight Commander: