4 ms·
> Python is the 2nd best language for everything. Huh? Why? You can barely deploy it to Web. it doesn't scale perfoance wise you can't built robust abstract
by pharmakom 4y ago
> Python is the 2nd best language for everything.
Huh? Why?
You can barely deploy it to Web.
it doesn't scale perfoance wise
you can't built robust abstractions
The REPL is merely OK
You can barely ship working code without containers
the syntax is hard to manipulate programmatically
Python has inertia but it's holding us back
- l33tman 4y agoWell for starters, web deployment isn't "everything". Python is the de-facto go-to language for research or general prototyping, where not everyone is a programming wiz keeping track of the latest trendy new compiled language. Not everyone can compile stuff even.. :) Having said that, I've deployed two large Django projects on the web with tons of customers and it runs and scales just fine, and it's a DREAM to maintain and develop for than for example Java.. I would go so far as to say the opposite, if you haven't used Python for web deployment you've been missing out! (you lose some efficiency I'm sure but you gain other things)
- pharmakom 4y agoI was talking about running in the Web browser. it's not everything, but it's an important part of everything in my book.
- sireat 4y agohttps://github.com/pyodide/pyodide https://github.com/pyodide/pyodide is pretty amazing for running Python client side in the browser. You could run notebooks entirely client side https://jupyterlite.readthedocs.io/en/latest/ https://jupyterlite.readthedocs.io/en/latest/ The startup is slow but otherwise it is pretty functional.
- renox 4y agoYou have good points but "the syntax is hard to manipulate programmatically"?? Maybe you haven't noticed but Lisp is now a tiny niche and most new languages aren't homoiconic either..
- pharmakom 4y agoI don't think that proves anything. If we had "JavaLisp" in the browser instead of JavaScript then Lisp would be very popular. Besides that, Python is harder to manipulate than many non-Lisps, such as JavaScript and Go.
- kazinator 4y agoHere, we can set Lisp aside and take grandparent comment's definition of syntax to be concrete, character-level syntax. Python concrete syntax is harder to manipulate programmatically compared to Javascript concrete syntax. For instance, to insert one statement into another, we need to traverse the lines of that syntax and add the right amount of indentation. We can't just plant the syntax into the desired spot and be done with it.
- alanfranz 4y agoWhat is another language working that well in a larger number of areas?
- pharmakom 4y agoClojure JavaScript Typescript OCaml Haskell F#
- alanfranz 4y agoAny JVM language or .NET language will take more to interface with native libraries, it’s not the same. Ocaml is very niche, I feel it’s an hard sell for a general purpose language. Haskell, 3x that. JS and TS, could be. But are they so much better than Python, if better at all?
- revelio 4y agoNative library interfacing isn't really Python's strong suit, interpreter plugins are quite painful to write. .NET has P/Invoke which is much nicer. JVM is getting Panama+jextract, which is the nicest yet. You can go straight from header files to pure Java bindings which don't need any extra native code at all. But it's not shipped yet :(
- baq 4y agoPython has had cffi since figuratively forever, so I’m not sure why you compare native modules to P/Invoke?
- revelio 4y agoMost important libraries with native components are using C extensions, not cffi.
- alanfranz 4y agoWhat is an “interpreter plugin?” Writing a Python C extension is not that painful, it’s quite well supported. And you’ve got cffi and ctypes as well.