Alright, 90 points, most comments being meta about the title so I'll be the brave one and ask: What is this actually good for? I can't think of any reasonable use case. Grab little NPM ditties and incorporate them into your Go binary - Javascript to Go becomes as Lua is to C? Somebody enlighten me. Edit: Not that this needs a use case per say, just that the intent behind it is underspecified enough for me to wonder a…
A JavaScript parser and interpreter written in Go
41–50 of 72 posts
Re: A JavaScript parser and interpreter written in Go
#42Re: A JavaScript parser and interpreter written in Go
#43Alright, 90 points, most comments being meta about the title so I'll be the brave one and ask: What is this actually good for? I can't think of any reasonable use case. Grab little NPM ditties and incorporate them into your Go binary - Javascript to Go becomes as Lua is to C? Somebody enlighten me. Edit: Not that this needs a use case per say, just that the intent behind it is underspecified enough for me to wonder a…
Re: A JavaScript parser and interpreter written in Go
#44Re: A JavaScript parser and interpreter written in Go
#45[0]: http://en.wikipedia.org/wiki/Continuation-passing_style
Re: A JavaScript parser and interpreter written in Go
#46A couple years ago for a programming languages course, we wrote a bytecode compiler and interpreter for a JavaScript-like language we were using in the class (objects, prototype-based inheritance, higher-order functions, etc), and we initially started building it in Go, but the biggest thing that made us switch to C++ at that time was the fact that Go didn't have a straightforward union type. It looks like this inter…
Excuse the silly question, but why was a union type so important?
Is it because JS has dynamic types ? var x = 5; x = "John Doe";
Re: A JavaScript parser and interpreter written in Go
#47Earlier quoted context omitted.
Excuse the silly question, but why was a union type so important?
I was wondering myself why you needed a union type. Is it because JS has dynamic types ? var x = 5; x = "John Doe";
Re: A JavaScript parser and interpreter written in Go
#48A couple years ago for a programming languages course, we wrote a bytecode compiler and interpreter for a JavaScript-like language we were using in the class (objects, prototype-based inheritance, higher-order functions, etc), and we initially started building it in Go, but the biggest thing that made us switch to C++ at that time was the fact that Go didn't have a straightforward union type. It looks like this inter…
Excuse the silly question, but why was a union type so important?
But for better performance, approaches like tagged pointers (often used in Lisp implementations) are useful, as it eliminates a level of indirection for most integer operations. If you can afford to use 64 bits for your values, you might consider using doubles everywhere, with invalid exponents for stuffing a shortened pointer inside the float (I believe luajit uses, or used to use, this technique; it would probably be a good match for JS as well, as JS doesn't have integers).
Re: A JavaScript parser and interpreter written in Go
#49I have no idea how to really ask this, but does it uses continuation-passing style [0] to execute expressions? I tried to search for "cps" or "continuation" in the repo, but no luck. I also don't really have the time right now to go dig through the source. [0]: http://en.wikipedia.org/wiki/Continuation-passing_style
Re: A JavaScript parser and interpreter written in Go
#50I have no idea how to really ask this, but does it uses continuation-passing style [0] to execute expressions? I tried to search for "cps" or "continuation" in the repo, but no luck. I also don't really have the time right now to go dig through the source. [0]: http://en.wikipedia.org/wiki/Continuation-passing_style