Dirk
ddv.tools
Dirk
@ddv.tools
Backends & tooling. Working on a JS runtime, Maligator, for learning purposes.
GH: @dirkdev98
Also started to work on static-semantics. With this we should get a good idea of variable scopes, if they are captured by closures and more, so we can hand over this information to the engine.

For now, we collect the different scopes and the initialization of variables and parameters.
February 16, 2026 at 7:02 AM
And finally, a Test262 runner! We skip like ~40% of the tests and only pass ~5%. But the number goes up, so that's great!
February 8, 2026 at 9:37 PM
And the combination of try-catch, Array#map and Function#bind brings the following.

With a TIL: Array#map works on many object-likes that have the `{ length }` property. Note that the callback is only called here if the element of an index exists as well. Otherwise, use `Array.from({ length })`.
February 8, 2026 at 9:37 PM
The switch-implementation is not fully complete yet. We don't evaluate any `case` blocks after the default-case yet.

Making this post revealed a bug in CompletionRecord-handling. The `break;` value is returned from the script instead of the final statement. Got that fixed now as well.
February 8, 2026 at 9:37 PM
I've also taken a few shortcuts already, by using the bigint, string and number representation from the host JS runtime. We mostly abuse this for number to string conversions and vice versa. We still try to implement all edge-cases, around -0 for example, our selves.
January 5, 2026 at 7:04 AM
Speed ain't the goal here, so we just run a tree-walking interpreter, built w/ TypeScript running on Node.js. For now we just have to implement more language features until we can start running Test262 to really verify what we have done so far.
January 5, 2026 at 7:04 AM
All that work for an incomplete calculator whaha. However, doing the grunt work to, for example, implementing all operations on numbers and bigints before getting any code running, made sure that when it was time to get code running, it was really straight-forward to do so.
January 5, 2026 at 7:04 AM
And finally with the last evening of procrastination, I added global values like `global.globalThis`, `global.undefined` (although unusable for now), added equality support (1 == '1') up to ("str" === "nope") and logical operators (false && true).
January 5, 2026 at 7:04 AM
Figured it was time to get code running, so dove straight in to environment records, realms and execution context. For parsing, we just use Meriyah for now.
So with all that prep work, implementing binary expressions (1 + "foo") was really straight-forward.
January 5, 2026 at 7:04 AM
I started with just implementing the language value types (undefined, null, number, string, symbol, object). Implementing their operations. Next came abstract ops for type conversions and type comparisons. With that some operations around ordinary objects are needed, so got a few of them implemented
January 5, 2026 at 7:04 AM