Jam+murisi/feature/elixir resource machine+further experiments2 #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Further experiments in order to try and more closely align the language interpreted to the one that is compiled. There are also some additional experiments that are not strictly necessary. Specifically, the following changes have been made:
:listprefix (so that the internal representation matches the keyword that creates lists). This PR changes that so that lists are internally represented verbatim without a:listprefix because the tag/prefix seemed redundant.car,cdr, andconsas ordinary functions defined in the environment instead of as special keywords in the interpreter. This makes the core interpreter smaller and should hopefully make it easier to align with the compiler (which also does not treatcar,cons, andcdras special keywords).listkeyword for constructing lists as essentially a macro that expands to nestedconscalls. This might make integration with the compiler easier since it does not currently support variadic functions.applykeyword as function inside the DSL that calls a nullary function for an empty list, unary for singleton list, binary for length-2 lists, and so on. This is because it's easier to compile fixed-arity functions.nilas also the empty list, and instead definednullwhich exclusively means the empty list. This makes it easier to definelistas a macro where the inner mostcons's tail is the empty list.hds andtls.is_nullfunction. This is because equality in the compiler merely compares addresses, not the actual structures.