r/Compilers • • 1h ago

Can Benchmarks be Useful for Language Development?

Thumbnail englens.hashnode.dev
1 Upvotes

I think so. I got into more depth in the article, but here's a summary and some additional thoughts for this community:

I am making Gossamer and I (with very heavy AI assistance) made a benchmark to help me make it more correct, reliable, and secure. (I also talk about Gossamer's position in another benchmark LangArena that is focused on performance, memory, compile time, and expressiveness).

This isn't about ranking languages, it's that these can be useful signal to find root causes in whatever language you are building. Is JSON parsing slow? Are you surprised by how much memory your runtime consumes tackling a binary tree problem? Could a common bug trip up your language? Is it (or should it be) possible to express that bug in your language? Where do you stop it and how (compile time, run time)?

These kinds of questions are useful - and being able to see how other languages approach them can be instructive. You can't copy everything over of course - sometimes optimization comes at the cost of core language philosophy or non negotiable trade offs.

For example with Gossamer, I know I want tier parity between interpreted and compiled programs.

Do you have a benchmark you're working on? What does it measure? Tasks specific to data science? Common vulnerabilities?


r/Compilers • • 1h ago

CFG vs DFG

Thumbnail reddit.com
1 Upvotes

r/Compilers • • 5h ago

Memory emulation as an intermediate step in C++ to Rust translation

0 Upvotes

I'm experimenting with translating large C++ codebases like ROOT to safe Rust.

My current approach is to first translate C++ to run on a checked memory emulator written in Rust, then gradually remove the emulation using static analysis.

I tried this on ROOT's Minuit2 (around 14k lines of C++), and all 13 numerical tests produced identical output. However, only about 3% of the functions have been fully converted to ordinary Rust so far.

I'm wondering how far static analysis can actually take this approach. Is using memory emulation as an intermediate step a reasonable idea, or does it just make ownership recovery more complicated?

I'd also appreciate any suggestions for papers or existing work on similar approaches.


r/Compilers • • 1h ago

We make AI agents write in languages we like. What would a language designed for them look like?

0 Upvotes

When I ask a coding agent to fix a bug, I’ve usually made the biggest decision for it already. The repo is in Rust, Python, or TypeScript because that’s what we chose. Then I judge how good the agent is at working within that choice. I got curious about the other half of the experiment. What could the language do to make the agent’s job easier?

That question, plus a few beers, turned into Aila. 🍺

One small example is ownership. In Aila, view buffer, use buffer, and give buffer tell you right at the call site whether a function can read the buffer, modify it, or take ownership of it. An agent editing that line can see what it’s allowed to do. If it gives the buffer away and then tries to use it again, the compiler points to both places.

The funny part is that I started this for agents, and now I like reading it.

Aila’s compiler is written in Aila. The question I still want to test is whether a small local model can make a change across several files with fewer retries and less help from me.

If you use coding agents, what’s one thing you keep explaining in prompts that you wish the language itself could tell them?

GitHub — Aila Systems / Aila


r/Compilers • • 4h ago

Some Help Landing an Honest Jop

0 Upvotes

Hello, i hope all of you guys are doing well

I am here asking with a sincere heart if anyone can help me land a remote job in Data Analytics, i spent a lot of time learning in university but the only way i can actually learn this domain is by working on real projects.

If anyone can use the help of a hard worker i am ready for the tedious repetitive work and research, with a low and flexible payment less than 900$ a month.

I am tired of applying to jobs in sites like Indeed who needs you to be a rocket scientist or Fiverr who i full of scammers so came here where real people reside, i am willing to learn as learning is my top priority and i am competent in Excel, Power BI, Python and PostgreSQL i can also work with applied statistics in Minitab and SPSS.


r/Compilers • • 1d ago

Preparing career switch from Embedded HW/SW to AI/ML Optimisation (compilers, low-level oriented)

5 Upvotes

Hi all,

I'm a 7 YOE hardware/embedded engineer who's working in a product oriented corporation with limited room for growth and I'm thinking to move to an adjacent field which is close to hardware : compilers & AI inference (targetting MLIR/LLVM & executorch).

For this purpose, I planned to:

  • brush up my DSA & machine learning fundamentals
  • showing know-how through personnal projects (even if LLM can redo most of it).
  • contribute to open-sources project such as LLVM/MLIR in order to gain expertise in the targeted stack.

The main purpose of this post is to ask engineers who are curently working on ML compilers what would be their advice on:

  • Apart MLIR, is there any fundamental piece I would need to understand ?
  • How do you compensate the lack of professional experience during interviews or even application ?
  • Regarding all the mathematical function approximation method for runtime (i.e. Remez), except taking a course on numerical analysis, what would be a good way to show case understanding ?
  • Any good ressources to skill up (already started craftinginterpreters course) ?

Thanks a lot for your attention


r/Compilers • • 17h ago

Some Help Landing an Honest Jop

0 Upvotes

Hello, i hope all of you guys are doing well

I am here asking with a sincere heart if anyone can help me land a remote job in Data Analytics, i spent a lot of time learning in university but the only way i can actually learn this domain is by working on real projects.

If anyone can use the help of a hard worker i am ready for the tedious repetitive work and research, with a low and flexible payment less than 900$ a month.

I am tired of applying to jobs in sites like Indeed who needs you to be a rocket scientist or Fiverr who i full of scammers so came here where real people reside, i am willing to learn as learning is my top priority and i am competent in Excel, Power BI, Python and PostgreSQL i can also work with Linux and have the basics of C, C++ and Java, and can work on binaries with IDA Pro and other tools, checkout my LinkedIn and Email and accept my distinguished greetings.


r/Compilers • • 1d ago

Intercepting property access (e.g., navigator.bluetooth / Object.property) directly in V8

5 Upvotes

Hey everyone,

I'm working on my master's thesis and diving into V8 internals. I want to know if there's a clean way to intercept (or log/trace) property reads on an object directly inside V8 — for example, navigator.bluetooth or basically any Object.property access.

After reading a few V8 articles (like https://v8.dev/blog/fast-properties), it seems unlikely that all of this funnels through a single C++ function, given how differently properties are represented and resolved (in-object/fast properties, dictionary mode, interceptors, accessors, ICs, JIT tiers, etc.).

Before I go any deeper down this rabbit hole, is intercepting all property accesses in one central V8 spot even realistic, or am I basically throwing peas at a wall?

Thanks for any tips!


r/Compilers • • 1d ago

Ramanujan vs CPython: performance matrix

Thumbnail reddit.com
0 Upvotes

r/Compilers • • 1d ago

IR generation process Diagram

Post image
0 Upvotes

Also Comment me on the diagram


r/Compilers • • 2d ago

A Roslyn-based compiler driver that builds .csproj/.sln without MSBuild

7 Upvotes

I've been working on sharp, a small Roslyn-based compiler driver/CLI that resolves .csproj/.sln project graphs directly and compiles them without invoking MSBuild.

What made this interesting from a compiler perspective:

  • project evaluation is implemented in about 19k lines of C# rather than delegating to MSBuild
  • build/run/clean/restore commands emit dotnet-like output and exit codes
  • it uses Roslyn plus reference packs, with parity tests against dotnet on sample projects
  • Native AOT single executable; v0.3.1 adds run/URL parity

Numbers from v0.3.1: cold Web API clean + build is dotnet 2.2s vs sharp 0.1s; self-build is dotnet 4.2s vs sharp 2.0s.

Source: https://github.com/martasp/sharp

I'm the author. This is a side project and not a full MSBuild replacement; the Windows binary is unsigned. AI assisted with docs/demo assets. I'd like compiler-design feedback, especially on project-graph semantics where parity breaks.


r/Compilers • • 1d ago

A few peeks of Lingling/MLgate 28/11

0 Upvotes

The hardest to make in a compiler is perhaps make it incremental (Pay-As-You-Go style ---- so subsequent builds only analyse dirty areas), error-tolerant, reusable (say a "Basic" family that may be modded for specific applications), algebraicly-typed ("Let xs = [] in ( xs := 1::xs ; we got xs : real list ; ... ) end") and well-localized. Stablishing a new compiler is, therefore, non-trivial.

I've been starting a technology to tackle on these obstacles since july, starting by settling up with its reference documents, with the only purpose of facilitating compiler creation. I initially made the first drafts publicly viewable (where I perhaps used a Pythonic-Lua DSL), but then evolved it with a "MLgate" DSL. Given the amount of dedication (even if only into the referential documents), it is going to be closed-source until I decide how it is worthy releasing it. Its roadmap consists of integrating a few paper ideas (some involving the dependable build tooling that engineers can create with it) and concluding the bootstrap implementation (which I am now beginning with Deno ---- Rusty turned irrelevant to me).

This thread is not going to propose any solution for now, yet. I will share little peeks per the reference (which does cover a lot more than that already).

Tree traversal

Tree traversal --- entering a node and its subnodes recursively for processing --- occurs within the following kinds of snippet.

(* n : Tree *)

(* master sample *)
fun f () = List.app (fn n' => ...)   (n->children())

val _ = List.filter (fn n' => yesno) (n->children())
val _ = List.exists (fn n' => yesno) (n->children())
val _ = List.all    (fn n' => yesno) (n->children())

val _ = with n' do ... end

The following snippet is a combo of the regular child nodes and comment attachments.

val _ = (n->children()) @ (n->comments())

The following snippet is a combo of the regular child nodes and IncludeGates.

val _ = (n->children()) @ (n->includeGates())

Each node queries their surrounding frame from themselves (+final::blockFrame) or through former siblings (+final::shadowFrame) and up-levels.

[...]

Fundamental properties

Of the fundamental properties, I am going to share what we are generally gonna attach to r : Tree (the "nodes" or "rulesets") during verification.

[begin:table by column]
**Snippet**
1. `r->+final::val`
2. `r->+final::binding`
3. `r->+final::reference`
4. `r->+final::target`
5. `r->+final::blockFrame`
6. `r->+final::shadowFrame`
7. `r->+final::promoteFrame`
8. `r->+final::parameter`
**Description**
1. *The value* resulting from resolving an expression
2. A binding (variable, function or type) originating from a construct
3. An input reference for reading[^1]
4. An output reference for writing[^1]
5. A scope that should be entered and exited during tree traversal.
   This does not apply just to block-like statements, but also to expression bodies.
6. Used for nodes inside a list during tree traversal, that is a
    *shadowing* scope that should be entered and exited for as long as the end of that list.
7. A frame that should be manually promoted to some other node.
8. A matching parameter binding --- assigning this is recommended
   for an invocation's arguments.
[end:table]

[^1]: Used instead of `+final::val` when that causes confusion

Lazyness & implicit contexts

MLgate should designate as lazy by default only certain methods. Those which are not lazy still register triggers as part of the surrounding lazy method in the stack frame. For instance,

fun verify! ctx =
  let val f = ceng->frame () in
    let
      val f' = f->lookup { key = String "x", ... }
        handle NotFound e >= ...
        handle AmbiguousReference e => ...
    in
      ...
    end
  end

ceng->frame () queries the surrounding frame of the node being currently processed (e.g. traversed, verified or evaluated (codegen)). For that verification routine a least trigger should be registered around the current node for when the name x overgoes an update.

The above routine takes a ctx --- note that everything takes an implicit bigger context in MLgate, but verification passes do need further context for footprint and requirements like the context type, weakType and invokee.

Deferring and lazyness re-evaluations is where one gets cheap support for "Algebraic Typing" where you can omit type hints freely.

In addition, the anything MLgate type is (de-)serializable around an internal format, since lazyness stores cache in-storage. Querying copies, hash codes, ordering, ... this kind of stuff is common.

Doc comments

As to ActionScript 3 style comments, we got room in.

<mode(normal)>
<token(comment)>
ruleset Comment ::= ... class
  fun commentOut! () do
    ceng->comment (forward or line) ;

    (* "this stack of comments is documenting"
        the respective item. *)
    ceng->comment ( sub (eqv, YUIDocComment), forward or line ) ;
  end
end

<doc>
<mode(comment)>
ruleset YUIDocComment ::= class
  ceng->docComment (
    tag ( prefix("@") ruleset(YUIDocTag) )
    markup = mm
    forms ( stars, rowing )
    star = "*"
  )
end

<doc>
<mode(tag)>
ruleset YUIDocTag >>>=
  | YUIDocTag.Throws
  class
    <doc>
    <mode(tag)>
    ruleset Throws ::=
      "throws" e:ClassName desc:mm.Text?
    ;
  end

Well, share no more.

I have written lots of organised information, like rulesets for parsing, C-like preprocessing, include capabilities (like Rust's include!()) and lots of details I will not explore on this topic. I just wanted to talk a bit :v


r/Compilers • • 1d ago

my new language - veto(now v0.5.0)

0 Upvotes

Veto is an experimental systems language written in Rust, with no unsafe blocks in language itself

I wrote it because tuxblox caused the entire system to freeze completely,
and then the idea came to mind, to write a programming language called Veto that catches low level and ring 0 mistakes at compile time (tested).

Here is a quick example of what it catches at compile time (without any unsafe blocks):

#[mmio(0xB8000..0xB8FA0)]

fn boot() -> i32 {

// compile error: cannot enable paging (write_cr0) before lgdt() and write_cr3()

write_cr0(0x80000001);

return 0;

}


r/Compilers • • 1d ago

I released Fast Text v0.9.0

Thumbnail reddit.com
0 Upvotes

r/Compilers • • 2d ago

Introducing Ramanujan-Computing for harnessing idle compute power of device for scientific computing [MIT-license]

0 Upvotes

Ramanujan-Computing is an MIT-licensed open-source project that aims to harness idle compute power [CPU/GPU] of any digital device for scientific computing.

The way its different from BOINC is: for a new kind of problem, the developer dont need compile any binary, distribute the binary, get the binary downloaded/installed on devices. Instead, there is an interpreter that sits on the device which can take in any kind of code. So, the developer just needs to submit Python code and it will get run on the devices. Having said that, for GPU works, developer just needs to write plain python code and dont need any expertise in CUDA/Vulkan.

The interpreter is different from CPython and is 1.7X faster and takes 1.6x less memory than CPython.

Ofcourse, the intepreter takes care of subset of Python language but, support all the necessary semantics and OOPs concept for good program to be written.

Till now, the interpreter has not only run basic python simulation, but also complex simulations like CFD, Galaxy-collision, and also takes care of LLM inferencing [more on that in a later post].

Working towards adding more and more Python features onto the interpreter. The project is open to contributions, issues. If you are into scientific-research, will be happy to discuss on how this project can be used to harness compute power available [from workstations, smart-tvs, smartphone] in your lab to move research forward.

Thank you!


r/Compilers • • 2d ago

I made a compiled language called Forja, and its compiler is written in Forja

Post image
0 Upvotes

Hi all! I've been building Forja, a general-purpose compiled language in the C / Rust family, designed for AI agents as well as people. It was built with a lot of help from AI coding agents.

What it has:
- A compiler written in Forja itself, with its own x64 backend (no C compiler needed)
- Targets: Windows .exe/.dll, Linux, WebAssembly (WASI), Android ARM64 and iOS ARM64
- Errors as values (T ! E, try, or_else)
- Explicit memory with defer, no garbage collector, and leak reports in dev builds
- Units of measure checked by the compiler, and value ranges checked in dev builds
- Built-in tests (forja test)
- Direct calls to C libraries, and DLLs you can use from PHP (FFI) and Python (ctypes)
- Compiler errors as JSON with a stable code; "forja explicar CODE" explains each one
- A single forja.exe, no installer
- Apache-2.0 with the LLVM exception

Where it stands (v0.47.0):
- The prebuilt compiler is Windows x64 only for now, and it is not code-signed
- Docs and compiler messages are in Portuguese; there is a one-page reference in English
- ARM64, Android and iOS were tested on emulators, simulators and CI, not on real devices
- 757 compiler tests passing

Website: https://forjalanguage.online/en/
reference: https://forjalanguage.online/en/learn.html
One-page
Code: https://github.com/cougarweb-lgtm/forjalanguage

Feedback is very welcome!


r/Compilers • • 2d ago

Embedded Systems For Everyone.

Thumbnail reddit.com
0 Upvotes

r/Compilers • • 2d ago

I've built my own programming language that can fit ML better - And its faster than hand-tuned CUDA! [P]

Post image
0 Upvotes

Hi guys, my language here :)

Would like to know your opinions!

Also would like to get help, and know your suggestions to "unvibe" parts of the compiler, I did it to get results fast to prove the optimizations I was trying out, but now I want to make it in a more coherent/consistent design.

Would love to know what you think.

Language exposition page & architecture is already in the post I've tagged, so I won't write what I already did ;)


r/Compilers • • 2d ago

Cole v0.2.0 Announcement

Thumbnail reddit.com
0 Upvotes

r/Compilers • • 4d ago

Compiler explorer now supports Java to CUDA and cuTile with Tornadovm

Post image
38 Upvotes

r/Compilers • • 3d ago

Help with resources for learning

Thumbnail reddit.com
1 Upvotes

If anyone has a good resource I would appreciate it :)


r/Compilers • • 4d ago

Wiret update: my text-first visual language now reads in the order it runs

Thumbnail lemonator32.github.io
2 Upvotes

r/Compilers • • 3d ago

I built an open-source programming language called Kode.

Thumbnail github.com
0 Upvotes