News for hackers. Stuff that matters.
Re:Low Hanging Fruit of Programming Language Design by com2kid on Wednesday November 22, 2017 @07:55PM (#15762001)
> In fact, I highly doubt that most existing technology stacks allow you to build any abstractions at all, in the original sense of functionality so self-contained that a user can't distinguish it from a programming language primitive

Two of the most popular languages out there, C++ and JavaScript, are both great at this.

Sometimes, too great.

Re:Low Hanging Fruit of Programming Language Design by catnaroek on Wednesday November 22, 2017 @08:00PM (#15762025)
Are you serious? How do I define complex numbers (just to give one example) in JavaScript that actually behave like, you know, complex numbers? Recall that:

(0) The usual symbol for complex number addition is +.

(1) The operation isn't associated to any individual complex number (i.e., it's not an object method), but is rather an intrinsic part of the algebraic structure of the complex numbers.

(2) Complex numbers don't have a physical object identity in memory.

C++ fares a little better than JavaScript, but not a lot better.

Re:Low Hanging Fruit of Programming Language Design by com2kid on Thursday November 23, 2017 @02:32AM (#15763482)
The major JS frameworks look like languages onto themselves. JavaScript lacks operator overloading, so there are some limits, but it is quite possible to turn JS into something very unrecognizable.

C++ templates allow for almost anything. I have seen incredibly strange things done to the language with templates. Since Templates can be used to parse, and execute, entirely different programming languages, it is hard to imagine a level of abuse to which C++ templates are not amenable.

Re:Low Hanging Fruit of Programming Language Design by catnaroek on Thursday November 23, 2017 @03:00AM (#15763587)
> The major JS frameworks look like languages onto themselves (...) it is quite possible to turn JS into something very unrecognizable.

That doesn't mean anything. With enough determination, anything can be turned into “something very unrecognizable”. Heck, sometimes the results are relatively pleasant even: http://libcello.org/ . But, if a language doesn't allow you to define basic abstractions like complex numbers (not to mention slightly more elaborate ones, like queues that are indistinguishable from one another if they contain the same elements in the same order), then that obviously reflects very poorly on its abstraction facilities.

> C++ templates allow for almost anything. I have seen incredibly strange things done to the language with templates.

What you can't do in C++, however, is make your abstractions not leak. Every template library is one template specialization away from being broken. This is unlike languages that enforce their abstractions by more robust means, like parametricity and macro hygiene.