Skip to content

Comment on JavaScript right on the hardwareparent

Comments

Sure if you prefer static typing then JS is not for you.

Continuations seem to be rare among other languages you could choose. Personally I have only seem them in LISP, what else is out there?

I would love to use LISP, but the libraries simply aren't there. Last time I tried Racket, there wasn't even a library for JSON.

Sure if you prefer static typing then JS is not for you.

I did not say anything about static typing. Most dynamic languages are not forced by their specs to coerce disparate types into utter garbage. I invite you to type the examples in the Wat talk into a REPL for any other dynamic language and see how many of them produce exceptions.

Continuations seem to be rare among other languages you could choose. Personally I have only seem them in LISP, what else is out there?

Before answering, I will point out that coroutines are equivalent to one-shot continuations, and coroutines that can be copied are equivalent to multi-shot continuations. Then, I am familiar with continuation implementations in the following languages: Python [1][2], Scala with any JVM runtime[3], Any JVM language with a particular runtime[4], C[5], Lua[6], Julia[7], and C++[8]. Of these, the ones for the JVM, C/C++, and Lua[9] are multi-shot continuations or equivalent to them, while Julia and Python are a bit more limited. I am not familiar with many languages, so I'm sure I've missed a lot of instances of this sort of feature.

I would love to use LISP, but the libraries simply aren't there. Last time I tried Racket, there wasn't even a library for JSON.

I can't really speak to this because I haven't spent time trying to build real software using lisp.

[1] https://pypi.python.org/pypi/greenlet

[2] http://www.stackless.com/

[3] http://jim-mcbeath.blogspot.com/2010/08/delimited-continuati...

[4] http://oss.readytalk.com/avian/javadoc/avian/Continuations.h...

[5] http://en.wikipedia.org/wiki/Setcontext

[6] http://lua-users.org/wiki/CoroutinesTutorial

[7] http://docs.julialang.org/en/latest/manual/control-flow/

[8] http://www.boost.org/doc/libs/1_51_0/libs/context/doc/html/c...

[9] http://lua-users.org/lists/lua-l/2006-01/msg00652.html

Last time I tried Racket, there wasn't even a library for JSON.

That's changed since then: http://docs.racket-lang.org/json/index.html

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.