4 ms·
Did you know we almost had a lisp style language in our browsers? But Sun's marketing budget on "Java" made something that sounded similar (JavaScript) favored
by bugtodiffer 2y ago
Did you know we almost had a lisp style language in our browsers? But Sun's marketing budget on "Java" made something that sounded similar (JavaScript) favored more
people wouldn't have these weird questions if we had used good programming languages from the start, but marketing dollars changed this timeline forever and every new generation learns about wtf-js
- wruza 2y agoThis has nothing to do with a language flavor though, cause it’s coercion rules at play here, which could be done right and were (I believe) ok in Java. Lisps in browsers of that time would suffer from the same idea, which is “let’s make relaxed/ambiguous rules for noob script kids and cool one-liners”. Which is a mistake that many people made back then (perl, php, sh). Anything that has a potential for growth must have strict typing and non-funny coercion from the beginning. It’s this naive idea that ruined whole ecosystems.
- deleted 2y ago[deleted]
- azinman2 2y agoWithout making it easy for people to get started, it’s unclear what scale would have been achieved during critical days when things were growing. No one could have predicted back then what the web would become, nor the need for full app development on it (things like flash and Java applets seemed more like the way that would go). Why would you want to cut off normal people from attempting to communicate to join a community that was linking humanity together for the first time? This strikes me as elitist. Proper programmers with years of experience shouldn’t be the only ones allowed in. We have “use strict;” for “serious” devs.
- wruza 2y agoThere are levels to this. You can make it harder by forcing them to adhere to some boilerplate protocols and quirky patterns and you can make [0] behave as 0. The former is a barrier, the latter is an unnecessary toy that actually messes with beginners. This idea was wrong not because beginners shouldn’t program. It’s wrong cause it makes the road unnecessarily bumpy for everyone. If you have ([T] | T) in your api, which actually was the reason for it, iirc, just make a function toT() that returns T either way.
- tzs 2y agoPeople getting started can handle more advanced things than most people think they can. Look at Arduino, which is many people's introduction to programming. That's C/C++.
- bilekas 2y agoAs I understand it was called JavaScript because it was not compiled, infact its interpreted i.e a script. And it was used to enrich the HTML interactions specifically which would mean no compile in the browser which back in the day were terrible. So Netscape and Sun came together to bring us Javascript.. It was also rushed because there was some competition with Microsoft I guess with VBScript or some derivation of that. So while JS is certainly 'quirky` I would hate to see what Microsofts version might look like today.
- hnbad 2y agoThe reason JavaScript exists is that it was targeting hobbyists and non-programmers for whom Java would have been too much of a barrier to entry. That's why it's called that and why it was referred to as a "companion language" to Java at the time. Remember, Java applets were supposed to be how you build Rich Internet Applications. I recommend reading the "prehistory" chapters of this book: https://dl.acm.org/doi/pdf/10.1145/3386327 https://dl.acm.org/doi/pdf/10.1145/3386327
- oneeyedpigeon 2y agoAu contraire; I'm sure there would be plenty of "Why does (((()(())((())...?" questions to go around...
- somat 2y agoSome days I feel the biggest failure of the web is how (script lang="whatever") does not work. Yes I know the obvious problem with that, it would probably require changing our fundamental understanding of how a web browser works, I suspect the webbrowser would need to be at it's core an application specific vm designed around untrusted input. that is strict limits on cpu time, gated device access, etc. then the dom generator, languages and rendering engine would be implemented in this asvm. The secondary problem, is this would probably destroy one of the webs greatest assets, everything is in plain text. yes, I know, there are all sorts of hoops you can jump through to obsfucate the text, but that is the thing, the default is shipping the source around. to do otherwise takes effort. A asvm based system would default to shipping compiled binaries around, which would suck. But fundamentally changing the web is a boil the ocean type problem, never going to happen, we are stuck with our current web, much of it good, and much of it bad.
- palmfacehn 2y agoThis would have been possible within the HotJava paradigm.
- keybored 2y agoWhat’s Java’s got to do with it? It seems you have to dig deeper in order to get to Java-WTF (but I have attended a Java quiz so it is possible).
- hnbad 2y ago"Almost" is overstating it a bit. It's true that the original idea Eich was proposed with was "Scheme in the browser" but Sun moved in before Java was even officially announced by name. JavaScript was intended as a "companion language" to Java pretty much from the start. It's more realistic that we'd have ended up with VBScript dominating the browser landscape instead (Microsoft half-heartedly tried to acquire Netscape before the Sun deal and it's unlike Netscape would have lasted this long without the cooperation with Sun) and nobody wants to live in that timeline.
- Narishma 2y agoWas VBScript that much worse than Javascript?
- arp242 2y agoYou can have a C-like language without JS's typing ridiculousness. Many exist, such as Java. Blaming JS's special needs type system on Java and "marketing dollars" is a ridiculous take. It was not in the original JS and added later on after someone asked/convinced Eich to do it (who quickly came to regret it, but by then "people were using it", and we're stuck with it today). He's talked about this a few times in interviews and talked about it on HN.