where does it generate assembly assembly / llvm ir / machine code? I poked around and didn’t immediately spot this, or even which it targets.
Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300
11–20 of 21 posts
Re: Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300
#12where does it generate assembly assembly / llvm ir / machine code? I poked around and didn’t immediately spot this, or even which it targets.
That's the MIX. As mentioned in the README I haven't setup a system for these yet, just made the scaffolding, as a lot of the work in this space is actually around just the MIX layer. I'll probably be posting about more backend systems once I get started on making them, this project has only been in the works for 5 weeks so far. Though I would invite anyone interested to contribute a MIX module, that's where I have t…
Re: Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300
#13Earlier quoted context omitted.
That's the MIX. As mentioned in the README I haven't setup a system for these yet, just made the scaffolding, as a lot of the work in this space is actually around just the MIX layer. I'll probably be posting about more backend systems once I get started on making them, this project has only been in the works for 5 weeks so far. Though I would invite anyone interested to contribute a MIX module, that's where I have t…
Right, but like which one does it do in the demo?
Re: Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300
#14Looks 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
Re: Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300
#15Looks 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
Good to see you kicking around and here in a thread about things small enough to think about! I've not seen any blog posts from you in a while Kartik but I come back to your lua musings from time to time.
Re: Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300
#16Re: Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300
#17[flagged]
Re: Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300
#18Really interesting writeup. What stood out to me most was the shift from the earlier node execution path to the streamed path. The benchmark gap between execute_r_nodes and execute_stream is huge, and the latter getting relatively close to the handwritten C++ baseline is the part I keep thinking about. After building this, where do you think most compiler complexity actually comes from? My impression from your post i…
And I love the question. A lot of the complexity is coming from the management of seams, places where we have to go from one representation of information to another. The tooling, diagnostics, and optimization passes are as large as they are precisely because of these seams. Consider a liveness pass in LLVM, which spends a lot of time reconstructing information thrown away by the compiler so it could emit SSA. In GDSL, a liveness pass is simply handlers in the e_stage, in the example I snuck into GDSL-C print statements stamp liveness tokens onto their children via qualifiers and at assignment nodes, those without such tokens are killed. I can do the logic in a straightforward manner because we have all the information to work with, no seams, no SSA to derive scopes from, thus why a subset of it fits in 80 lines instead of 80,000.
Re: Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300
#19Re: Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300
#20If a working compiler can be written in ~1000 lines, why are production compilers like GCC or LLVM millions of lines?