3 ms·
Two different Smalltalk-on-embedded articles on the front page of Hacker news right now: This one (by me) and https://news.ycombinator.com/item?id=34208753 http
by ErikCorry 4y ago
Two different Smalltalk-on-embedded articles on the front page of Hacker news right now: This one (by me) and https://news.ycombinator.com/item?id=34208753 https://news.ycombinator.com/item?id=34208753
Yes, Toit is pretty much a Smalltalk dialect.
Similarities
Blocks (closures passed to functions as a foundation of control flow)
Blocks have non-local return (you can return from the syntactically enclosing fn in a block).
Block arguments introduced with | | delimiters
Single inheritance object orientation
Dynamic typing but type safe
Named arguments
Uses virtual machine to run, including garbage collector.
Differences
Toit's syntax is more like a cleaned up Python than Smalltalk.
Toit also has positional arguments.
Toit's blocks are more lightweight than Smalltalk closures (no allocation)
Development is with source files and compiler, not image-based.
Toit has optional types, and if you use them they are checked. (Types are non-nullable by default.)
Toit has interfaces
Toit can build standalone executables, VM included
Toit has top level functions not attached as methods to some class.
Array (List) indexing is 0-based, not 1-based.
Quick intro here: https://docs.toit.io/language https://docs.toit.io/language
- deleted 4y ago[deleted]