Smallscript: A Smalltalk-inspired Scripting Language

https://www.codeproject.com/Articles/5373567/Smallscript-A-Smalltalk-Inspired-Scripting-Language

Blog post and project, 2024, by Łukasz Bownik

The interesting feature of Smallscript is the set of slight changes and modernizations it makes to classic Smalltalk syntax:

  • code blocks use braces not square brackets
  • statements within code blocks are separated by semicolons not periods
  • all code blocks automatically return the value of the last statement, so a special “return” construct is not needed
  • for methods that take multiple arguments, the first selector keyword is foo: and the second and subsequent keywords are :bar: etc. That is, keywords after the first start with a colon as well as ending with one. This makes it much more visually obvious which keywords are methods and which are merely continuing an existing method. Method names are constructed by appending all the keywords together as in classic Smalltalk, but now method names have two colons between each keyword rather than one.
1 Like

Points 1, 2, and 4 are very superficial. More matters of taste than anything profound. Point 2 means that you lose Smalltalks method cascades (unless they get different syntax).

Point 3 is a dubious improvement, judging from my Smalltalk experience. In Smalltalk, a method terminated without a return statement returns self. I have many more methods that usefully return self than methods that return something else.