Hacker News new | ask | show | jobs
by DeathArrow 1702 days ago
What is simple in Javascript today? To me it seems feature bloated and you can do a thing in ten different ways.
2 comments

Look past the syntax and it has very simple semantics. Ruby has extraordinarily complicated semantics due to an enormous core library.
I don't disagree but there is less to the base language than there is Ruby and Python (though all three languages continue to add new stuff). Even looking at the primitive types - JavaScript has three, Python has four, Ruby has... classes, but probably more base types.
MRI has more primitives of sort, but they're an implementation detail. Ruby itself conceptually only have objects.

MRI however implements some of them (integers, floats, symbols, true, false, nil, I might have forgotten one or two) using type tagged values instead of pointers to objects.

Type-tagging is easier to make fast for a highly gc'd dynamic language, as it reduces gc pressure substantially to not have to allocate lots of small objects without massive amounts of complex optimisations.