Skip to content

Comment on Metaprogramming: Ruby vs. Javascriptparent

Comments

Yeah, I recently saw that it had coroutines, which was a surprise to me. coroutines can be used to implement fibers and is also related to continuations.

I think it's deceptively simple, so programmers might not think there's much there. In addition, it's pretty minimalistic, you don't get OO out of the box (which isn't necessarily a bad thing, depending on what you're doing), and the number of libraries pales in comparison, all of which deter others for exploring it more fully.

That only means that the field is ripe for some exploration.

It can seem like a weak language since it doesn't have "batteries included", but the whole design revolves around using it as a drop-in library in an existing C / C++ project (which would already have libraries) or extending the language with C. It has a great C API, and it's not hard to write wrappers for C libraries as necessary.

While Lua standalone is a decent language (almost a Python/Scheme hybrid), Lua + C is quite powerful. It's particularly well-suited to the two-level programming style John Ousterhout describes here (http://www.vanderburg.org/OldPages/Tcl/war/0009.html). I haven't used TCL much, but it sounds like the same development style - since you can just use another language when necessary, Lua doesn't have to do everything. It can stay small and simple. While low-level code and hotspots for a project may be written in C, the rest can be written in shell scripts, TCL, Lua, etc. for rapid prototyping. The clear boundary between the layers of development can help keep complexity contained, too.

AboutSource Built by g1lg1l

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