Building a JavaScript Runtime using C

devlogs.xyz

83 points by redbell 5 days ago


WalterBright - a day ago

I wrote a JavaScript engine from scratch using C++ back in 2000.

https://www.digitalmars.com/dscript/cppscript.html

I later translated it to D:

https://github.com/DigitalMars/DMDScript/tree/master/engine/...

Github: https://github.com/DigitalMars/DscriptCPP

yb303 - a day ago

This is not "Building from scratch" This is just using.

djmips - a day ago

This could useful to reference for when you want to put a JavaScript interpreter in your own custom software. For example I've seen JavaScript used for console game UI systems.

claytongulick - a day ago

For those who would like a true "from scratch" implementation of JavaScript, Fabrice Bellard's QuickJS [1] is clean, readable and approachable. It's a full implementation of modern JavaScript in a straightforward project, not nearly as complex or difficult as V8.

[1] https://bellard.org/quickjs/

bryanrasmussen - a day ago

I guess I would like to see defining your global object in a real use case and adding some functions to your global object that make sense, which admittedly once you ask someone to do the creative work of making a use case that is sensible as they start implementing it they might find it is more useful to complete the implementation of that use case rather than releasing a starter tutorial.

TheCleric - a day ago

I was a little disappointed that this was “just” a wrapper for JavaScriptCore.

ramon156 - 16 hours ago

The anchor links seem to be broken

measurablefunc - a day ago

How about a formally verified runtime that takes the JS spec & constructs a runtime by converting the spec w/ incremental & verifiable transformations into an executable runtime?

lerp-io - a day ago

unpopular comment : v8 > JavaScriptCore.