4 ms·
Honest question, in what sense is python a so much better choice for web development? syntax? subjective, and it would also mean all C-likes belong in the dust
by janpot 7y ago
Honest question, in what sense is python a so much better choice for web development?
syntax? subjective, and it would also mean all C-likes belong in the dustbin.
performance? Why would python, as a language, be significantly more performant? It's just as dynamic.
ecosystem? JS community is huge, JS package managers are huge (even though not flawless, but nothing their python counterparts do better)
I mean I can surely imagine there's better alternatives for JS, as a language. But python...?
- ShakataGaNai 7y agoNot Op, but I'd like to do python/WASM because I don't do want to do C-Like languages. Sometimes you want to do some light web interactivity without major mental context switching. For me, personally, it's a lot of effort to switch between languages. So when I'm building a web project and most of it is django/flask/python/etc, but I want something more dynamic than a HTML form post/browser reload... I need to do it in Javascript. Not that I can't javascript, I can, it's just hard to change over and I'm slow to write it. It would be a whole bunch nicer if I could just stay in the python mindset for those small pieces of code. Do I think python is "better" for the web? No. do I think it's faster? Doubt it. Do I think it's "better" for my use cases? Yes - And that's the power of WASM. It allows people to do what works for them.
- LessDmesg 7y agoFor one thing, not being broken. Python doesn't have ("1"+1) and similar design flaws, Python doesn't need a new ECMAscript standard every year, Python has figured out modules and classes much earlier, and frankly, Python is what Javascript is only becoming after years of improvement. Really, I don't understand why we and the browser maintainers have to put up with a broken, insane language when there is a similar but much more mature and "done right" one. And as far as ecosystem, Python can kick Javascript's ass if not in quantity (though it's close) then in quality of its userbase for sure. And Python has been used onе the backend much more than JS, so it makes much more sense to unify the language and just use Python for the front-end.
- wahern 7y ago> Python has figured out modules... much earlier, You expect that to carry over to WASM environments?
- strbean 7y agoI feel like almost every one of those points is highly debatable. - New ECMA standard every year VS. new PEPs every year - Modules and classes: cyclic dependency hell, obscure multi-import issues, __init__.py ugliness, imperative class declaration. Python only figured these things out much earlier to the extent that it has actually figured these things out. ...
- h8hawk 7y agoI think almost any thing is better than js. At least it is popular due to its actual developer's. People use it because they like it and its ecosystem was grown by them, not force of a dumb decision in 90's or company backup. Both performance and ecosystem are not characteristics of language. they are due to being the only language is being supported in browser. (hint: I won't use python for web) Also comparing languages based on syntax and ecosystem is not very clever idea.
- mark_thompson 7y agoWas going to ask in the main thread but perhaps here is a better place. For someone just starting with programming, but targetting WASM, which would be a good first programming language? Java? In my particular case, I've been learning Python for Data Analysis for about one year, and a few months of Haskell (love Haskell so far, but my interest/job is related to data analysis and web dev). I've heard bad things about Python as first programming lang (weakly typed and bad OOP implementation).
- shantly 7y agoSince Java relies on the JVM I think I'd avoid it, and any other languages that'd require running another VM on top of the WASM VM. Seems like useless stacking of technology that serves basically the same purpose. Not saying it wouldn't work and that it won't be done, but just seems kinda gross and missing-the-point. Personally I'd also avoid anything with a fatter runtime than maybe Go or C#. If it doesn't already, I'd expect C# and .net generally to have really good WASM support, actually. And even those, unless it becomes standard to ship their runtimes with a browser, you're talking about a pretty fat package to ship before the program can even start running. Most interpreted languages (like Python) running on WASM will probably be notably slower than Javascript running outside WASM, for the reason that they'll have similar limitations on optimizability, will have had fewer person-years put into optimization than Javascript (which has seen tons of investment from e.g. Google), and will be running on an interpreter in the WASM VM rather than a C++ (or whatever) native interpreter. And they'll have the problem of needing to ship an interpreter, similar to the runtime problems for the languages above. For the best experience you want something fast-loading and well-performing. That means small package size and not too deeply nested in terms of abstraction on top of WASM. If you want a better experience on both fronts than JS, which has the benefit of already having its interpreter bundled with the browser and running on a native, highly optimized interpreter—IOW if you want running on WASM to actually be a win in any meaningful UX way—you'll need to look at fairly low-level languages, I think. C++ is a good bet—people are quick to shit on it, but it remains hugely important in GUI application development—or, if you're wanting something hipper, Rust, perhaps. Go or .net-family languages might be OK, future-proof-ish choices if you don't mind sacrificing load time a bit. Toss Swift in that bucket too, I guess.