A low level language that compiles straight to machine code, no runtime, no VM.
A small compiled language with its own lexer, parser, and codegen, targeting LLVM IR.
Shine compiles down to native object files and links straight to an executable. No interpreter, no VM, no runtime.
Status: Active Development - compiles functions with parameters, calls, and string/int literals.
Compiler: GPL-3.0 Standard Library: GPL-3.0 with runtime library exception
This means programs written in Shine and linked against the stdlib are NOT required to be GPL-licensed.
See STDLIB-LICENSE
Native compilation - Shine source goes through a hand-written lexer, recursive-descent parser, and LLVM-based codegen, then straight to an object file and a linked executable.
Functions with parameters - fn int add(a: int, b: int) { ... }. Parameters are passed as real LLVM arguments and referenced by name in the function body.
No runtime - Shine programs link against libc and nothing else. There's no garbage collector, no interpreter loop, no bytecode.
fn type name(param: type, ...) { ... }int/voidtypes- int and string literals
- function calls, including passing arguments
r/(return)write(string)- a compiler builtin for now, lowers toputsletis an immutable variable andvaris a mutable one- Assignment to variables (
var) + - * /and comparisons
No control flow yet - see ROADMAP.md.
fn int identity(x: int) {
r/x;
}
fn int main() {
let(int) base = 10;
var(int) total = identity(base);
total = total + 5;
write("Hello, World!");
r/total >= 15;
}
To use the compiler you just need to run this command (replace the names with yours):
shinec yourfile.shine -o output.exe
After that your Shine code has been compiled and is ready to run!
Clone The Repository
git clone https://github.com/Shine-Language/Shine-Compiler.git
cd Shine-Compiler
Build It (May need tweaking if you are not using Windows)
cmake -B build -G Ninja
cmake --build build
./build/tests/shine_tests.exe
./build/shinec.exe examples/hello.shine -o hello.exe
./hello.exe
NOTE:
You must be in MSYS2 MINGW64 for this to work, every command must be ran from there and no where else.
include/shine/ headers
src/ lexer, parser, codegen, driver (main.cpp)
tests/ unit tests
examples/ sample .shine programs
See ROADMAP.md for what's done and what's next.
