News for hackers. Stuff that matters.
Re:Duktape: an embeddable JavaScript engine by angersock on Thursday December 04, 2014 @05:09PM (#8701999)
So, what is C good at?

Low-level (like, just about assembly, maybe slightly higher) workloads that require high performance or are annoying to do any other language.

What is C++ good at?

All of the stuff C can do, but also bolting on a weirder type system, generics, metaprogramming, and a whole bunch of other stuff. It's fast, but rapidly becomes a festering tumor of functionality.

It's a katamari of design features, and even though it exposes a lot of awesome high-level abstractions the fact that it still allows working at the C level prevents it from being compelling.

What about JS?

Javascript is dynamically typed, which is terrible in many ways but bloody useful for quickly getting shit done. It is a functional language with prototypical inheritance, and so naturally lends itself to high-level programming...with regexes and functions as first-class objects, and a really pretty simple type system.

It sucks at high-performance stuff, but it allows for a lot of clever and very brief code.

So, if you want high-performance and the power of high-level abstractions, it makes sense to use C and JS--each a fairly small language well-suited to its problem domain. C++ would require too much annoying work on both sides of the problem.

A good workload for this would be: in-game scripting, network message transforms, simple command-line utilities, game engine writing, numerical library writing, asynchronous IO processing..basically, any application where you can easily separate out the low-level primitives from a flexible high-level solution description.

~

Then again, for all of what I'd said, I think you might as well just be using Erlang or Elxiir. :)

Re:Duktape: an embeddable JavaScript engine by _dps on Thursday December 04, 2014 @08:41PM (#8702702)
> katamari of design features

Did you coin this phrase? It's a fascinating, evocative, and quite possibly accurate description of many of the systems I find most frustrating. In any case, thank you for bringing a smile to my face today :)

Re:Duktape: an embeddable JavaScript engine by angersock on Friday December 05, 2014 @11:37AM (#8705339)
As far as I know, yeah, that's mine. :)

It seemed like it fit.