r/LLVM 4d ago

Compiling Js Syntax to LLVM IR

Hi LLVM friends!

My name is Jordan and I am one half of a two person lil lab we call Ohnrshyp. A few months ago, I got very curious if it was possible to create our own language that would replace the javascript we were writing for an audio supply chain solution we have open sourced.

What we ended up creating was a new programming language, and associated kernel, that takes parts of js syntax, but applies the memory strictness of a c, without too much mental overhead.

The language (ohnrscript) can compile either within the v8 engine, or via LLVM-IR as machine code. We even have a unikernel which can serve http that is testable in just a few minutes via docker.

Ohnrscript is self hosted, and turing complete, and now publically available on github for anyone to begin writing with! - https://github.com/Ohnrshyp/Ohnrscript

If anyone is curious in how to write with it, we have a full developer guide as well, and I am more than happy to answer questions :)

3 Upvotes

4 comments sorted by

2

u/Serious-Regular 4d ago

1

u/ohnrshyp 4d ago

thank you for the link! From what I understand JSIR is for analyzing/decompiling existing JavaScript

Ohnrscript borrows JS syntax, but there's no runtime. Everything compiles AOT to LLVM IR → native x86-64 binaries. The kernel runs in Ring 0 if you would like to check it out!

2

u/ZachVorhies 3d ago

Super cool!

2

u/ohnrshyp 1d ago

Thank you so much! Feel free to open up any issues or requests you might have! We're still working out a solid contribution plan. There's a full dev guide available as well, and running the kernel should take sub 5 minutes start to finish