News for hackers. Stuff that matters.
Re:LLJS: Low-Level JavaScript by zx2c4 on Tuesday October 09, 2012 @05:13AM (#4630640)
Despite my usual cynicism about #javascripthipster projects, this does actually look kinda neat.

The one thing that rubbed me the wrong way is the "let" keyword. Why can't we just declare variables without it, like C does? I suppose because they want to rely on JavaScript's own scoping rules?

What would be cooler would be if they could just totally do away with making actual JavaScript variable declarations or function calls, save for the set of typed arrays, pushing and popping variables on and off the stack for function calls, and then coming up with some horrible hack for implementing jmps in a language with no goto. I'm sure this wouldn't really make things more efficient, but it'd be interesting to read.

I guess though, there's always the source of emscripten for that delight.

Re:LLJS: Low-Level JavaScript by mbebenita on Tuesday October 09, 2012 @09:22AM (#4631326)
Relying on JS function calls and variable declarations is actually more efficient in this case since the underlying JS JIT can perform a lot of optimizations (SSA / Register Allocation). We do stack allocation for structs and local variables for which you need to take the addresses of.

The "let" keyword is left in there because we wanted to stay compatible with JS. So any JS program is also an LLJS program. This way it would be easy to integrate into an existing code base. As for the "let" vs. "var" debate, we chose "let" because of its block scoping semantics and because we didn't want to let variable declarations alias each other with different types.

Re:LLJS: Low-Level JavaScript by dasil003 on Tuesday October 09, 2012 @07:30AM (#4630945)
This is more of a #javascriptneckbeard project for which I have to give a healthy respect.
Re:LLJS: Low-Level JavaScript by rbanffy on Tuesday October 09, 2012 @09:12PM (#4634635)
> The one thing that rubbed me the wrong way is the "let" keyword.

Reminds me of 8-bit BASIC. Without the line numbers.