You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our first refactor will be to introduce queries in our compiler.
"What would be the use?"
would you say.
Queries will allow us to simply ask for something, like the type of a symbol, or whether a symbol is dynamically/statically linked, or something else.
We will have to create a simple query language extensible enough to also be used in gzc while remaining simple and easy to write/use. Our main inspiration will be SQL.
That way, we can create some sort of ORM on top of the internal black box of the compiler and use it efficiently. This also means, unfortunately, that the memory footprint will be higher, but for a good reason.
This will also help us achieve incremental compilation, where only modified parts will need to be recompiled.
Query examples:
/** Selects the type of a known symbol from a given file. */select type from (symbol """print""") in file """std/io.nst"""-- forall (s: Ts). { %rsp: { sptr *{ %rsp: sptr s }::s }, %rdi: *char }/** Selects the type of an expression given a file and a line number. */select type from (expr """4(%rsp)""") in file """std/io.nst""" at line32-- s32/** Ask the compiler to fully compile the file into an ELF object. We also could ask to only compile specific functions. */
compile *from file """std/io.nst""" into """std/io.o"""as ELF
Disclaimer: the syntax and semantics are not yet fixed. This is the goal of this issue, to keep track of all those changes. The examples above are therefore not necessarily valid.
The text was updated successfully, but these errors were encountered:
Our first refactor will be to introduce queries in our compiler.
would you say.
Queries will allow us to simply ask for something, like the type of a symbol, or whether a symbol is dynamically/statically linked, or something else.
We will have to create a simple query language extensible enough to also be used in gzc while remaining simple and easy to write/use. Our main inspiration will be SQL.
That way, we can create some sort of ORM on top of the internal black box of the compiler and use it efficiently. This also means, unfortunately, that the memory footprint will be higher, but for a good reason.
This will also help us achieve incremental compilation, where only modified parts will need to be recompiled.
Query examples:
Disclaimer: the syntax and semantics are not yet fixed. This is the goal of this issue, to keep track of all those changes. The examples above are therefore not necessarily valid.
The text was updated successfully, but these errors were encountered: