Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
/ ocen Public archive
forked from ocen-lang/ocen

Statically typed programming language

Notifications You must be signed in to change notification settings

Skarlett/ocen

 
 

Repository files navigation

ocen

ocen aims to provide you the same level of control over your code as C, but with some modern features like type inference, namespaces, stricter types and a module system. It transpiles to C, and can easily bind to C libraries.

Usage

Use the following command to build the initial compiler:

$ ./meta/bootstrap.sh       # Generates ./bootstrap/ocen if successful

Compiling other programs

If you wish to use ocen from elsewhere, you can set the OCEN_ROOT environment variable to point to the root directory of this project. This lets the compiler find the standard library and other files it needs to compile your program.

$ export OCEN_ROOT=/path/to/ocen
$ export PATH=$OCEN_ROOT/bootstrap:$PATH # Add the compiler to your PATH

You can then use the compiler as follows:

$ ocen file.oc                # generates ./out and ./out.c
$ ocen file.oc -o ./build/out # generates ./build/out and ./build/out.c
$ ocen file.oc -n -c ./temp.c # generates only ./temp.c

For tips on developing the compiler, see DEVELOPING.md.

Language

You can find various examples of the language in:

  • tests: Unit tests for the compiler
  • std: The standard library (implementations + C bindings)
  • examples: Various examples of the language
  • compiler: The compiler itself!

About

Statically typed programming language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 61.6%
  • Rust 37.4%
  • Other 1.0%