Hacker News new | ask | show | jobs
by colangelod 1406 days ago
Sorry in advance if this post come across a bit harsh but I think there is a fair bit of misconception in your post.

First and foremost I think it's safe to say that things like TypeScript and JavaScript would not be possible without the lower level "system" languages. In all fairness they were there first, by a matter of decades in most cases. Ultimately the V8 engine, Node and other similar stuff is largely built with C++ and C anyway. Fundamentally what you are asking about CAN be done, there is a larger, fairly academic discussion of "should" it be done or "why hasn't" it been done.

"It's quite clear that TypeScript is going to be around forever" Really? Why? Type script is 9 years old, C is 50 this year. Sure C is still here but lots of things have come and gone in that time, small talk, lisp, fortran, cobal... (as long as you dont look TOO closely in some basement mainframes). Ive been at this for a while and the way I see it typescript is still in the late "fad" stage, it has yet to truly prove its staying power and there is nothing indicating with will "be around forever" just yet. Languages dont have real staying power until they last through the the subsequent fad, if people are still using it after the next cool thing comes out then its likely here to stay.

"It's nice and simple." as others have noted, it's nice and "familiar" there are plenty of us out there who love C/C++ syntax and coding styles. I consider C to be one of the simplest languages out there.

"A systems language essentially just adds access to pointers." Sure, but it also does LOTS of other things. If you want to make a vague comparison systems languages are closer to running "on the metal" than interpreted languages and for some use cases this this is critical. If your flying a jet at 35,000 feet you don't want your altitude tape to all of a sudden read NaN... In many cases, especially mission critical systems, programing close to the metal is the only way to achieve the sort of optimization you really need to run a system, abstraction is NOT always a good thing

"Imagine the same syntax/tooling for embedded, kernel, system (browsers, interpreters), backend, and frontend." -> You could define a systems language that had similar syntax to JS but the main point of JS is the broad abstraction of some things that you very much want access to when you working on a system closer to the metal. Sure its nice when all numbers are of type "Number" but there are lots of cases where you need far stricter control over that. Another piece of historical context here is that the web era brought around the notion of a "full stack" developer, someone who could work on "front end" and "back end" code. In my experience the best dev's are good at one of the two and have a cursory understanding of the one they are not good at for the sake of knowing whats going on most of the time. Realistically these people are not tinkering with the "low level" aspects of the system since its all provided by other things.

"I just don't know why there is not more interest in this." Perhaps because there is no real reason to sink the engineering effort into adding a new syntax to something that works and there are plenty of competent, educated engineers out there working on the stack already. There is lots of historical context here as well, JavaScript more or less became popular in the web era to manipulate front ends, Node made a viable server side platform so it was "one language up and down the stack" which made engineers easier to train (supposedly, I have yet to see this in practice). This was all great but thats a web centered view of the whole situation. In reality there are computers in EVERYTHING these days and many of those computers/microcontrollers/microprocessors simply can't run javascript (for what ever reason) and systems languages are quite relevant.

To sum it all up I think your largely ignoring: 1) The huge historical contexts to why some languages are the way they are 2) Why some syntax/language designs lend to certain use cases 3) Why the "web" era made JS popular for better or worse 4) Why OOP is not a silver bullet for all computing use cases

It took me the better part of the first decade of my career to understand that the purest developers/comp sci's fundamentally know that the language does not matter but instead understanding WHY a language/framework/library/system is good for the use case. Roller Coaster Tycoon was mostly written in assembly anyway...

2 comments

> "It's quite clear that TypeScript is going to be around forever"

Haha that really is wild. It was just a blink of an eye ago that Ruby was the big thing and now when do you ever hear about it?

I see TypeScript being around for a while because it's doing to JS what C++ did to C, but WebAssembly is currently a huge unknown that could end up either being the death knell of the JS ecosystem long term, or have no real effect whatsoever on it.

So JS/TS could be just as popular as now, or totally obscure in 15 years, in my estimation, but it would be insane if C was gone. There's just not enough time or motivation to rewrite the vast amount of C/C++ code under the hood of literally everything everywhere.

By TS I really mean JS. I'm sure they will adopt types soon enough. You would agree JS will be around forever right?
Agreed, TS lasting is really about JS lasting.

I'm not so sure, but I'm also kind of biased because I do wish JS would go away, so I'm probably trying to look for ways it could happen. Realistically it will probably be around as long as the web browser, and the web browser might really be around "forever" by way of continuously adding APIs and shape shifting into whatever the latest thing is. Kind of like C++.

The other way it could finally die though, is if WebAssembly kills it. Right now WebAssembly isn't even usable without JavaScript to access the DOM, so that needs fixing first, but once that's the case, it really will become possible to build a whole front end with no JS, while still integrating with pieces of legacy JS if/when still needed.

This seems more realistic to me than say, C dying of this way, too, because frontends are a lot easier to rewrite and get rewritten or thrown away more often than backend or systems stuff.

By then though, I'll probably be the last remaining person who still has beef with JS...

One thing not to forget about JS is that it has made everything reverse engineerable. WebAssembly will kill this. It's quite amazing to be able to set breakpoints on any website on the internet. To see how any website does something. And it hasn't really caused any problems. I think we take it for granted too much.

What part of JS do you want to die the most? Syntax, runtime, type coercion quirks? And what is your ideal syntax so far? How could JS be changed to your liking?

Let me strongly disagree, although I get where you're coming from for sure, and I get that my opinion is contrarian so I hope you'll give it a chance by reading my full rationale:

What about when the JS is minified and/or obfuscated? A good bytecode with lots of symbols that lends itself to good decompilation can be just as good or better.

In my experience I've had a better time dealing with the JVM (Java, etc) world for this because IntelliJ makes it so easy to automatically decompile and jump into your JAR and maven dependencies, and in my experience the quality of decompilation is very good. The nice thing about Java is it is harder and correspondingly uncommon to obfuscate the names of any symbols beyond stack locals, after all, methods calls are linked by name at runtime.

Whereas with JavaScript, if the source is not minified or obfuscated, things are good, otherwise you've definitely lost all the symbols, even the ones that could not realistically be removed in JVM.

Also the vast amount of static typing in the JVM bytecode design forces so many more constraints! This is the huge win, honestly, for people exploring the source code of others. It is a lot easier to figure out what unknown code does when you can safely and reliably map out what calls what, what the types of arguments are and therefore what method calls could be called on them, etc.

So the best case scenario is a little better with JS, I will admit that! But the average and worst cases are far better with JVM even though it is a binary bytecode.

WASM is also a binary bytecode. I am not sure how it will compare on this to JVM though. But I am hopeful.

As for what beef I have with JavaScript, I think the above alludes to it: it is harder to explore a complex unknown codebase than in a statically typed language. I don't mind the syntax or anything superficial like that. It's a nice pleasant easy language to write greenfield code in if you don't have legacy code, sure.

> One thing not to forget about JS is that it has made everything reverse engineerable. WebAssembly will kill this. It's quite amazing to be able to set breakpoints on any website on the internet. To see how any website does something. And it hasn't really caused any problems. I think we take it for granted too much.

> in the late "fad" stage

I mean more JS. I'm sure types will be integrated into TS.

I really cannot see JS ever being supplanted. WebAssembly could change things but probably not.

The only gap I see in the market is for a high-level language that can also do low-level.

And then you have to think about syntax-alone innovations yet to come. I think we have all the syntax we need. Swift and Kotlin have some new stuff now and then. But pretty much everything people want are proposals in the works for JS.

So with no new syntax innovations, people will just go with JS/TS. And then you pretty much just need to implement a low-level target and you have your universal programming language.

> nice when all numbers are of type "Number" but there are lots of cases where you need far stricter control over that

The problem is these systems languages are not designed like this. They don't imagine you are not instantly hitting the metal. But huge amounts of code are just simple business logic that don't care about memory management. I just want my hot code path to run on the metal. But I don't want to rewrite in Rust and wear the compile times just for that.

> purest developers/comp sci's fundamentally know

These are the same guys that hop from fad to fad to stay intellectually stimulated. Ruby -> Scala / Haskell / OCaml -> Go -> Rust -> Zig -> Some new thing.

I've heard so many times that functional programming was essential, now a borrow checker is essential, when we got by without them just fine. Now Zig comes along and doesn't have a borrow checker and its still got buzz. Next is Vale with generational references and time-travel debugging. It's always some new shiny feature to chase. Call out web devs on their new ui frameworks, but backend devs have their own skeletons.

Compsci's are writing their very own new language as we speak.

Devs are constantly forced to go where the hype is to stay with the ecosystem. Rust is where it's at, so Rust it is. But it won't be forever.

I'm just a bit tired of wearing slow compile times for all these new languages that never get fixed before the next language comes along...without proper IDE support or debugger support.