Hacker News new | ask | show | jobs
by Cthulhu_ 1204 days ago
I don't think the issue is that languages change per se - it's that they borrow features from other languages, that people ask "can we have $feature from $language please?"

in JS (and years before that, PHP), one example was object-oriented programming / classes, except in both JS and PHP it was never implemented fully, with JS not even having access modifiers for a long time. JS didn't need classes and the implementation is lacking, but someone decided it should be added.

Likewise, Java had functional programming bolted on; they never extended the base List types with functional modifiers, so now you have to transform or wrap your List in a Stream to make it work with Java's attempts at functional programming. Personally, I think if you want to do FP or FP-style coding on the JVM, you should rewrite things in Scala. You can write Scala and Java side-by-side.

Same with JS, you want JS but with types? You can have Typescript. I wish they did the same with JS-with-classes, just write a new language that compiles to JS instead of bolt classes onto the JS standard.

4 comments

My second love was LISP. I love me some functional programming.

But I greatly dislike multi-paradigm programming languages. Mostly because I've worked with other programmers.

Borrowing features (idioms) from other languages is great. Pattern matching is nice. For Java, I'm looking forward to (interpolated) string templates and implicit classes. Destructuring would be nice too.

--

But for the love of Larry, where are intrinsic regex expressions?

Path expressions?

Most of our work is data processing.

Input -> munging -> output.

Meaning cutting and pasting strings.

So I mostly want new features related to string and data processing.

--

The evergreen fetish (kink) with arcana like type systems, monads, and metaprogramming is just so besides the point. That's what Lambda the Ultimate and HN are for.

For "commercial" languages, just give me tools for work.

Fussing with novel languages is for my hobby projects.

What does "intrinsic regex" mean?
Sorry. I should have written "regex intrinsics". Meaning native to the language, vs implemented as a library. Just like Perl's syntax for regex.
So like the /^regex(.*)syntax$/g that we have in vanilla JS?

(I agree with your overall point BTW.)

Yup.

I just checked; the MDN docs refer to them as "regular expression literals".

> I wish they did the same with JS-with-classes, just write a new language that compiles to JS instead of bolt classes onto the JS standard.

I think the classes were a good thing. Better would have been to change the OO model entirely, but if you're going to have one and can't change it, nice to at least have some sugar to make it usable. IDK if it's better elsewhere, but prototypal OO was pretty clearly a miss-step for Javascript, and sugar to make the OO system usable and less-obtuse (while making it easier to ignore the parts that should basically never be used, which parts amount to all the distinctive things about prototypal OO) is a decent move.

> Same with JS, you want JS but with types? You can have Typescript. I wish they did the same with JS-with-classes, just write a new language that compiles to JS instead of bolt classes onto the JS standard.

Wow, relevant username for this take, as you'd end up with an eldritch creature as soon as people tried to bolt these DSLs together into their opinionated bags of features, and a meta-language landscape that resembles the already fragmented frontend landscape of today

> I wish they did the same with JS-with-classes, just write a new language that compiles to JS instead of bolt classes onto the JS standard.

Jeremy tried https://arcturo.github.io/library/coffeescript/03_classes.ht...