7 ms·
If people didn’t like JavaScript for front end work, it’s not like they could just switch to python
by gentleman11 5y ago
If people didn’t like JavaScript for front end work, it’s not like they could just switch to python
- globular-toast 5y agoI use both JS and Python for work and not a day goes by where I don't wish history had taken a different course and Python had ended up embedded in web browsers.
- paozac 5y agoOr Lua
- fit2rule 5y agoThis, a thousand times.
- qbasic_forever 5y agoThere was a strange time in the dark days of IE6 dominance 20 years ago that you actually could write page scripts in non-javascript languages. VBScript was a big option that some people used, and IIRC there was a way to get python support in IE (and Windows) script host too. When I was first learning Javascript in ~1998 I remember all the docs showed how to do stuff in both JS and VB script tags: https://stackoverflow.com/questions/17483782/vbscript-support-in-internet-explorer-11 https://stackoverflow.com/questions/17483782/vbscript-suppor...
- garyrob 5y agoThis brand-new book on using Python (via Transcrypt) in the browser to build a React app may be helpful in that regard: https://pyreact.com https://pyreact.com. Just started reading it. Seems very good so far.
- gentleman11 5y agoIs the result ie 11 compatible and performant? Honestly curious
- Master_Odin 5y agoMS products are going to stop working with IE 11 come August, seems like it's time as an industry to force its retirement on any holdout managers.
- bobthepanda 5y agoWASM is supposed to unlock non-Javascript for the browser, no? Also there have been attempts before but nothing really stuck. How many non-Googlers use Dart?
- irrational 5y agoNo? WASM doesn't replace JavaScript. Think of it as a high-performance library that JavaScript can make use of.
- echelon 5y agoYou can write Rust for the frontend right now. It's pretty neat. Yew [1] is one of the early Rust frameworks for client side work. It allows for multi-threaded (!) execution and javascript interop. Not many other languages make sense as you have to pack in the whole runtime, GC, etc. Rust is pretty well positioned for WASM, and it's going to take off soon. [1] https://github.com/yewstack/yew https://github.com/yewstack/yew
- aphextron 5y ago>If people didn’t like JavaScript for front end work, it’s not like they could just switch to python Sure you could. You can develop for the web in practically any language you like these days. People use JavaScript because it has native support for the DOM that nothing else can match. Until we get away from the DOM for application development, it will always be king.
- roofwellhams 5y agoTry to debug that nightmare. Usually you'll need to debug compiled code.
- gentleman11 5y agoDo sourcemaps not help? I’m not experienced with python to js, but they help with minified js
- roofwellhams 5y agoCan, but they won't match and you can't break point exactly the same as in just js or ts
- magila 5y agoThat has nothing to do with Javascript's merits as a language though. It's simply the only language browsers expose the DOM to natively.
- aphextron 5y ago>That has nothing to do with Javascript's merits as a language though. Sure it does. DOM support is built into the very core of JS as a language, and that has shaped the entire history of its' development and subsequent API choices. It's not just a library that it happens to support, the way it would be with any other language.
- tshaddox 5y agoCan’t easily write Django code in JavaScript either. In general it’s not like working programmers get to choose any programming language whatsoever for the hardware and platform they’re writing software for.
- pessimizer 5y agoYou don't have to use Django (you can choose one of the billion alternative CMSes), but everyone has to use a browser. Hell, Django itself has to write javascript.
- sirsinsalot 5y agoDjango is not a CMS
- ironmagma 5y agoThere are a wealth of alternatives though... ClojureScript, Elm, ReasonML, and Purescript just to name a few.
- dragonwriter 5y ago> If people didn’t like JavaScript for front end work, it’s not like they could just switch to python Sure, they can, both via compile-to-JS solutions like Transcrypt [0], and via generate-the-frontend-with-backend-Python solutions like idom [1], Plotly Dash [2], and others. [0] https://www.transcrypt.org/ https://www.transcrypt.org/ [1] https://idom-docs.herokuapp.com/docs/index.html https://idom-docs.herokuapp.com/docs/index.html [2] https://dash.plotly.com/ https://dash.plotly.com/
- ad404b8a372f2b9 5y agoThat's not a solution if you end up with Javascript in the end. (Also Dash is absolutely terrible, horrible documentation, horrible code.)
- vbsteven 5y agoWhy is that not a solution? The concept of compiling/transpiling a language into the target language for the runtime is everywhere. Even native languages like C/C++/Rust compile their language into binary format that the platform can run. It just so happens that the web runtime format is JS instead of binary machine instructions.
- HideousKojima 5y agoBecause debugging your transpiled JavaScript becomes a nightmare in a language you already hate
- dragonwriter 5y ago> Because debugging your transpiled JavaScript becomes a nightmare in a language you already hate That’s what sourcemaps are for; you don’t have to debug compiled instead of source format on the web just like you don't on other platforms.
- dragonwriter 5y ago> That's not a solution if you end up with Javascript in the end. ( It is, just as using compile-to-(or interpreted-by-a-runtime-in-)-native-code languages is a solution to “I don’t like raw x86_64 machine code for desktop applications”, even if you end up running machine code in the end. > Also Dash is absolutely terrible, horrible documentation, horrible code. “X is not a choice people can make” is a different claim than “One example of X is not something I personally would recommend”.