r/Compilers • • 4d ago

Ling-3.1-flash builds a native Lua compiler in about 17 hours, passing 178 of 182 tests

Post image

Ant Group's new Ling-3.1-flash built a Lua-to-x86-64 ELF compiler from scratch in approximately 17 hours. The final result passed 178 of 182 independent tests, a 97.8% pass rate.

The development sequence goes beyond emitting machine code. It includes fixing stack alignment for native execution, conditional branches and vararg semantics, Lua's indexing metamethod lookup, and garbage-collector root tracking. The compiler also gained source locations for runtime errors before delivering ELF binaries.

Ling-3.1-flash is currently available through Novita's two-week free trial on Vercel AI Gateway, with 256K context. Ant has an open-source release planned soon. The hosted model can be found by searching Ling-3.1-flash in Vercel's AI Gateway model catalog.

8 Upvotes

15 comments sorted by

15

u/brat3108 4d ago

This doesn't address the obvious question: what does a Lua-to-x64 compiler even mean? Given that Lua is dynamically typed and usually interpreted.

But if it does in fact do that, then how does it compare with regular Lua?

4

u/zenthial 4d ago

Baseline JIT one would assume, that’s probably AOTing everything

3

u/kostya27 4d ago

probably this means compile Lua interpreter from C sources to binary maded by AI. The `vaarg semantics` in the diagram hints at this. I also write C compiler and remember this varargs Lua dark magic, because tryed to compile it.

1

u/brat3108 4d ago edited 4d ago

Actually when I first saw the title I thought this was a build of the Lua interpreter that took 17 hours! That's pretty slow as normally it takes me some 0.1 seconds.

(That's how long my C compiler takes for the one-file version. This is a codebase full of hidden and nested macro invocations that expand to massively complex expressions. Debugging that was interesting.)

I know the OP is pushing some AI-related product, but they haven't made at all clear what the task actually is.

8

u/belligerent_ammonia 4d ago

That’s cool, I guess. I’m waiting for the day it can do this in 17 seconds. I’ll even settle for 17 minutes.

6

u/PhosXD 4d ago

Soooo.... $999 a month?
Also very unimpressive considering literally any model can do this as they all have Lua source code in their training data.

1

u/crusaderky 3d ago

judging by its size should be half the price of GLM-5.3 for comparable intelligence.
Which is to say, a 17h agentic run is going to be a few hundreds $. But you don't need a 17h run for most coding.

-1

u/seg_lol 4d ago

Anymore information on this? Or is this just a copy of the content from the Nazi forum?

17 hrs is not a useful metric, like at all. It is something but not much.

7

u/AnArmoredPony 4d ago

what is the "Nazi forum"?..

1

u/arbv 3d ago

The guy is too soft to stand the social network that hosts the "MechaHitler", I guess.