syg | 5 months ago | on: The Temporal Dead Zone, or why the TypeScript codebase is full of var statements
syg's comments
syg | 10 months ago | on: Finding a Bug in Chromium
syg | 1 year ago | on: Proposal: JavaScript Structs
syg | 1 year ago | on: Proposal: JavaScript Structs
syg | 1 year ago | on: Proposal: JavaScript Structs
What kind of types did you have in mind? Machine integers and "any" (i.e., a JS primitive or object)?
And yes, in browsers this will be gated by cross-origin isolation.
syg | 1 year ago | on: Proposal: JavaScript Structs
For example, if you're protecting the internal state of some data structure with a mutex, the mutex lock and unlock operations are what ensures ordering and visibility of your memory writes. In the critical section, you don't need to do atomic, sequentially consistent accesses. Doing so has no additional safety and only introduces performance overhead, which can be significant on certain architectures.
syg | 1 year ago | on: Proposal: JavaScript Structs
The main reason it is there today is to satisfy some delegates' requirement that we build in guardrails so as to naturally discourage authors from creating thread-unsafe public APIs and libraries by default. We're exploring other ideas to try to satisfy that requirement without unsafe blocks.
syg | 3 years ago | on: JavaScript and TypeScript features of the last 3 years
syg | 5 years ago | on: How to detect if an object has been garbage collected in JavaScript
syg | 8 years ago | on: Towards a JavaScript Binary AST
syg | 8 years ago | on: Towards a JavaScript Binary AST
I contend that the text format for JS is no way easy to implement or extend, though I can only offer my personal experience as an engine hacker.
syg | 8 years ago | on: Towards a JavaScript Binary AST
The browser and platform vendors do not have the luxury of fiat: they cannot will away the size of modern JS apps simply because they are causing slowdown. There can be engineering advocacy, to be sure, but that certainly shouldn't preclude those vendors from attempting technical solutions.
syg | 8 years ago | on: Towards a JavaScript Binary AST
syg | 8 years ago | on: Towards a JavaScript Binary AST
What's proposed is structural compression of JS with JS-specific bits to speed things up even more. What's proposed is not compiled JS, in that the original JS is not meaningfully transformed at all. There is a very explicit design goal to retain the original syntactic structure.
OTOH WebAssembly is like a new low-level ISA accessible from web browsers. To use wasm, one does have to compile to it. As the parent here says, compiling JS -> wasm currently requires at least a GC but also much more. To engineer a performant VM and runtime for a dynamic programming language like JS is a time-consuming thing. It is curious to see so many folks think that JS can straightforwardly be compiled to wasm. Currently wasm and JS serve very different needs; and I also don't think JS will be going anywhere for many, many years.
Edit: formatting
syg | 9 years ago | on: A Simple Request: VLC.js
The two strengths provided by the model are sequentially consistent atomics and something between the strengths of C++'s non-atomics and relaxed atomics. Races are fully defined, and there is no undefined behavior or undefined values.
I'm happy to discuss things more in a new thread or in private communication and would prefer to not derail this thread about VLC.
syg | 9 years ago | on: A Simple Request: VLC.js
Lars Hansen deserves most of the credit for the actual spec -- I'm just doing the memory model. :)
syg | 11 years ago | on: Show HN: Fast.js – faster reimplementations of native JavaScript functions
But perf problems are more numerous still for these functional methods, because compilers in general have trouble inlining closures, especially for very polymorphic callsites like calls to the callback passed in via .map or .forEach. For an account of what's going on in SpiderMonkey, I wrote an explanation about a year ago [2]. Unfortunately, the problems still persist today.
[1] https://news.ycombinator.com/item?id=7938101 [2] http://rfrn.org/~shu/2013/03/20/two-reasons-functional-style...
syg | 13 years ago | on: Shumway: a SWF interpreter entirely in JavaScript
syg | 13 years ago | on: Shumway: a SWF interpreter entirely in JavaScript
We have both an interpreter for ActionScript bytecode as well as a compiler that compiles that bytecode method-at-a-time to JavaScript using a restructuring approach like emscripten's relooper.
Disclaimer: I work on Shumway.
syg | 14 years ago | on: *JS : Low-Level JavaScript