DEV Community

Art
Art

Posted on

The Benchmark Was a Lie (In Our Favor)

Follow-up to: "A Language Was Born Today: SMS Went Native"


Nobody told me that I cannot build a compiler without a diploma. So I just did it.

And then Claude asked the right question:

"Did you compile everything?"

No. We didn't.


One Language. Two Modes. Zero Rewrites.

This is the part that still makes me smile.

on button.clicked()
    log.success("same code")
    log.success("interpreter or compiler")
    log.success("you decide at deploy time")
Enter fullscreen mode Exit fullscreen mode

That code does not know if it is being compiled or interpreted. You decide at deploy time. No rewrites. No porting. No type declarations. No ceremony.

The language does not care. That is the point.

Most languages force a choice early: scripting or compiled. Dynamic or static. Fast or flexible. SMS says: why choose?

No type declarations. The compiler infers the type from the first assignment. Write like a human thinks. The compiler does the rest.

var name = "Olaf"
var age = 42
var pi = 3.14
Enter fullscreen mode Exit fullscreen mode

What We Missed

When SMS hit 1.26x faster than C# on March 24, these parts were still running through the interpreter:

  • All event handlers
  • All library calls (OS, AI, and others)

Half the compiler wasn't even running. And we were still faster.


The Event Syntax Nobody Asked For (But Everyone Needed)

Here is how you connect UI to behavior in Forge:

Button {id: myButton}    // SML - declare the thing
Enter fullscreen mode Exit fullscreen mode
on myButton.clicked() {  // SMS - react to it
    doSomething()
}
Enter fullscreen mode Exit fullscreen mode

The ID from SML becomes the event target in SMS. No binding layer. No ViewModel. No findViewById().

Compare that to the Kotlin way:

<!-- XML -->
<Button android:id="@+id/myButton" />
Enter fullscreen mode Exit fullscreen mode
// Kotlin
val myButton = findViewById<Button>(R.id.myButton)
myButton.setOnClickListener {
    // ...
}
Enter fullscreen mode Exit fullscreen mode

Two languages, one thought. That is the design.


The Dispatcher Is Dead

You know this code. You have written this code. You hate this code:

when (item.itemId) {
    R.id.menu_file    -> openFile()
    R.id.menu_edit    -> openEdit()
    R.id.menu_help    -> openHelp()
    // ... 117 more lines of this
}
Enter fullscreen mode Exit fullscreen mode

In SMS:

on menuFile.clicked() {
    openFile()
}

on menuEdit.clicked() {
    openEdit()
}

on menuHelp.clicked() {
    openHelp()
}
Enter fullscreen mode Exit fullscreen mode

120 menu items. Zero switch statements. Zero when-blocks. Zero dispatchers.

Every event lives exactly where it belongs. Open the file in 6 months and you still know what happens. That is not clever engineering. That is FSS.

FSS: Fucking Stupid Simple to read. Simple to write. Simple to maintain.

We did not aim for KISS. We ended up with FSS.


What "Fully AOT" Means Now

After fixing what we missed, the compiler now covers:

  • Event handlers (on widget.event()) - compiled
  • Library calls (OS, AI, and others) - compiled
  • User logic - compiled
  • Remote scripts loaded via HTTP - interpreter fallback, by design

That last point is not a weakness. It is architecture.

Trusted code gets compiled. Untrusted remote content stays sandboxed in the interpreter. One app, both modes, running together.

Think Lua in game engines. Think browser JIT with sandboxed iframes. The hybrid model is a feature.


So What Is the Real Number?

We do not know yet.

The full AOT benchmark - with events and libraries compiled - is next. What we know: 1.26x faster than C# was the floor, not the ceiling.

The first test had:

  • C# GC pressure: never triggered in the test window
  • JVM warmup: excluded from measurement
  • SMS event handlers: still interpreted
  • SMS library calls: still interpreted

The real gap is larger. We will publish numbers when we have them. Same protocol as before:

5 warmups
20 measured runs
median + p95
no cherry-picking
Enter fullscreen mode Exit fullscreen mode

And we are not too shy to race against C++. Because we don't have malloc or free. No manual memory management muddying the numbers. Just the language doing its job.


Android: It's Already Running

The AOT path targets Android ARM. And it is not "coming soon" - it is running now.

Same compiler. Same simplicity. Same FSS philosophy. Native on Android.

Benchmark numbers are next. Stay tuned.


While We Were At It

APK size: 188 MB down to 95 MB. We dropped 32-bit support. Half the weight, same power.

And one more thing.

There is a comment in the compiler now:

// Do no harm to any living being.
Enter fullscreen mode Exit fullscreen mode

We used to enforce it as syntax. Naive. The app warned us. We listened.

Now it is different. We don't force it. We don't warn about it. But if you put it in your code - the compiler knows. And it rewards you. Quietly.

Good intention reveals itself. We just listen for it.


But Why Android? Why Any of This?

I look at my phone and I know.

They see which games I play. Which books I read. What I type on the keyboard. Every app, every tap, every moment - theoretically visible to someone I never invited.

And every few months: "Please update."

No thanks. I am not inviting a new devil onto my device. The old one is already scanning everything.

My phone gets slower with every update. Touch events stop working because something is running in the background. Ads from GetApps. Bloat I cannot remove. A platform I do not control.

That is the pain. That is why this matters.

Less code. More security. No surveillance tax.

ForgeOS is the answer we are building towards. Mobile first. Free hardware. Open from the ground up. No Google. No App Store gatekeeping. No proprietary runtime watching everything you do.

The compiler is the foundation. FSS all the way down.


Workshop: Wittenberg, LEUCOREA

On Saturday we are running a workshop at LEUCOREA (Collegienstrasse 62, Lutherstadt Wittenberg) on sustainable software development in the age of AI.

One of the topics on the table: should Forge go mobile first?

The circle decides. That is how we work.

If you are a student, a developer, or just someone who is tired of handing your phone to corporations - you are welcome.

"Glaube mir kein Wort. Probier es selber aus."
Don't believe a word I say. Try it yourself.


SMS and SML are part of the Forge ecosystem - a native UI framework built in C++ with its own compiler, its own language, and a stubborn belief that code should read like a sentence.

42 years after Amiga BASIC. Still going. 🤘

Top comments (0)