Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This seems like a fun way to poke around with LLVM but I don't see how this is any easier than writing down a grammar and feeding it into a parser generator...

"Writing a parser" sounds really annoying and complicated, but in my admittedly limited experience with ocamlyacc, it was easy peasy and dare I say it, fun!

The hard part I guess was defining the language and maybe that's what he's trying to avoid.

But even still, scripting around the AST building functions in LLVM and coding directly to them seems way more annoying to me in the long run. (especially the writing programs part)

But who knows, maybe I'm missing the point...



Here's the potential I see. Imagine if it was routine to write an application stack entirely in a repl language. Not just the application code - everything. You'd write your application code. Then other functions would dispatch the tree of application code to the LLVM API where it would be compiled. Then other functions could take the resulting artifacts and push them through to deployment.

Doing this at the moment would involve writing fiddly wrappers around lots of layers of technology - dynamically constructing makefiles, and shelling out to call things.


> But even still, scripting around the AST building functions in LLVM and coding directly to them seems way more annoying to me in the long run. (especially the writing programs part)

Using the IRBuilder to build IR is quite easy in my experience.


I experimented with the gypsum programming language based on Python a while back: https://github.com/jayconrod/gypsum

It indeed is great fun to see recursion at work - yet, I had my first sleepless night due to high concentration of grasping what was going on.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: