eldoy / weblang

Low code programming language for safe, portable and efficient code.
https://weblang.org
MIT License
3 stars 0 forks source link

Abstract syntax tree AST for introspection and error handling #23

Open eldoy opened 1 year ago

eldoy commented 1 year ago

To display error origins, which file and line it originates, you could "compile" the weblang code into an AST before running it. This will also allow sending programs over the internet or storing them in a database. The compiled version will be faster than the YAML version since there is no YAML parsing overhead.

The AST could be JSON format and human readable.

Function invocations could be tracked through an two-way hash, like JWT, that contains the line number and file name and maybe more as part of the call id: filename.wl,34,abcdef3432df

These are then universal and can be passed into central error loggers.

eldoy commented 1 year ago

Option to add more meta data to the JWT? Can we use actual JWT for this? How badly will it affect performance?