tc39 / eshost

A uniform wrapper around a multitude of ECMAScript hosts. CLI: https://github.com/bterlson/eshost-cli
Other
142 stars 36 forks source link

Add SerenityOS's LibJS #116

Closed IdanHo closed 2 years ago

IdanHo commented 2 years ago

This adds very basic support for LibJS, SerenityOS's javascript engine (which can also be compiled for linux/mac/etc via Lagom). the $262 support is mostly stubbed out, as that native object is added externally by https://github.com/linusg/libjs-test262 for LibJS, so until we move that into the main repository behind a feature flag it's inaccessible to the normal cli. several tests were also skipped for libjs, but we should be able to gradully re-enable them as they are fixed in LibJS.

~This depends on https://github.com/SerenityOS/serenity/pull/11049.~ Merged

bakkot commented 2 years ago

Are there binary releases available somewhere, or instructions for building just LibJS? Hard to play with this otherwise.

(Note: I'm not a maintainer, just a passer-by.)

IdanHo commented 2 years ago

Are there binary releases available somewhere, or instructions for building just LibJS? Hard to play with this otherwise.

(Note: I'm not a maintainer, just a passer-by.)

No binary releases, but building should be as simple as cloning, then running ./Meta/serenity.sh run lagom js (which will automatically build and then run the JS repl)

IdanHo commented 2 years ago

@bterlson Hey, any chance we could get this reviewed/merged?

rwaldron commented 2 years ago

@IdanHo Hi, sorry about the very very long delay in reviewing this. I have a question: is there a better/more specific name that we can use, than "libjs"? That's quite generic. Perhaps serenityjs?

rwaldron commented 2 years ago

Are there binary releases available somewhere, or instructions for building just LibJS? Hard to play with this otherwise. (Note: I'm not a maintainer, just a passer-by.)

No binary releases, but building should be as simple as cloning, then running ./Meta/serenity.sh run lagom js (which will automatically build and then run the JS repl)

This is what I get when I try:

die: Please make sure that GCC version 11, Clang version 13, or higher is installed.

I'm on a fully up-to-date Mac

λ gcc -v
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
IdanHo commented 2 years ago

@IdanHo Hi, sorry about the very very long delay in reviewing this.

No Worries

I have a question: is there a better/more specific name that we can use, than "libjs"? That's quite generic. Perhaps serenityjs?

esvu refers to libjs as serenity-js, would that work?

IdanHo commented 2 years ago

I'm on a fully up-to-date Mac

λ gcc -v
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I believe that Apple clang version X is equivalent to upstream clang version X-1. You'll want to either install upstream clang or gcc. But I believe that for esvu support someone is hosting libjs builds now, so you might not need to compile it.

rwaldron commented 2 years ago

esvu refers to libjs as serenity-js, would that work?

Yes, perfect!

I believe that Apple clang version X is equivalent to upstream clang version X-1. You'll want to either install upstream clang or gcc. But I believe that for esvu support someone is hosting libjs builds now, so you might not need to compile it.

I see the esvu has support for a binary for use on linux, but nothing else. I'll dig in more when I have time.