Better HN
topnewbestaskshowjobs
Log inSign up

canadahonk

40 karma · joined Oct 27, 2023 (3y ago) · 17 submissions

Submissions

1.

AOT JavaScript engine Porffor passes over 50% of official JavaScript test suite(goose.icu ↗)

4 points · by canadahonk · 2y ago · discuss

comment 2y ago · link · parent

This type of test does work as expected. The "sync" means that it does not feature a full event loop (yet) so cannot easily support async I/O or some more "advanced" use cases.

comment 2y ago · link · parent

Yep! Also as it is technically more of an engine/runtime (sometimes) than "just" a compiler, folks in the JS space are more familiar with engine as a term :)

comment 2y ago · link · parent

Exactly. The versioning system is definitely unique and controversial, but I think it fits for a fast moving project like this, so I don't have to really consider versioning which could slow development. When it becomes more stable, I'll likely move to a more traditional semver scheme from 1.0.

comment 2y ago · link · parent

Hey, dev here, I agree that is an interesting application which Porffor could potentially help with! Happy to chat sometime :)

comment 2y ago · link · parent

Good comparison and thanks! A few minor clarifications: - Porffor isn't fully self-hosted yet but should be possible hopefully! It does partially compile itself for builtins (eg Array.prototype.filter, Math.sin, atob, ...) though. - As of late, Porffor does now support basic async/promise/await! Not very well yet though.

comment 2y ago · link · parent

For now, unless it is given a literal string (eg `eval('42')`) eval just won't work.

comment 2y ago · link · parent

Agreed, I have it behind a flag because of this, in the (far) future I could enable by default if I write a type checker built-in or something. Thank you!

comment 2y ago · link · parent

Unfortunately yes, optimizer at high levels is very unstable/aggressive at the moment. Currently working on refactoring things for perf generally instead of just an optimizer, but definitely will fix in the future!

10.

Using TS type annotations for JavaScript engine optimization(goose.icu ↗)

31 points · by canadahonk · 2y ago · 9 comments

comment 3y ago · link · parent

CSS light-dark() function heh ;)

comment 3y ago · link · parent

JS is a language I can cobble together something hacky in and I don't have to care about types or anything yet, just making something work. It's fun! :)

comment 3y ago · link · parent

Zoom isn't taken into account so probably why it looks bad. The FPS is locked to your monitor's frame rate (or what your browser provides, LibreWolf might always send 60 to avoid fingerprinting).

As the post says, it's just for fun :)

comment 3y ago · link · parent

TIL, looks neat!

comment 3y ago · link · parent

It's there - Ladybird (https://ladybird.dev)

comment 3y ago · link · parent

It is technically memory safe :^)

comment 3y ago · link · parent

Nope! It uses Wasm (really WASI) builds of existing JS engines ;)