Sry for suggesting smth. related but maybe not what you asked for. Bun is great 
project and trying to become API-compatible with NodeJS is a respectable goal. 
IMHO what is missing in the JS-theatre is a slim and capable engine that exists 
independently from big-tech. The java-fication of JS is in full swing - as of 
now, the webdev-herd has learned that simulated type-safety a la Typescript is 
_simply great_ and a good preparation for C# or whatever M$ will propose as the 
next step. Ok recently the Svelte-team divorced themselves from typelings. Some 
weeks ago a nim-user announced a combination of QuickJS and a rendering-engine 
written in Nim. This is a very challenging project - and i doubt that the 
engine will ever become "usable" in what is expected by webdevs who are used to 
work and test against the big-tech engines. Nonetheless i'm very sympathetic 
towards the idea for the following reasons :

  * QuickJS is lean ( 231KB-initialized), very well-done and technically even 
a-step-ahead of the ECMA-standard.
  * it is designed to allow for transparent interchanges with the outside 
world. So it can handle any foreign type you want to use inside the engine. So 
now one can easily blend-/bridge-in any Nim-type. And that gives you real 
pure/strict typing inside JS - not a simulation as TS does it. I wrote a little 
macro that takes the surface of eg. Nims Set-Type from the std/collection and 
makes this avail inside Quick-JS, as a 'pure-set' right next to the 
'bag-of-things'-sets that the JS-standard provides.
  * there exists a branched version that performs atomic ref-counting, which 
allows for multithreading scenarios.
  * i'd like to see a open-sourced rendering-engine, that does not participate 
in the pointless rat-race to fullfill the latest CSS-/Web-standard, but is 
instead capable of properly rendering text, tables and maybe graphs. And has 
!NO browser-restrictions!, so it might even decide to present things in a 
different GUI. Servo is on the way to tackle this and might one day become a 
interesting candidate.
  * re-implementing all/some NodeJS-APIs would be possible, since you have 
access to Nims entire std/lib. So this could be done step-by-step - if needed.



I believe such a combination could be attractive for anybody who wants to e.g. 
prototype stuff with a dynamic language and use strongly-typed 
(C/C++)-implementations at the same time. Nim would one-more-time shine for 
being able to build-the-bridge, show what magic-wonders macros can do and 
present strong packets from the nim-community e.g. like Arraymancer and others. 
And if that idea grows, maybe one day one might consider making this a 
compiler-backend - maybe when V3.0 will be around the corner in 2026 or so. But 
all needed pieces are already around. A feature-complete QuickJS4Nim-wrapper, 
the matured Quick-JS-engine itself and at least two people who imagine what 
fancy things one could do with it - big-tech-free.

greets & beatz, Andreas

Reply via email to