where does it generate assembly assembly / llvm ir / machine code? I poked around and didn’t immediately spot this, or even which it targets.
ptspts
GDSL is written in C++ with use of STL, templates and lambdas, so it's 2600 lines of such C++ source code. There is no self-hosting: neither the LISP compiler nor the C compiler can compile itself. No operating system is implemented, the word kernel in the title means something else.
FYI Here is a 700-line subset-of-C compiler which can compile itself: https://github.com/valdanylchuk/xcc700 . FYI The linker and the libc are not included.
show comments
akkartik
Looks interesting. The next step may be to show some little fun examples built with it.
Here's my similar project from a few years ago, in case you want to compare notes:
where does it generate assembly assembly / llvm ir / machine code? I poked around and didn’t immediately spot this, or even which it targets.
GDSL is written in C++ with use of STL, templates and lambdas, so it's 2600 lines of such C++ source code. There is no self-hosting: neither the LISP compiler nor the C compiler can compile itself. No operating system is implemented, the word kernel in the title means something else.
FYI Here is a 700-line subset-of-C compiler which can compile itself: https://github.com/valdanylchuk/xcc700 . FYI The linker and the libc are not included.
Looks interesting. The next step may be to show some little fun examples built with it.
Here's my similar project from a few years ago, in case you want to compare notes:
https://github.com/akkartik/mu
https://akkartik.name/akkartik-convivial-20200607.pdf
GitHub link: https://github.com/FirTheMouse/GDSL
I thought you needed 100k lines of code for a C compiler. https://www.anthropic.com/engineering/building-c-compiler