Skip to content

Ferrum-Language/Ferrum-Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ferrum Examples

Example programs written in the Ferrum programming language.

Ferrum has C syntax with compile-time memory safety — no garbage collector, no runtime overhead.

Programs

File What it shows
hello.fe Hello World — the simplest Ferrum program
counter.fe While loop and integer arithmetic
factorial.fe Recursive function, for loop
ownership.fe new, move(), automatic free()
borrows.fe Immutable & and mutable &mut borrows
unsafe_demo.fe Raw pointers inside unsafe {} blocks

How to run

Build the compiler first

git clone https://github.com/Ferrum-Language/Ferrum.git
cd Ferrum
bash build.sh

Compile and run any example

./build/ferrumc hello.fe -o hello
./hello

See the generated LLVM IR

./build/ferrumc ownership.fe --emit-ir

Requirements

  • g++ with C++20
  • LLVM 18 (llvm-config, llc)
  • gcc (for linking)
# Ubuntu / Debian
sudo apt install llvm-18 llvm-18-dev gcc g++ build-essential

Ferrum-language Compiler v0.3 — Ferrum-Language

About

Example programs written in the Ferrum programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors