Live data from Hacker News

A JavaScript parser and interpreter written in Go

github.com

11–20 of 72 posts

Re: A JavaScript parser and interpreter written in Go

#11
A 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 interpreter is using tagged unions for values, and using the empty interface to emulate a union type. I seem to remember that we may have read something at the time that recommended using the empty interface instead of unions, though I don't remember for sure. Nice to see some interpretation efforts finally being realized in Go!

Re: A JavaScript parser and interpreter written in Go

#12
post #7

the perfect hacker news title

Show HN: How a JavaScript parser and interpreter written in Go allowed my startup to succeed and Why your company should switch to Go

you forgot to mention someframework.js, and Edward Snowden... :)

Re: A JavaScript parser and interpreter written in Go

#16
post #9
post #6

Earlier quoted context omitted.

No, there's not enough Redis here. It needs more Redis.

Haskel!

Its actually really easy to get involved in hacking on GHC, the main Haskell compiler. Seriously, its as easy as taking some time to just try to build current head and report any build problems! https://ghc.haskell.org/trac/ghc/wiki/Building

I'm actually really excited by all the people starting to jump in and try to learn/help. We've even got 2 really smart high schoolers doing some amazing contributions to GHC recently.

seriously: its easy to get involved in hacking on interesting open source projects. Just choose one you care about and stay excited by, and dig in!

Re: A JavaScript parser and interpreter written in Go

#18
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 about it.

Re: A JavaScript parser and interpreter written in Go

#19
post #18

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…

If it was fully functional it could be useful for automated testing. Write your tests in javascript, execute them at the point of integration in Go.

Re: A JavaScript parser and interpreter written in Go

#20
post #18

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…

Not everything needs a use case. But if you really want one, here's one: I'm a student and I want to write my own interpreter. Well, here's a good example of how to write your interpreter.
Post reply on HN