TIL that #Rust, while amazing, isn't so amazing for quick-and-dirty coding. It's like flying the Concorde for a 1-hour car trip.

@JonYoder There are reasons I often reach for the shell for quick-and-dirty things. But for anything serious, it quickly becomes a problem. In the days of Python 2, it was a good replacement, but with Python 3's inability to correctly handle POSIX filenames, environment variables, and parameters, I wouldn't bother. Rust is actually pretty decent for a lot of quick stuff once you get used to it.

@jgoerzen What kinds of problems have you run into with Python 3?

@JonYoder I wrote a series of articles on this subject culminating in changelog.complete.org/archive . In short, I was so burned by my effort to port to 3 -- and the utter crappiness and inconsistency of handling non-UTF8 in even the library bundled with Python -- that I consider it unsuitable for any purpose involving filenames, command-line parameters, or environment variables. One lovely tidbit is the zipfile.py tries to decode non-UTF8 sequences as cp437 in ALL cases!

@JonYoder If you want a coffee with your reading, after that first link, you can check out changelog.complete.org/archive and changelog.complete.org/archive . The upshot of it is, as far as I can tell, it is impossible to write cross-platform code that handles filenames correctly on both POSIX and Windows. gets this right, and Python's attempt to assume the whole world has used since the beginning of time is a real pain.

@JonYoder You got me thinking in more detail why I reflexively avoid now, despite the fact that I wrote two large programs ( and ) in it, and published a book about it. 1/

@JonYoder It is astonishing to me that still has a Global Interpreter Lock in 2022. wiki.python.org/moin/GlobalInt Multithreading in Python is mostly a fiction. There are kludges like docs.python.org/3/library/mult which use fork, pipes, pickling, and message passing to simulate threads. But there are so many dragons down that path -- performance and platform-specific ones (different things can be pickled on Windows vs. Linux) that it is a poor substitute. 3/

@JonYoder Sure, people use for things like work. In this case, Python is merely a shell; the real multithreaded code is in a different language (often C). The way to get performant multithreading out of Python is to not use Python at all. 4/

@JonYoder When I started using more than 20 years ago now, it was an attractive alternative to Perl: like Perl, you don't have to worry about memory management as with C, but Python code was more maintainable. By now, though, even writing a Unix-style cat command in Python is extraordinarily complicated lucumr.pocoo.org/2014/5/12/eve . All the "foo-like objects" are an interesting abstraction until they break horribly, and the lack of strong types makes it hard to scale code size. 5/

@JonYoder These days, we have credible alternatives to : , , and (among many others). All three of these are performant, avoid all the manual legwork of or the boilerplate of , and provide easy ways to do simple things. 6/

@JonYoder The one place I still see being used is situations where the is valuable. (Note, also has this). is an example of this too. People use for rapid testing of things and interactive prototyping. For a time, when I had date arithmetic problems, I'd open up the Python CLI and write stuff there. Nowadays it's simpler to just write a Rust program to do it for me, really. 7/

@JonYoder So that leaves me thinking: We're thinking about wrong these days. Its greatest utility is as a shell, not a language to write large programs in. As a shell, it is decent, especially for scientific work. Like other shells, most of the serious work is farmed out to code not written in Python, but there is utility in having it as a shell anyhow. And like a shell, once your requirements get to a certain point, you reach for something more serious. end/

@jgoerzen > We're thinking about #Python wrong these days. Its greatest utility is as a shell, not a language to write large programs in.

Oh how I wish that Tcl could have kept that niche; as a shell, it's actually fantastic


@tfb @JonYoder That is a really interesting point. I remember two programming languages, and , that were really hot for awhile, for various reasons. Both went through a sort of boom and then a decline. I wonder what it is about these interpreted languages that caused that effect? I also wonder if we will see it effect more interpreted languages.

@tfb @JonYoder I remember reading the Perl Camel Book with actual excitement - "wow, this is so much easier than C!" And similar writing a GUI in Tcl/Tk nearly 30 years ago now. Today I wouldn't touch either of them. I moved from both of them to Python in the early 2000s, and then from Python to Haskell, OCaml, Rust, etc. after experiencing some issues with scaling Python even in the v2 era. (Now, people are, eg, rewriting server in non-Python languages for performance)

@tfb @JonYoder One of the things that hit me starting with and continuing through is that rapid prototyping is overrated, and there is a lot to be said for "if it compiles, it is (more) likely to work." I think this has significantly raised my expectations for code quality and reordered how I think about productivity (invest a bit more upfront and spend less time debugging later) C, C++, Java, etc. didn't have that property really.

@jgoerzen I think Test Driven Development provides that assurance, but for real instead of kinda if you squint.

@mike TDD definitely helps, but I guess my experience is that tests don't catch all bugs, compilers don't catch all bugs, and the more bug-catching tools you can have in your toolbox the better.

@jgoerzen There’s also lint available for most interpreted languages and sophisticated configuration environments

@jgoerzen @tfb @JonYoder I felt the same way; I think in both of these cases it's that the languages do some small (but important) things well, but then lack bottom. Tk is still the nicest toolkit I've ever used in some ways (lack of modern widgets notwithstanding), but it's freaking hard to use it for large programs because Tcl's data types suck. Ditto for perl and text slicing.

@jgoerzen @tfb @JonYoder

I think you could argue that Ruby and now JS is starting to hit that cycle now too. That's not to say either is dead or really dying, just that they're not the hype language any more (Now it seems to be Rust.)

That being said, Perl is enjoying a nice renaissance at the moment. It's nowhere near its glory days but it has an active community that are working on it regularly and adding new features.

@splatt9990 @tfb @JonYoder Interesting. I could have guessed Ruby but JS surprises me. Also that Rust is the hype language; am I actually doing the popular thing at the right time for once? 🙂 Also I'm glad to hear that Perl is having a renaissance.

@jgoerzen @tfb @JonYoder IME/O sentiment is beginning to turn against JS yes. It's still early on the decline side but the first few signs of it are starting to appear.

Re: Rust yeah that seems to be the "hot new thing" at the moment. We're at the "everything must be re/written in it" stage of the hype cycle right now.

@jgoerzen Now that I hear #Ruby mentioned, how do you think it compares to Python overall? Better choice? Not so much?

@JonYoder I don't really have enough experience to comment. Maybe someone else has done a lot of work in both and

@jgoerzen @JonYoder i've used both quite a bit. languages are pretty similar, but communities feel quite different (both healthy IMO), while ruby seems very front end focused and python back and front

@sckottie @JonYoder I do pretty much zero web development in the usual sense, so I may be coming at this from a different angle. Systems programming, integration, working with radios, asynchronous communication, machine learning, and global-scale caching have been my personal and professional areas of interest. Either not web-related at all or, if you have to stuff it into some category, backend I guess.

Sign in to participate in the conversation

For people who care about, support, or build Free, Libre, and Open Source Software (FLOSS).