o
odinpkg.dev
packages / library / zero

zero

v0.0.9library

No description provided.

MIT · updated 7 hours ago

Zero Lang

Procedural language with basics done right. Straightforward, correct and if possible with some syntatic sugar on top. Aims to be explicit but to not sacrifice all the creature comforts of a modern language.

Right now this is an LLVM project and it will be for a while. Trying not to tie the code to much to that. Potentially this README can look a lot different in a couple of months if this becomes a serious project.

Upcoming work

  • Proper string with bound check and not null-terminated
  • Struct untyped literals
  • Array swizzling
  • Issue warning for return of local addresses
  • Error on untyped constant overflow when coerced to a smaller type (currently wraps silently, e.g. 5000000000 into an i32)
  • Make external blocks its own AST node kind, in order to have linking rules and prefixes
  • Make sure that lexer is UTF-8 compliant
  • Add check for cyclic import
  • Formalize calling conventions (native vs C)
  • Refactor type fat-struct into a union
  • Fix program return codes.

Try it

odin build .
./zero run demos/bubble/main.zero 

Testing

All the compiler tests reside in tests/ and adding a file there will automatically add it to the test suite Run the tests by simply calling odin test . or make test Tests can also be compiled individually using zero as normal programs.

Dependencies

  • linux at least until we properly know what we are doing
  • LLVM 21.x currently the compiler uses this specific version of LLVM.
  • cc to be used as the linker
  • raylib in order to run the demos in demos/

LLM usage

This project had (and has) support from LLMs when researching ways to implement a given feature or debugging some hairy bug. All the code structure, logic and language design was made by humans. Any code that potentially ends in the code-base that was generated by an LLM will be isolated and annotated as being so. A current example of this is the minimal LSP implementation which for the time being was mostly generated and will be replaced as soon as it is prioritized.

This is not, by any means, an AI generated project and I take responsiblity for all the code

License

MIT, see LICENSE.