Ask HN: It's 2030 – JavaScript has been deprecated by a new language. Which one?
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?
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.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
But I wouldn’t mind to have language without legacy.
<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.The future is already here and evenly distributed.
EcmaScript2030