Compiler written on Rust using libgccjit as backend. Statically compiled programming language for advanced developers.
extern func printf(fmt: *char,...) void;
extern func calloc(c: i32,size: i32) *u8;
pub struct Point {
x: i32,
y: i32
}
pub func point_print(p: *Point) void {
printf("(%i;%i)\n",p.x,p.y);
return;
}
pub func main() i32 {
var p: *Point;
p = calloc(1,8) as *Point;
p.x = 3;
p.y = 4;
point_print(p);
printf("0x%lx\n",17179869187L);
return 0;
}
It's recommended to install the project via Nix Flakes
. Simply, add the flake to your configuration and add .#default
package to your configuration. Also, you may run this repository one time via nix run
:
nix run github:osmon-lang/osmon
For *NIX based operating systems, you can install Osmon by running the following command:
cargo install osmon
However, you need to install whatever dependency the project needs. You may refer to default.nix file for further information. It's not possible to install Osmon on Windows. You can use WSL to install Osmon on Windows. If you want to use osmon's libraries, then you may want to run:
cargo add osmon
The project has shell.nix
which has development environment preconfigured already for you. Just open your terminal and at the root of this project:
# Open in bash by default
nix develop
# If you want other shell
nix develop -c $SHELL
# After entering development environment, inside the
# env, you can open your editor, so your editor will
# read all $PATH and environmental variables, also
# your terminal inside your editor will adopt all
# variables, so, you can close terminal.
# Neovim | VSCode | Zed
vim . # code . # zed .
The development environment has whatever you may need already, but feel free to add or remove whatever
inside shell.nix
.
This project is licensed under the GPL-3.0 license - see the LICENSE file for details.