Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: It's 2030 – JavaScript has been deprecated by a new language. Which one?
5 points by the_year 49 days ago | hide | past | favorite | 21 comments
In a hypothetical scenario where we could start the web from sketch to avoid current problems that javascript has, which language would you choose and why?



None. All software, along with all other media, is written by AIs. Writing code is one of many things which have been declared too dangerous for humans to handle and is illegal.

Concepts like "files" and "software" and "code" no longer exist in human society because all interactions with software and devices are done through seamless natural language integration with AI. The AI won't tell you about any of these things for your own protection.


I maintain a system that has about 11k deprecation warnings. it had roughly the same number in 2007 - it’ll be alrite :)


In a similar vein to "use strict" we could create a new directive that disallows JS features like var, prototype, == (in favor of ===). Modules with this new directive at the top of the file would be executed under these new rules. You'd be able to create new (maybe lighter weight) JS interpreters that only target this subset.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...


I don’t think anyone uses var anymore. Linters and prettier are doing a good job keeping codebase consistent. Operator == has a valid use case (null or undefined check) but rarely allowed as well.

But I wouldn’t mind to have language without legacy.


It's kinda ironic to post that on a site that uses var in its javascript


I use var, together with let and const, where appropriate. What’s the problem with var I don’t get it.


var is global scope, const is block scoped...

  <script>
  var x = 1;
  if(x < 5) {
    // now y is global (window.y can be accessed everywhere)
    // using const y = x * 2 would be inaccessible outside the if block
    var y = x * 2;
    console.log('double x is: " + y);
  }
  </script>
Besides that, var is "pulled" upwards, as if it was the first line in the function. That may have side effects.


I know how var works.


No offense, just trying to help... :-)


prototype is super useful


Wasm. And we rotate through languages like we did with frameworks.


Metamine reappears from the void, and wins over the hearts and minds of programmers everywhere with it's clever and powerful combination of imperative and declarative techniques.


Whichever you want, as long as it compiles to wasm.


JavaScript, but this time it's really written in Java, not only a namesake.


EcmaSript.

The future is already here and evenly distributed.


ha! Beat me to it

EcmaScript2030


ECMAScript2030


Wasm.


Typescript


This is the correct answer.


Wasm




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: