2019-10-03 23:36:49 +02:00
|
|
|
# SOL
|
2017-04-05 13:02:34 +02:00
|
|
|
|
2019-10-03 23:36:49 +02:00
|
|
|
Simple Object Language
|
2017-12-10 19:47:26 +01:00
|
|
|
--------------------------------
|
2017-04-05 13:02:34 +02:00
|
|
|
|
|
|
|
in other words, ruby without the fluff.
|
|
|
|
|
2018-03-11 11:41:15 +01:00
|
|
|
Possibly later other languages can compile to this level and use rx-file as code definition.
|
2017-04-05 13:02:34 +02:00
|
|
|
|
|
|
|
## Syntax tree
|
|
|
|
|
2019-10-03 23:36:49 +02:00
|
|
|
Sol is a layer with concrete syntax tree, just like the ruby layer above.
|
|
|
|
Sol is just simplified, without fluff, see below.
|
2017-04-05 13:02:34 +02:00
|
|
|
|
2019-10-03 23:36:49 +02:00
|
|
|
The next layer down is the SlotMachine, which uses an instruction list.
|
2017-04-05 13:02:34 +02:00
|
|
|
|
2019-08-06 16:42:15 +02:00
|
|
|
The nodes of the syntax tree are all the things one would expect from a language,
|
|
|
|
if statements and the like. There is no context yet, and actual objects,
|
|
|
|
representing classes and methods, will be created on the way down.
|
2017-04-05 13:02:34 +02:00
|
|
|
|
|
|
|
## Fluff
|
|
|
|
|
|
|
|
Ruby has lots of duplication to help programmers to write less. An obvious example is the
|
|
|
|
existence of until, which really means if not. Other examples, some more impactful are:
|
|
|
|
|
|
|
|
- No implicit blocks, those get passed as normal arguments (the last)
|
|
|
|
- No splats
|
|
|
|
- no case
|
|
|
|
- no elseif (no unless, no ternary operator)
|
|
|
|
- no global variables.
|
2019-08-06 16:42:15 +02:00
|
|
|
|
|
|
|
## Parfait objects
|
|
|
|
|
|
|
|
The compilation process ends up creating (parfait) objects to represent
|
|
|
|
things like classes, types and constants. This is done in this layer,
|
2019-10-03 19:55:41 +02:00
|
|
|
on the way down to SlotMachine (ie not during init)
|