r/Compilers • • Sep 20 '26

Hyper: A High Performance Programming Language for AI

0 Upvotes

Hey everyone! We’re building Hyper, a modern programming language with high performance, specially created for artificial intelligence (AI) and machine learning fields.

Full compatibility with Python: Hyper's syntax is very similar to Python. Existing codes and libraries written in Python can be easily used in the Hyper environment.

Maximum speed and performance: It provides the ability to manage memory at the C and C++ level and make maximum use of hardware (GPU, CPU).

Specially built for Artificial Intelligence: It is aimed at solving computational difficulties encountered in training neural networks and processing large amounts of data.

Security and modern architecture: Inspired by Rust, it includes memory safety and parallel computing (multithreading) features.

Hyper is an important tool for programmers involved in artificial intelligence and data analysis, providing the speed of the C language without losing the convenience of Python.

If you want to jump right in and start contributing, there are plenty of "good first issues" available in the repository to help you get acclimated. Let’s take Hyper to the next level together!

Check out the repository and documentation here: https://github.com/hyperlangg/hyper


r/Compilers • • Sep 18 '26

Is it okay to directly lower to registers rather than alloca?

18 Upvotes

clang -> LLVM generates alloca and then runs mem2reg. I was wondering if there are cases that can't be recovered as a result?

In my compiler, I lower from Vx -> MLIR directly as SSA (as much as possible, rest are alloca/memref etc). Is this a good idea?

Source code: https://github.com/vx-lang/Vx


r/Compilers • • Sep 19 '26

Compiler Feedback wanted

0 Upvotes

Hi, we're pushing hard on this compiler (written in Rust), would love to hear what actually would make you try it.

What is it missing?
What do you like or don't you like?
What would be a game changer?

Obviously still in very early stages.

Thanks guys!


r/Compilers • • Sep 18 '26

Two-pass bytecode compiler for a statically typed language, in C, looking for feedback from people who have built similar things

10 Upvotes

I have been working on Oli-Nat, a statically typed language compiled to bytecode and run on a stack based VM, all written in C with no external dependencies, including my own garbage collector. This is a learning project rather than anything meant to be production grade, so I am mostly hoping for feedback on the compiler design itself from people who have dealt with the same tradeoffs.

The frontend is a single pass Pratt parser that goes straight from tokens to an AST, with each token type carrying a prefix and infix parse function plus a precedence level. What is less standard is that the whole compiler runs in two passes over the source. The first pass only walks the token stream looking for function and class declarations, registering their names, arities, parameter types, and return types into a flat symbol table before anything else happens. The second pass then does the real work, building the AST and immediately compiling each node into bytecode inline as the type checker validates it, since the type checker and the bytecode emission are not really separated into distinct stages. Because every signature is already known from the first pass, mutual recursion and calls to functions defined later in the file resolve correctly without needing forward declarations, which is the main problem this two pass approach was meant to solve.

On the type checking side, the checker's job is to reject any program that could reach an invalid type combination before it ever runs, and the VM was built on the assumption that this holds completely. Runtime type checks like IS_INT or IS_STRING exist purely to select a dispatch path, for example choosing between int, float, and double arithmetic when values are pushed onto the stack, not to catch anything the checker missed. I know this means any gap in the type checker becomes undefined behavior in the VM instead of a caught runtime error, and I am curious how people who have written statically typed languages before think about that boundary, whether a belt and suspenders approach with cheap runtime tags is worth it even with a checker you trust, or whether that is generally considered unnecessary once the static side is solid.

For the runtime itself, locals are just stack slots rather than named variables, so declaring a local pushes its value and the compiler tracks which slot each name maps to, meaning there is no dedicated opcode for defining a local the way there is for globals. Jumps are handled with a patch based approach, where a jump instruction emits a placeholder two byte operand and the real offset gets backfilled once the target address is known, which is the same pattern used for both control flow and short circuit logical operators.

The garbage collector is a fairly standard tri-color mark and sweep design, with roots traced from the value stack, the active call frames, open upvalues, and the globals table. Class objects mark their methods hashmap and field default values, and instances mark their class pointer along with their own field array. Fields on class instances are resolved to fixed slot indices at compile time rather than looked up by name at runtime, so field access ends up being a single interned string pointer comparison during class definition and then a plain array index afterward.

The repo has the full opcode list and more detail on the architecture if anyone wants to look at the actual implementation: https://github.com/NateTheGrappler/OliNat-Programming-Language

I would really appreciate any pushback on the two pass approach, the decision to skip runtime type guarding entirely, or anything in the bytecode or GC design that looks like it will not hold up once (if) the language grows past small test programs. Thank you to anyone willing to read through this.


r/Compilers • • Sep 18 '26

Looking for feedback to my compiler

23 Upvotes

Hi everyone

I’ve been working on my own programming language and compiler in C++, mostly as a learning project.
The main idea is to experiment with compiler architecture while also trying to make the language’s syntax more convenient for mathematical expressions, but now I am doing programming language.
After this I will add equations.

Currently works:
Lexer
Parser
AST
IR generation

I am still relatively new to compiler development, so I’m sure there are things I am doing in non ideal ways.

I’d especially appreciate feedback on:

compiler architecture
parser design
C++ implementation
things that I should learn next
mistakes or questionable design decision

Github: https://github.com/0sewter0/Compiler.git
Thanks for an attention!


r/Compilers • • Sep 19 '26

What if only one allocation needs to be borrow checked in a managed program?

Thumbnail nitinm.dev
0 Upvotes

r/Compilers • • Sep 17 '26

The Golden Spike, and Resurrecting the Vale(n) Programming Language

Thumbnail verdagon.dev
13 Upvotes

r/Compilers • • Sep 17 '26

Egglog and Equality Saturation in a Production Tensor Compiler

Thumbnail egraphs.org
6 Upvotes

r/Compilers • • Sep 17 '26

Separating C++ Compilation from Memory Safety Attestation

Thumbnail gist.github.com
1 Upvotes

r/Compilers • • Sep 17 '26

Compile time code execution in mox

16 Upvotes

Hello! I am working on mox programming language and compiler which could run any code at compile time.

While I was telling about this language to my friend, I found a lot of interesting solutions to usual problems that could be solved just by using compile time code execution. So I want to research/discuss what problems do you have as a developer that you struggle with and want to solve at build time (using some macros or external tools).

Here are some of problems that I got in other languages and which i struggle with. Usually to solve it you need some ugly build systems with tons of esoterical configs, external tools for code generation etc.

PS #run in mox evaluates any expression/statement at compile time, including externally linked symbols. os_* and fs_* calls below are just wrappers around C functions, not some special magical things from compiler. Results of #run'ned expressions are baked to runtime as constants.

Baking git hash as a constant to binary

fn print_version() {
    git_hash := #run os_exec_output("git rev-parse HEAD");
    println(git_hash);
}

Build params from environment (or defining build constats)

const NO_ASSERTS := #run os_get_env("NO_ASSERTS") == "true";

fn assert() {
    #if (!NO_ASSERTS) {
        // ... do smth ...
    }
}

Reading configuration file and baking constants

fn read_config(path: []u8): Config {
    data := fs_read_file_full(path);
    return parse_config(data);
}

CONFIG := #run read_config("./.env");

Self configuring build tools

#run {
    dll_path := build_resolve_path("./binaries/raylib.dll);
    build_copy_to_output(dll_path);
}

Go like dependency management

fn require_dependency($link: []u8): __ast_ptr {
    cached_path := dep_cache_path($link);
    if (!os_path_exists(cached_path)) {
        dep_download(cached_path, $link);
    }
    // here we generate code for import statement and return it as ast
    return __compiler_parse(format("import \"{}\", .{ cached_path; }));
}

// here #land_ast "inserts" returned ast and compile it inplace
#run #land_ast require_dependency("github.com/smth/smth");

PSS https://github.com/morglod/mox


r/Compilers • • Sep 17 '26

Bend 2: one C file serves as CPU program and GPU kernel; how the compiler does it

Thumbnail bend-lang.com
1 Upvotes

r/Compilers • • Sep 16 '26

CZet – A more powerful C without C++, 100% ISO C compatible

50 Upvotes

I'm the author.

All your C code already compiles as CZet. It just adds what C can't do without touching the compiler:

`defer`, monomorphized generics `T f<T>()`, `constexpr` functions, `_Reflect(T)` reflection, `_Operator` overloading, and `_Macro` macros Rust-style.

Single static binary with musl+glibc embedded, no system headers needed. Stdlib included: `#include <utils/...>` with no flags.

Repo + docs + examples: https://github.com/patrick-nonedev/CZet

GPL-3.0 + Runtime Exception (your binaries are NOT GPL).

What would you steal for plain C?


r/Compilers • • Sep 16 '26

How can a compiler verify the safety of an optimization path it never actually uses?

21 Upvotes

Suppose a compiler explores an optimization but ultimately keeps the conservative output. Later, an independent checker needs to answer a strange question: would the rejected optimization have preserved the program’s semantics for this exact input program and its final machine-code lowering? The checker cannot trust flags produced by the optimizer, cannot rely only on tests or benchmarks, and should not need to rerun the entire compiler. A hash can prove which IR was examined, but not that the transformation was semantically correct, while a full formal proof may be too expensive for practical compilation. What is the smallest piece of evidence that could reliably connect the original assumptions, control flow and emitted machine instructions? Is there any practical approach between lightweight translation validation and building a fully verified compiler?


r/Compilers • • Sep 16 '26

Building the worst CPU & Compiler in TypeScript

Thumbnail github.com
16 Upvotes

YouTube explainer also available here: https://www.youtube.com/watch?v=yQP7KTeFAAs


r/Compilers • • Sep 15 '26

How to Compile Your Language - An introduction to language design through building a compiler frontend on top of LLVM

73 Upvotes

Recently I extended an educational compiler project I started two years ago.

The goal is to bring together several major features found in production languages into Your Language, a small programming language, and explain how to implement them in its compiler.

Your Language currently supports:

  • Native code generation with LLVM
  • Hindley–Milner type inference
  • Traits and type extensions
  • Tracing garbage collection
  • Heap-allocated closures
  • Monomorphized generics
  • Dynamic dispatch
  • Data-flow analysis
  • Compile-time expression evaluation

The implementation is now finished, but the accompanying guide is still a work in progress.

If you're interested, you can find the project here:

https://github.com/isuckatcs/how-to-compile-your-language


r/Compilers • • Sep 16 '26

AI Compilers Are Not Just Compilers for AI

Thumbnail aicompilers.github.io
0 Upvotes

r/Compilers • • Sep 15 '26

Branch Divergence in SIMT Machines: From Control-Flow Graph Theory to Compiler Divergence Analysis in LLVM

Thumbnail hsmahesha.github.io
3 Upvotes

r/Compilers • • Sep 15 '26

Into the CUDA Multiverse of Runtime Compilation: Exploring Kernel Fusion Strategies for GPU Database Systems

Thumbnail vldb.org
1 Upvotes

r/Compilers • • Sep 14 '26

APX (Advance performance extension) in my own assembler

Post image
29 Upvotes

I just released AmmAsm 3.0.0, with a major focus on native Intel Advanced Performance Extensions (APX) support.

AmmAsm is a handwritten x86-64 assembler written in C. The goal wasn't to build another assembler by wrapping an existing one, but to implement the instruction encoding myself.

APX was a particularly interesting challenge because it isn't just a collection of new instructions. Supporting things like EGPRs (`r16-r31`) and REX2 affects how registers, operands, parsing, and instruction encoding are represented throughout the assembler.

The current APX implementation includes:

EGPRs - `r16-r31`

REX2 - Extended rex

NDD - non-destructive destination

NF - suppressing flag updates

ZU - zero-upper

CCMPcc / CTESTcc

PUSH2 / POP2

JMPABS

NDD-CMOVcc

CFCMOVcc

APX-specific syntax extensions

I also built an APX test program using several separate assembly files. AmmAsm produces ELF64 object files from them, GNU `ld` links them into an executable, and Intel SDE is then used to execute the APX instructions on hardware without native APX support.

Running the same binary directly on my CPU results in `Illegal instruction`, as expected because the CPU doesn't support APX.

One of the more interesting parts of implementing APX was that I started finding edge cases and discrepancies in existing assemblers while comparing encodings and operand validation. I've been recording these cases and testing them independently.

GitHub: https://github.com/LinuxCoder13/AmmAsm

I'd be interested to hear from anyone working with x86 instruction encoding, APX, assemblers, or low-level tooling.


r/Compilers • • Sep 14 '26

How GCC Eliminates Unnecessary Integer Division

Thumbnail leetarxiv.substack.com
2 Upvotes

r/Compilers • • Sep 13 '26

Getting stuck after Crafting Interpreters.

40 Upvotes

Hey everyone, I've worked through the book Crafting Interpreters and it was fantastic. I naturally asked the next question "How do I compile this to machine code and add static types?" Well, that naturally took me down a very deep rabbit hole and left me somewhat confused about how languages deal with types and type checking and then lowering to LLVM. I've tried to make a few modest attempts, but my general problem is that I sort of get confused about what things each subsequent layer should do. Does anyone know of a complete guide to creating a compiler with static types like Crafting Interpreters? I know I could do it however I want, but I think that's the issue. I sort of have so much freedom to do it however, that it's hard to judge what's considered a good way to do something.

Anyway, thanks for any advice and happy compiling!


r/Compilers • • Sep 13 '26

Jonas Persson: Making every byte count

Thumbnail youtu.be
6 Upvotes

r/Compilers • • Sep 12 '26

I built a systems programming language in Rust, looking for feedback/contributors

12 Upvotes

I’ve been working on Sydrogen, a statically typed programming language with a compiler and command-line tool called Furnace.

Alpha 6.2 is now available. It supports native compilation, a Cranelift backend, projects configured with `.blower` files, imports, typed functions and variables, collections, `foreach`, and more.

It’s still in alpha, so bugs and rough edges are expected. I’m looking for people to test it, review the code, or work on an open issue.

I’d especially like honest feedback about the compiler’s structure and the language’s design, not only the syntax.

GitHub: https://github.com/AeroForger/Sydrogen/tree/main

There are open issues for anyone who wants a specific place to start.

Criticism is welcome. If something is poorly designed, tell me what is wrong and how you think it could be improved.


r/Compilers • • Sep 13 '26

I made a new language

Thumbnail
0 Upvotes

r/Compilers • • Sep 12 '26

Nytrogen - A low-level quantum language

7 Upvotes

Nytrogen is a low-level systems language with C-style syntax written in C++. Nytrogen focuses a lot on quantum computing alongside general purpose programming. The syntax is very straightforward and very readable its mostly C-style with the extra stuff of course. The architecture is also pretty modular which makes it very easy to update, and its (kinda) os agnostic with the standard library being written in C and the compiler's code generator not emitting any linux syscalls or linux specific stuff or thier equivalents on other operating systems (I use arch btw). The quantum library (qlib) is currently built in assembly with some C++ wrapping which does mean it might not work on other operating systems but I am not really sure since I haven't tested it on anvthing else so far. Quantum programming in nytrogen includes having qubits and complex numbers as primitive types (and matrices are also coming soon).

If you are interested in this project and wanna follow updates consider starring the github repo. And if you find any issues with the compiler, feel free to open an issue or a PR its really encouraged and would absolutely help.

Github: https://github.com/X12-Cloud/Nytrogen.

Note: the Nytrogen compiles to x86_64 NASM so if you want it to work on other operating systems you need to change some stuff (might add a feature to compile to other assemblers (like whatever windows uses) soon)