r/Compilers • • 23h ago

Nikaia: a pre-alpha language where the compiler figures out the "how". How would you like to experiment with it?

0 Upvotes

Hi all,

I've been building Nikaia, a language that should make the world a bit better.

The basic idea is simple: in a lot of systems code, you end up specifying how memory, waiting, sharing, etc. should work rather than just describing what you want the program to do. Nikaia tries to have the compiler figure out those details for you.

So there’s no async/await, GC, or manual memory management. Data races, missing values and unhandled errors are compile-time errors, with plain-language hints about what to do instead.

It's still very early, but it can already build real programs: a JSON parser, a log analyser, a small HTTP server, the One Billion Row Challenge, and more.

Nikaia itself is built almost entirely by AI agents, and they're currently rewriting the compiler in Nikaia (self-hosting). So the language is getting quite a bit of real-world use already.

I'd love to have people try it and tell me what makes sense, what doesn't, and where the language gets in the way. "This can't work because..." is just as useful as praise.

What would make that easy for you?

\- Is the repo enough?

\- A crate you can "cargo install"?

\- A prebuilt executable?

\- A Docker image with everything set up?

\- An LSP / IDE integration?

Repo: https://github.com/Nikaia-Language/Nikaia

Docs: https://nikaia-lang.org/


r/Compilers • • 23h ago

Why I had to write a native C virtual machine to stop my custom language from choking (0.83s vs 8.4s) 🦊⚡

0 Upvotes

Reddit told me my custom language was just another slow tree-walking toy. They were right. 😅

​My loop benchmarks took nearly 8.5 seconds just to crunch 10M iterations in the sandbox. The AST overhead and Python dynamic lookups were killing performance.

​So I tore open the engine and built a flat register VM in C (foxvm.so).

​The results:

​Old Tree-Walker: ~8.42s (10M cycles)

​New C VM (FoxCVM): 0.83s (10M cycles)

​Wired clock_gettime(CLOCK_MONOTONIC) into opcode 18 for nanosecond delta timing.

​No semicolons, no colons, but now backed by compiled C machine instructions.

​📦 Repo: https://github.com/AnayUpadhyay-all/FoxVC

​For the VM architects here: what's the biggest bottleneck I should watch out for once I introduce heap allocations and closures?


r/Compilers • • 3h ago

madc v0.105.0 — Live C/C++ REPL function redefinition, and faster compilation

Post image
1 Upvotes

I've released madc v0.105.0, with some substantial improvements to its interactive C/C++ REPL, compilation performance, and portability.

For those unfamiliar with it, madc is a self-contained C/C++ compiler with JIT execution, native executable output, and an interactive REPL, without requiring GCC, Clang, LLVM, or installed development headers or toolchain.

What's new

  • Live function redefinition — redefine a C or C++ function in the REPL and subsequent calls use the new implementation, even from previously compiled callers or existing function pointers.
  • Live variable and type redefinition — reinitialize existing variables and redefine classes or structs interactively, with versioning when a type's layout changes.
  • Interactive source editing — the REPL includes an ex-style editor. Copy, modify, search and replace code directly in the session, with changes taking effect immediately.
  • Restart and Run All — replay the entire REPL buffer in a fresh session, similar to working with a notebook.
  • Faster compilation — changes to the precompiled header representation allow madc to load only the parts a program needs, substantially reducing compilation overhead.

Performance

The updated README includes benchmarks against GCC 13.3 and Clang 18.1 on Ubuntu 24.04:

Task madc GCC Clang
C++ Hello World (JIT vs compile/link/run) 83 ms 170 ms 207 ms
C++ STL example (JIT vs compile/link/run) 209 ms 252 ms 275 ms
C Hello World (JIT vs compile/link/run) 9 ms 21 ms 37 ms

These are end-to-end timings for the specified workloads, not claims that madc universally outperforms GCC or Clang.

C/C++ compatibility

Current results against external compiler test suites include:

  • C17: 99.2% of GCC's c-torture/execute
  • C11: 220/220 on the third-party c-testsuite
  • C++98: 81.3%
  • C++11: 77.3%
  • C++17: 43.2%
  • C++20: 53.8%

The C++ figures are pass rates for selected GCC test-suite subsets, not claims of complete standards conformance.

madc is available for Linux, Windows, and macOS (Intel and Apple Silicon).
The companion IDE, madcide, has also been updated to v0.8.0 with the live REPL improvements.

GitHub: https://github.com/derekbsnider/madc

Release: https://github.com/derekbsnider/madc/releases/tag/v0.105.0


r/Compilers • • 11h ago

Cole: A Recreational Attempt on Zig(*)

Thumbnail codeberg.org
12 Upvotes

Hey Everyone, after spending some time on my personal recreational project Cole, I decided to finally share it with you. It is an attempt to recreate a Zig-like language by myself in Zig, with everything hand-rolled.

It's been around 6 months of solo-work now, and the language is usable enough as-is. But I've hit a wall in comptime execution part, and every change I make now breaks something else. After spending some time to handle it myself, I realized I have to get some help. So, I present you Cole!

Note: The demos don't work in Debug builds for some reason that I can't figure right now. Any feedback is much appreciated!


r/Compilers • • 10h ago

I’m working on an Active Oberon SDK, with a Doom clone as a practical example

3 Upvotes

Hi, everyone!

Recently, I decided to return to an old passion of mine: the A2 operating system (formerly Bluebottle) and its language, Active Oberon.

I’ve created MiniA2, a project that makes Active Oberon easier to use outside of A2. Active Oberon is a general-purpose language with active objects and built-in synchronization through AWAIT. MiniA2 brings together the compiler, standard library, command-line tools, and editor support, so you can write applications and build standalone executables without running the A2 desktop.

As a practical example, I’m building AO-Doom, a Doom clone written in Active Oberon. It already loads classic maps and supports rendering, movement, pickups, weapons, and several enemy behaviors. It’s still a work in progress, but it gives the toolchain a substantial real-world application to support.

I’d welcome feedback from anyone interested in language tooling, concurrency, Oberon, or Wirth-style languages.

Explore MiniA2:

https://github.com/active-oberon/minia2

Available packages:

https://active-oberon.github.io/a2-registry

AO-Doom:

https://github.com/active-oberon/ao-doom

For a quick introduction to the language, I’ve also added an Active Oberon page to Learn X in Y Minutes:

https://learnxinyminutes.com/active-oberon/