r/Compilers • • 27d ago

Générer des appels à des DLLs sur Windows avec un interpréteur

0 Upvotes

Salut, j'ai fait du DLL Engineering avec de l'asm x86_64 sur Windows que j'ai mis dans mon interpréteur fr-simplecode en C.

On peut donc appeler n'importe quelle DLL dynamiquement, créer des structures compatibles avec du code C compilé. Et également utilisé un CALLBACK pour les fenêtres Windows (je mettrai les autres CALLBACK dans les prochaines mises à jour de l'interpréteur).

La dll dll_service.dll peut être lié à n'importe quel code C avec dll_service_api.h

Ici le code ne génère qu'une fenêtre Input simple avec deux codes différents : avec ou sans le CALLBACK par défaut : DLL-Engineering-x86_64-Windows/create_windows.frc at main · argentrocher/DLL-Engineering-x86_64-Windows

Le code de la DLL dll_service.dll doit être lié à fr-simplecode0.5 avec la commande suivante si vous souhaitez l'exécuter :

fr-simplecode0.5 --dll[0]:"dll_service.dll" --dll_filters[0]

Trouvez-vous ce code fonctionnel et performant ?


r/Compilers • • 28d ago

Update on the Monad language Oak framework for web apps and more

1 Upvotes

r/Compilers • • 29d ago

Any opportunities for engineering undergrad?

12 Upvotes

I am a final year engineering student. I am extremely interested in learning and building compilers . Now I need some guidance and some project to work on with professors or industry experts or people who have worked a lot in this domain .

If you have or you know any internships , project assistant roles or anything , please let me know .

it will be of a great help .


r/Compilers • • 28d ago

Zena : a language for WebAssembly

Thumbnail zena-lang.dev
0 Upvotes

r/Compilers • • 28d ago

ASMBI description

Thumbnail reddit.com
0 Upvotes

r/Compilers • • 28d ago

3.51x speedup against C++ and Rust: Why Goose‘s claims aren‘t fair (kinda)

0 Upvotes

Everyone is talking about the new Programming language called goose. It‘s biggest claims are a 3.51x speedup against Rust and C++ and dynamically sized containers with stable references.

This is true — but only under very specific circumstances. Looking at the benchmarks (16 in total), the 3.51x speedup is a win against "idiomatic C++". The gains against "hand optimized" C++ and safe Rust are 1.24x and 1.13x, while there is nowhere specified what "kind" of goose was used in those benchmarks, while the term "optimized" is also not objectively defined. And Goose isn‘t even faster in all cases. For example:

  • Goose loses to expert C++ and safe Rust in the LRU benchmark: 0.88× & 0.81x.
  • Goose loses to safe Rust in the scene benchmark: 0.82×.
  • Goose loses to safe Rust in the calculation benchmark: 0.91×.

3.51x Speedup is a very selective representation of the result.

The biggest Catch: "No heap" doesn‘t mean unlimited memory.

Goose uses statically assigned data stacks with large reserved address-space ranges and bump pointers. The official documentation says:

  • Every resizable container has it‘s own data stack. (While ownership of the stack can move to another value if the old one goes out-of-scope, so maybe, so it gets reused when they live sequencially)
  • Groth advances a bump pointer.

And exactly that is the catch. It is not real dynamically sized data. I mean, conceptually, it is. It can grow at runtime. Every Goose data stack reserves a few Gigabytes of virtual address space by default, and commits physical memory if needed without occupying it from the beginning, granting stable references. But, and that’s a big "but", if that virtual adress space exceeds, the program gets terminated, like an uncatchable exception.

That can destroy the purpose of dynamic data.

When the size of a container is clear at compile or construction time, an array absolutely fulfills this job in almost every case.

The reason You need dynamically sized data is this: Imagine having a game where enemies spawn and get killed. There is no limit for enemies that can exist at the same time. You don‘t know what the player does at compile time. There could be only three enemies, but also a hundred or thousands of enemies. You can‘t reserve the whole RAM for your game, of course, and you can‘t just use the memory right after your container because it may be already occupied. And scattering objects across memory is not an option either, because it destroys CPU locality and therefore also performance. So normally, you allocate new space that is bigger, copy/move all the old elements and free the old space.

But in that case, you cannot use one of goose‘s „dynamically sized“ containers. Because, if you have so much enemies it exceeds a certain memory limit, your game gets terminated (which you usually don‘t want in prod)

So, my statement: It is not apples to apples. Goose's performance advantages come from several things: No general-purpose allocator on the allocation path. No per-object destruction. Contiguous data layouts. Narrow relative references instead of full pointers. More compact variable-sized enum representations. No relocation when growing containers. These are genuine architectural advantages, but they aren't exclusive to Goose.


r/Compilers • • 29d ago

I made a Concurrency lib in Nim using macro and it perform on par with the Goroutine has many features and is easy to use than you can think.

Thumbnail reddit.com
3 Upvotes

r/Compilers • • 29d ago

Spectre v0.0.12 released, with benchmarks surpassing Zig in runtime performance

0 Upvotes

A few new things in this release, including the fmt command (formatter) and critic subcommand (Iinter/checker), plus std/netx for simplifying usage of the std/net API. The language compiles to QBE IR, which compiles to assembly.

https://github.com/spectrelang/benches

Here are the benches showcasing Spectre runtime performance vs other compiled systems programming languages, and here is the site.

Spectre v0.0.12 release

EDIT: TheOddYehudi919 is a real piece of shit and should fuck off and rot in a ditch tbh.


r/Compilers • • Oct 31 '26

Template Metaprogramming's Performance Limitations

Thumbnail reddit.com
5 Upvotes

r/Compilers • • Nov 01 '26

Sail AI Language

0 Upvotes

I've created new programming language for AI by AI named Sail. It supports neuro-symbolic binding `infer| ... fall|`, fuzzy operator ~ , and other stuff. Source code: https://github.com/zema26/sail-one-language/

Working web version:

https://sailcompiler.replit.app


r/Compilers • • Oct 30 '26

Updates on Cole, and Version 0.1.4 announcement

8 Upvotes

Hello everyone, since my last two posts here, I got into a small flow-state with the codebase and improved Cole quite a bit. I took the advices of the wonderful people in the comments as well, and it helped me a lot to be honest.

Since the last posts, I added:

- 212 tests in total, testing various aspects of the compiler through simple programs,
- Proper generic type generation with full generic definition support through comptime called functions,
- Proper generic function generation through comptime called functions,
- Type deduplication, and codegen improvements,
- And many more bugfixes on different aspects of the compiler.

In the current state, the backend is embedded TCC, so codegen emits almost-human-readable C code. But I will replace the backend in the future with LLVM, QBE or handwritten x86_86 generator. However for now, since the rest of the compiler is not solid enough, the C backend eases the development quite a bit.

Beside all of this, I made a small website (which doesn't work quite well because I self-host it on an old laptop, it is for giggles of it so don't take it seriously) that has versioned language reference, a small welcome page with a hello world snippet, and installation instructions.

Overall, Cole has become something far beyond what I imagined it would become in a good way. I am self taught, so I am pretty content with what I have accomplished. But criticism is always welcome.

The link to the Cole website is here. And the Codeberg and Github repos are here and here.

Also, occasionally, I write blogposts about what I'm currently working on, so I'll leave it here as well.

Many thanks to everyone that commented to any of my previous posts, have a good day/night!


r/Compilers • • Oct 31 '26

I'm making a programming language, searching for contributors

0 Upvotes

Hi! Me and another person are working on a programming language called KrabbaScript! It's garbage-collected (optional), statically typed and trying to be as simple and intuitive as golang but more human-friendly. This is KrabbaScript's syntax:

Variables are defined as:

var krabba = "Krabba!";

Variables may also have a type or be uninitialized, like:

var with_type: F32 = 5.0;
var uninitialized: Str;

KrabbaScript also has values, which are immutable, example:

val constant = 5;
val with_type: I32 = 5;

KrabbaScript also has control-flow (duh), example of a repeat statement:

repeat {
  Std.print("KrabbaScript is the best language OAT!");
} until popular;

KrabbaScript also has a when statement, which is more of a switch one:

when language {
  == "Elixir" do celebrate();
  == "Haskell" do complain();
  == "KrabbaScript" do {
    contribute!;
    applaude!;
  }
  else do Std.print("I don't know anything about " + language);
}

KrabbaScript also provides an ASI (Automatic Semicolon Inserter) if you're tired and sick of semicolons, you can use it with the format command.

If you want a little bit more examples, check out the repo! We are also working on tools for KrabbaScript like package manager, style checker, etc.

We are searching for contributors and maybe you, the person reading this post, can help us create KrabbaScript or improve it!


r/Compilers • • Oct 30 '26

What are the features you wished your everyday programming language had?

9 Upvotes

I'm designing my own programming language called Snore, and besides other things, I aim to make it general purpose and hence if i can fix any common struggles or annoying forms in popular languages, it would be really helpful. Which such struggles do you experience? (my language is at https://codeberg.org/grewstad/snore though it is at quite an early stage)


r/Compilers • • Oct 30 '26

Where to start? Any books, resources youd recommend?

16 Upvotes

Hello,

For my final year project at university, I need to essentially design and implement a programming language (omitting lots of details). The issue is that I have not yet studied compilers at uni, and will be doing that in january, but i need to start work on my project now

I dont know much about compiler design. I dont really know how to make a lexer or a parser

Where should i start? Are there any books or resources youd recommend?


r/Compilers • • Oct 30 '26

Heavenly delights of hashing numbers under EQUALP

Thumbnail turtleware.eu
2 Upvotes

r/Compilers • • Oct 30 '26

TornadoVM v8.0.0: Meet TC, TornadoVM's Own Compiler (replacing old Graal/JVMCI-based solution)

Thumbnail tornadovm.org
2 Upvotes

r/Compilers • • Oct 30 '26

The Convergence on Deterministic AST Invariants: Why Frontier AI Had to Abandon Probabilistic Code Editing

Thumbnail reddit.com
0 Upvotes

r/Compilers • • Oct 29 '26

Could source-level formal verification enable better IR optimizations?

5 Upvotes

Recent advances in LLM-assisted proof construction seem to make formal verification increasingly practical.

This got me wondering whether the results of formal verification could also benefit compiler optimizations.

For example, a compiler frontend or a separate tool could formally verify annotated source code, then propagate verified properties, such as constraints, invariants, and preconditions, into the IR for subsequent optimization passes.

Could this enable optimization opportunities that conventional static analysis might otherwise miss?


r/Compilers • • Oct 29 '26

InferType, and toolkits for building compilers

Thumbnail drops.dagstuhl.de
7 Upvotes

(not the author, just sharing because I found it)

Recently I came across the paper by Senxi Li et al, InferType: A Compiler Toolkit for Implementing Efficient Constraint-Based Type Inference. Check it out!

I've always found interesting the concept of making modular, extensible compilers. And by "modular", I don't just mean separate compilation à la OCaml, Haskell (they're cool btw), or parser generators à la lex, yacc (also cool btw).. I mean embedded domain specific languages and libraries à la parser combinators, MetaOCaml for concrete code generation.. components that can generalize a part in the compilation pipeline and can be imported as a reusable library. We have seen libraries to handle the lexing and parsing part. But for further semantics-related analysis parts.. not so many? So far I've found InferType, are there others like this?

Also related are language workbenches, like JetBrains MPS, and the Truffle framework and their dialects of Python and JavaScript. But so far they have only been used for making interpreters for DSLs, what about full-fledge compilers for general-purpose programming languages?


r/Compilers • • Oct 29 '26

Try/Catch: Yes or No

7 Upvotes

My language, QuarticC, has many ways to error handle.
Unions:

type Err = DivByZeroErr | int;  
Err divide(int lhs, int rhs) {  
    if (rhs == 0) return DivByZeroErr();  
    return lhs / rhs;  
}  
// Or generic:
type Err<T, E> = T | E;
Err<DivByZeroErr, int> divide...

Tagged Enums:

enum Result<T, E> {  
    Err(E);  
    Ok(T);  
}  
Result<int, DivByZeroErr> divide(int lhs, int rhs) {
    if (rhs == 0) return Result<int, DivByZeroErr>.Err(DivByZeroError());
    return Result<int, DivByZeroErr>.Ok(lhs / rhs);
// Or you could make it non generic.

Multi-Return (assuming your error types have a "ok" state):

DivByZeroErr, int divide(int lhs, int rhs) {
    if (rhs == 0) return DivByZeroErr(), -1;
    return DivByZeroErr(true) /* assuming true = ok */, lhs / rhs;
}

Tuples (same as above, but returning tuples):

(DivByZeroErr, int) divide...

And the problem, try/catch.

int divide(int lhs, int rhs) {
    if (rhs == 0) throw DivByZeroErr();
    return lhs/rhs;
}

I actually don't have a problem with the idea that handling a error isn't required too much, however the big problem is defer. Because I want defer to be a zero-cost, it does not run during stack unwinding, and I don't want to put in the effort to make it do so. This is annoying because if your primary error handling is throw, defer is basically useless for error cleanup, which is it's most useful purpose, and it's not like I'm loosing my main error handling, other forms work fine. So the question is: do I remove try catch, or do I make defer stack-unwinding.


r/Compilers • • Oct 30 '26

text-based visual programming language

Thumbnail reddit.com
1 Upvotes

r/Compilers • • Oct 30 '26

I built Eskiu, a self-hosting systems language. It now has its own ARM64 code generator alongside LLVM.

0 Upvotes

Hi r/Compilers,

I've been working on Eskiu, a statically typed systems programming language with C-like syntax, explicit memory management, generics, interfaces, async/await, and native C interoperability.

I originally learned programming with Ruby, but the more software I built, the more I found C underneath everything, including Ruby and Python themselves. Over time, I came to appreciate C's simplicity and directness.

Rust and Zig are well-designed languages, but for the kind of work I do, I wanted something simpler to learn and adopt while retaining low-level control.

So I started building Eskiu.

What began as a personal project has since grown into a language I use in production software at ReactVision, as well as in a digital identity platform. These real-world applications have pushed me to focus on reliability, performance, interoperability, and tooling rather than language features alone.

I wanted to share a few compiler milestones that might interest this community.

Self-hosting

Eskiu has two compiler implementations: the original C++ compiler and a compiler written in Eskiu itself.

Both are tested for parity, and the self-hosted implementation undergoes a three-stage bootstrap to verify that it can compile itself consistently.

EIR (Eskiu Intermediate Representation)

One of the more interesting parts of the project has been developing EIR, an intermediate representation that provides an alternative compilation pipeline.

With version 0.14.1, Eskiu gained native backends capable of generating ARM64 assembly and C99 without going through LLVM's code generator.

LLVM remains the default backend, but EIR can now produce native executables through its own compilation path.

The ARM64 backend handles calling conventions, C ABI interoperability, structures passed and returned by value, closures, and exception handling through a small runtime.

The new backends are still evolving, and LLVM remains considerably more mature in terms of optimisation.

Correctness and performance

I've also been working on compiler correctness and benchmarking.

I ported all 50 LangArena benchmarks to Eskiu. Both compiler implementations produce matching results across the suite, and on the 39 algorithmic benchmarks, Eskiu's performance is broadly comparable to C in my local measurements.

These aren't official LangArena leaderboard results, but they've been useful for identifying optimisation opportunities and regressions.

Recent improvements include LLVM loop and SLP vectorisation, faster JSON and regex implementations, and fixes for alignment-sensitive memory accesses.

Why I'm sharing this

I'm not trying to build a replacement for C, Rust, or Zig. Eskiu is simply the language I wanted to use, and building its compiler has been an incredibly rewarding engineering experience.

I'm particularly interested in hearing from people who have worked on compiler backends, intermediate representations, and self-hosting.

How have you approached validating a custom code generator against an established backend like LLVM? And at what point do you think maintaining an independent backend becomes worthwhile?

Links:

I'd appreciate any technical feedback, criticism, or suggestions.

Thanks for reading!


r/Compilers • • Oct 28 '26

I built a self-assembling x86-64 assembler from scratch

Post image
118 Upvotes

I've been working on AmmAsm, a handwritten x86-64 assembler, and recently achieved a milestone I wanted to document.

AmmAsm 1.0 was originally written in in C.

With AmmAsm 3.0.2, I managed to rewritte AmmAsm 1.0 code base to assembly x86-64, assemble it with verion 3.0.2, link, and run it again.

The repository now includes the original assembly source, test files, and execution evidence.

What makes this interesting to me is the connection between the versions: the newer assembler can process the assembly-language implementation of its own earliest version.

This isn't a claim that AmmAsm can compile itself from its current C source. Rather, it's a way to preserve and bring back an earlier stage of the project's development.

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

I'm curious how others here approach preserving old implementations and testing assemblers against real-world assembly code.


r/Compilers • • Oct 29 '26

Another Java to CUDA compiler written in Java

Thumbnail tornadovm.org
1 Upvotes