A Stack-based compiled programming language.
The project is made not for competing with other languages, rather it is another incomplete language almost same like others.
Gofra is a concatenative (stack-based) programming language that compiles to native code.
Programs are written using Reverse Polish notation, where operations follow their operands (e.g 2 + 2 is 2 2 +).
Here's a simple "Hello, World!" example:
include "std.gof"
func void main
"Hello, World!" println
end
- Native - Compiles to native machine code
- C-like - Close to C, but has a few more high-level abstraction (
for in,type generics) - C FFI - Seamless integration with C-FFI libraries
- Low-level - Write unsafe, low-level code with direct memory access
- Type System - Validate types at compile time, has compile-time warnings (Partial generics supports, typechecker)
- Library - By default has support for
math,random,networkand other libraries
- Pong Game (
examples/03_pong) - Simple HTTP server (
examples/04_http_server)
Gofra currently supports native compilation (no cross-compilation yet). You must compile on the same platform as your target.
- Full: AArch64 macOS (Darwin)
- Partial, buggy: x86_64 (Linux)
(Windows x86_64 is must be supported soon, requires contributors)
Before installing Gofra, ensure you have the following tools available system-wide:
- Python >3.12.x
- GNU/Mach-O Linker (ld) - For linking compiled objects
- Assembler (as) - Typically included with Clang LLVM compiler
For full installation steps, please visit Installation page.
Gofra is distributed as single Python-based toolchain. To install:
(Step 1): Install toolchain
pip install gofra(Step 2): Verify Installation
gofra --helpPlease refer to actual documentation!