Eureka is a fast, interpreted programming language with native FFI support and a clean syntax designed for simplicity and performance.
- Fast execution: Sub-millisecond startup and execution times
- Native FFI: Direct integration with C libraries without compilation
- Clean syntax: Simple, readable code structure
- Type system: Static typing with type inference
- Standard library: Built-in functions for I/O, type conversion, and more
git clone https://github.com/fernandothedev/eureka.git
cd eureka
dub buildextern func void eprintln(msg str, ...);
eprintln("Hello, World!")Run with:
./eureka hello.ek -L stdlib/iolib.solet name str = "Fernando"
let age int = 17
let active bool = true
let pi_1 float = 3.141592f
let pi_2 double = 3.141592 // or 3.141592d
let pi_3 real = 3.141592rfunc int sum(x int, y int) {
return x + y
}
let result int = sum(10, 20)extern func void print(...);
extern func void println(...);
extern func int toInt(...);
extern func str input(msg str);
let x int = toInt(input("x: "))
let y int = toInt(input("y: "))
if x == y
println("equals")
else if x > y
println("well well well")
else {
print("holy")
println("shit")
}Eureka supports direct calls to C libraries:
extern func void eprintf(format str, ...);
extern func str input(prompt str);
let name str = input("Enter your name: ")
eprintf("Hello, %s!\n", name)extern func void eprintf(format str, ...);
let first str = "Hello"
let second str = "World"
let message str = first + " " + second
eprintln(message) // Output: Hello WorldThe built-in standard library provides essential functions:
print(),println(),eprintf()- Output functionsinput()- Interactive inputtoString(),toInt(),toBool()- Type conversionsstrlen()- String utilities
# Run a program
./eureka program.ek -L library.so
# Debug options
./eureka program.ek --ast # Show AST
./eureka program.ek --tokens # Show tokens
./eureka program.ek --context # Show runtime context
./eureka program.ek --stat # Show performance stats
# REPL mode
./eureka --replextern func str input(prompt str);
extern func int toInt(...);
extern func void eprintf(format str, ...);
let name str = input("Name: ")
let age int = toInt(input("Age: "))
eprintf("Hello %s, you are %d years old!\n", name, age)Eureka is designed for speed:
- Startup time: ~3ms including library loading
- FFI calls with minimal overhead
- Efficient memory management
- Function symbol caching
FFI calls are direct C function invocations. Users are responsible for:
- Ensuring correct function signatures
- Managing memory safety
- Handling potential segmentation faults
This design prioritizes performance and flexibility over safety guarantees.
Requirements:
- D compiler (DMD, LDC (recommended), or GDC)
- DUB package manager
git clone https://github.com/fernandothedev/eureka
cd eureka
dub build --build=releaseEureka - Performance meets simplicity