Skip to content

TL1 Features

Meir Cohen edited this page Mar 14, 2018 · 1 revision

Adding features that will make it easier to write more complex compilers:

  1. better references: user and owner are generated as pointers, var String now initialize a pointer to String
  2. basic classes: with only instance members
  3. better expression conversion to C: = to ==, := to = and . to ->, - can be used instead of minus
  4. arrays support, get item by [] Type var := arr[index]
  5. update function declaration and call to func name([params]): [out params]
  6. functions can be called directly after if, while and :=, and will evaluate to the last output value
  • [if/while] func-name([params]): [out params] ...
  • [var] := func-name([params]): [out params] ...
  1. comments are copied to C
  2. #include lumi.1.h is generated
  3. all external C code is now in lumi.1.c
  4. support for variable argv input parameter
  5. basic error handling: raise will start an error that will terminate the program while writing to stderr the function call trace (in the generate C code)
  6. adding support for system functios: exit, system and getenv
  7. variables and references are initialized with (value) (instead of := value)
  8. support string splitting with user String ref(some-string[start:length]) + added more string functions
  9. support array splitting with user Array{Type} ref(some-array[start:length])
  10. support function references with the Func type
  11. for loops are now global and cannot be under do loops:
for n in [value]
  # do stuff with n

Clone this wiki locally