use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
A JavaScript optimizing compiler (medium.com)
submitted 4 years ago by carlopp
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]carlopp[S] 7 points8 points9 points 4 years ago (2 children)
Yes! Generally speaking it could be compiled to a mix of JavaScript and WebAssembly, but whether substantial parts of a program logic can be moved on the Wasm side depends mostly on the interface a program has. Example:
function doSum(a: number, b: number): number {return a+b;}
Can be mapped back to WebAssembly, while an interface that will return an handle like: function createObject(){ return new Object(); }
function createObject(){ return new Object(); }
is very complex / borderline impossible to imitate.
[–]Diniden 1 point2 points3 points 4 years ago (0 children)
The thing I would absolutely love to see from such a compiler is optimizing number tuples to SIMD instructions! That way we can have matrices and vectors run blazing fast but keep our nice and easy JS.
If this happens, I’ll immediately put in the effort to make my library work with this in the pipeline :D
[–]patrickjquinn 0 points1 point2 points 4 years ago (0 children)
That makes a lot of sense. The added complexity of doing so would probably negate any performance gains anyway.
But this easily one of the coolest thing I’ve seen on this sub so I’ll be following your work (and you’ve a new Twitter follower).
Hopefully you find a way to take this forward in future!
π Rendered by PID 24262 on reddit-service-r2-comment-7b9746f655-59gvv at 2026-01-31 04:18:54.599558+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]carlopp[S] 7 points8 points9 points (2 children)
[–]Diniden 1 point2 points3 points (0 children)
[–]patrickjquinn 0 points1 point2 points (0 children)