titan-lang / titan

The Titan programming language
http://titan-lang.org
MIT License
406 stars 13 forks source link

Self-hosting #252

Open Immortalin opened 6 years ago

Immortalin commented 6 years ago

Any plans for self hosting i.e. freestanding standard library and runtime that does not depend on OS-specific features? This would make it easier to develop drivers and kernel modules.

mascarenhas commented 6 years ago

We have a big dependency on the Lua runtime, so this would have to be built upon the support that currently exists for running Lua code in the kernel.

Immortalin commented 6 years ago

So no possibility of using this to write drivers? Can Terra run without Lua runtime?

mascarenhas commented 6 years ago

I have never written a driver, so have no idea of what is necessary to run in the Linux kernel, or which changes, though @gligneul might know, since his company uses Lua in the kernel. Titan generated code currently uses just a few functions from the C standard library on its own (meaning not through its reliance on Lua): memcpy, memset, and floor. In particular, Titan code only allocates memory through Lua.