Is Python now the default language?

iljitsch

Ars Tribunus Angusticlavius
9,637
Subscriptor++
In the Mac stupid and/or cool thread I posted some AppleScript to fix an issue with the Safari web browser.

Immediate comment: AppleScript sucks. No controversy there. I mentioned ARexx on the Amiga, which was better but would you really want to revive that?

So this got me thinking: is there any situation where, if performance isn't paramount and JavaScript isn't entrenched, anything other than "well it's obviously Python" makes sense?

(Obviously there will be some corner cases, I'm talking about 90%+ of the time.)

Personally, I have a project where I had bash scripts on Linux and Mac and Powershell scripts doing the same thing on Windows to control a bunch of Docker stuff. I'm now thinking: ditch the shell languages and just do it in Python.

(Wow I forgot how much these 2016 MacBoo Pro scissor switch eyboards suc.)
 

Jeff S

Ars Legatus Legionis
11,957
Subscriptor++
In the Mac stupid and/or cool thread I posted some AppleScript to fix an issue with the Safari web browser.

Immediate comment: AppleScript sucks. No controversy there. I mentioned ARexx on the Amiga, which was better but would you really want to revive that?

So this got me thinking: is there any situation where, if performance isn't paramount and JavaScript isn't entrenched, anything other than "well it's obviously Python" makes sense?

(Obviously there will be some corner cases, I'm talking about 90%+ of the time.)

Personally, I have a project where I had bash scripts on Linux and Mac and Powershell scripts doing the same thing on Windows to control a bunch of Docker stuff. I'm now thinking: ditch the shell languages and just do it in Python.

(Wow I forgot how much these 2016 MacBoo Pro scissor switch eyboards suc.)
Well, I currently don't know Powershell that well, but I would note that MS has made .Net Core and Powershell (which is built in .Net) native to Linux and MacOS. If you know and like Powershell, that could be one option. Although, I think for a raw performance standpoint. powershell might actually even by slower than Python.

For scripting tasks, performance usually isn't a big concern anyhow, so Python might be an excellent choice.

Or perhaps Groovy, which runs on the JVM. Startup can bit a bit slow, but runtime performance will be fast, if that's an issue, and because it's jvm, it should run on any platform targeted by Java (although these days that's becoming less guaranteed - like I discovered that there isn't an optimized openjdk for RPi - just the openjdk project zero jvm - which is pretty slow, because it doesn't have native assembly optimizations.

Python probably isn't a bad option though, unless your scripts do something (long running loops/recursion) where Python's inferior performance becomes an issue.
 
Last edited:

iljitsch

Ars Tribunus Angusticlavius
9,637
Subscriptor++
Well, the idea is more that other than when obvious limitations are in play, having everything on Python has the advantage that you don't need something different for a bunch of stuff.

So in my case I can say: you need Python and then you're good. bash on Linux/Mac is easier (although it is severely orphaned on the Mac) and Powershell on Windows is easier, but for me having to do stuff twice is definitely NOT easier.

IMO, all the shell languages are very, very limited, so moving away from them is a win.
 
In the Mac stupid and/or cool thread I posted some AppleScript to fix an issue with the Safari web browser.

Immediate comment: AppleScript sucks. No controversy there. I mentioned ARexx on the Amiga, which was better but would you really want to revive that?

So this got me thinking: is there any situation where, if performance isn't paramount and JavaScript isn't entrenched, anything other than "well it's obviously Python" makes sense?

(Obviously there will be some corner cases, I'm talking about 90%+ of the time.)

Personally, I have a project where I had bash scripts on Linux and Mac and Powershell scripts doing the same thing on Windows to control a bunch of Docker stuff. I'm now thinking: ditch the shell languages and just do it in Python.

(Wow I forgot how much these 2016 MacBoo Pro scissor switch eyboards suc.)

My feeling is you'd be better off using Swift shell scripts.

#!/usr/bin/swift
 
Last edited:

Jeff S

Ars Legatus Legionis
11,957
Subscriptor++
Well, the idea is more that other than when obvious limitations are in play, having everything on Python has the advantage that you don't need something different for a bunch of stuff.

So in my case I can say: you need Python and then you're good. bash on Linux/Mac is easier (although it is severely orphaned on the Mac) <snip>
It's my understanding that while Apple ships a very old version of bash (I think it's something to do with the change from GPL2 to GPL3 maybe? I forget the reason), you can just download the latest version of bash and use that?
 

iljitsch

Ars Tribunus Angusticlavius
9,637
Subscriptor++
Well, when you start downloading stuff, why stick to bash? These scripting languages aren't great. On the Mac you have python3 out of the box. On Linux that is not a hard thing to require. On Windows, Powershell is relatively easy but a slight hurdle. Why not make that hurdle a hair higher and go for Python?

Creating Powershell scripts that mimic bash scripts was a lot of work...
 

Apteris

Ars Tribunus Angusticlavius
9,589
Subscriptor
is there any situation where, if performance isn't paramount and JavaScript isn't entrenched, anything other than "well it's obviously Python" makes sense?
Yes, there is. Are, rather.

Situation the first: you don't like Python. Many such cases.

Situation the second: you think Python is fine but have a lot more experience in another language, so you reach for that. For instance, I'd much rather write a small utility in Java and ahead-of-time compile it with the Graal compiler than futz around with Python.

Situation the third: there is too much ceremony required before you can use Python. At work, for instance, I wouldn't be able to just deploy the Python script to Production; I would instead need to write a Dockerfile that builds the image that contains the Python script I need along with its environment (libraries and such), and then upload that image to the image repository, and then run the image. In such an environment using the built-ins -- such as whichever shell scripting language is offered by the container images you already have lying around -- becomes an appealing choice.
 
  • Like
Reactions: educated_foo

Pino90

Ars Tribunus Militum
1,715
Subscriptor
Yes, there is. Are, rather.

Situation the first: you don't like Python. Many such cases.

Situation the second: you think Python is fine but have a lot more experience in another language, so you reach for that. For instance, I'd much rather write a small utility in Java and ahead-of-time compile it with the Graal compiler than futz around with Python.

Situation the third: there is too much ceremony required before you can use Python. At work, for instance, I wouldn't be able to just deploy the Python script to Production; I would instead need to write a Dockerfile that builds the image that contains the Python script I need along with its environment (libraries and such), and then upload that image to the image repository, and then run the image. In such an environment using the built-ins -- such as whichever shell scripting language is offered by the container images you already have lying around -- becomes an appealing choice.
You can also simply create an executable with python, which is standalone and doesn't need anything more. It requires a bit of setup, tho.
 
  • Like
Reactions: bjn

iljitsch

Ars Tribunus Angusticlavius
9,637
Subscriptor++
Situation the third: there is too much ceremony required before you can use Python. At work, for instance, I wouldn't be able to just deploy the Python script to Production; I would instead need to write a Dockerfile that builds the image that contains the Python script I need
Are there any other options that don't have this limitation, and if so, are they reasonably cross-platform?

I'm not saying Python is super great always, but if you're going to need something that isn't there default, Python is not the worst thing. And having just one of those over several is a win.
 

Apteris

Ars Tribunus Angusticlavius
9,589
Subscriptor
Are there any other options that don't have this limitation, and if so, are they reasonably cross-platform?
For me the big question whenever I'm about to use Python for something is "which environment manager is the one to use this week", followed by a feeling of mild dread at having to Google that and figure out how to use it.

But hey, that's probably a me problem. 1,000,000 data scientists can't be wrong.
 
  • Like
Reactions: owdi

ramases

Ars Tribunus Angusticlavius
9,015
Subscriptor++
Situation the third: there is too much ceremony required before you can use Python. At work, for instance, I wouldn't be able to just deploy the Python script to Production; I would instead need to write a Dockerfile that builds the image that contains the Python script I need along with its environment (libraries and such), and then upload that image to the image repository, and then run the image. In such an environment using the built-ins -- such as whichever shell scripting language is offered by the container images you already have lying around -- becomes an appealing choice.

Hopefully you'll also have someone review Dockerfiles before the container's allowed to hit prod, lest your containers become less of an entirely sensible artifact format and more of a, well, container where-in you hide your toxic sludge and build/deployment techdebt.
 
  • Haha
Reactions: Apteris

tb12939

Ars Tribunus Militum
2,157
So what is Go good for, and does it make sense to spend time learning it to some degree in general?
Python is grand for smallish stuff (be that in lines of code, complexity, or performance requirements), but once you're rewriting it to fix some issues, it's usually good to consider if the project has outgrown python's sweet spot.

Personally i prefer Rust to Go for building blocks, but either way, python is going to struggle past a certain point.

Whether it makes sense or not depends on whether you're actually getting outside that sweet spot or not.
 

hanser

Ars Legatus Legionis
43,847
Subscriptor++
So what is Go good for, and does it make sense to spend time learning it to some degree in general?
In the LLM world, I think you need to know one language + platform really well, and from there you can port the context over to new languages. The CLIs here are all go:

https://github.com/orgs/open-cli-collective/repositories

I haven't written a line of go in my life, but Claude has sure written a lot of it on my behalf. We use all these CLIs on a daily basis -- they carry the weight of a bunch of our internal operations. If you want to see what development on them looks like, click a couple of the recent PRs in the atlassian-cli project.

Rust is arguably more performant, because it doesn't have a 2-5ms startup time per invocation, but IO is always the bottleneck anyway.

I like go for this, because goreleaser makes it trivial to build binaries for Windows, Linux, and macOS for Intel or ARM architectures. And the single binary release makes it super easy to distribute via homebrew, winget, chocolatey, and apt. And there's a ton of well-written, well-documented go code in the world, which means the LLMs are good at writing it.
 

w00key

Ars Legatus Legionis
10,097
Subscriptor
Python is grand for smallish stuff (be that in lines of code, complexity, or performance requirements), but once you're rewriting it to fix some issues, it's usually good to consider if the project has outgrown python's sweet spot.
But don't prematurely optimize. The sweet spot stretches to insanely high, Python for web services, traditional one request = one thread, or asyncio where events dispatch to whatever thread available, scales to thousands of requests per second without breaking a sweat. You bottleneck on IO/SQL layer long before you reach the end of horizontal scaleable workers.

Python skips a lot of overhead compared to let's say PHP. Where each request executes the interpreter from a clean state, loading whatever framework, Python code stays resident and a request is just a method call.
 

digdilem

Smack-Fu Master, in training
6
Speaking personally, as a hobby coder as well as a professional linux sysadmin, my scripting work is about 97% perl. Perl "just works everywhere" in my linuxy world, something python has never achieved. Indeed, there are perl scripts I wrote back in the 90s that are still chugging away today with zero upkeep, despite the OS they run on having changed massively.

But perl is slowly being left behind as that very compatibility is what's blocking future development (plus a sometimes toxic developer community that seems to enjoy fighting about the future more than working together). A shame imo, it's an incredibly powerful and flexible language that stopped being fashionable decades ago.

So for me, perl is the default language, but I'm very much an outlier. God help the guy who has to take over when I retire/die.

Python is also powerful, and there is much to like about it. I don't like having to set environments for everything, and the migration from v2 to v3 was very painful but that's largely behind us now. It's popularity and ease of use means it does suffer from PHP-itis, in that it lets you do some very bad things, but such is the compromise of user friendliness. I write some stuff in Python now, mostly because certain libs and api support is there and it's not for perl. I also do some stuff in powershell (under linux) for the same reason; working with MS APIs and other big players like broadcom, it's a lot easier to get stuff out.

If there is a default language, python might be it, but I'm not sure there is a single default language. Defaults for ops, admin, devops, low level, web, backend, styling, statistical modelling (R is huge here) - the list is endless.

I kind of miss the days when you could count the number of computer languages on your own fingers.

(At work, a lot of my stuff is now ansible, but that's not really in scope for this)
 
So what is Go good for, and does it make sense to spend time learning it to some degree in general?
Go is a threaded-first-class language (see goroutines). Other languages are agnostic and let you foot-gun yourself into oblivion. Java is somewhat threadsafe and has some thread specific mechanics (like the newer ThreadLocal). Rust is highly thread-safe, but you must do all the work. The Rust paradigm is that you are the compiler and you must use all the correct types to adhere to the great and almighty borrow checker.

Go and Rust are the best in category for threading, however, are two very different designs. Rust is a thousand details and Go is all about simplicity. I'd, however, only choose Rust if you have some very specific demands.

I think Go is highly underrated, because it scales so well and is simple. It's 16 years old and, to its own detriment, is resistant to change. So, you don't have to keep learning it.
 

iljitsch

Ars Tribunus Angusticlavius
9,637
Subscriptor++
Ok, if I ever need multithreading I'll look at Go as I have definitely completely forgotten everything I learned the hardest of hard ways about POSIX threads in C two decades ago.

And then came along the project where I actually made most of my money programming the only time in my career and I desperately needed multithreading but the library I needed to use wasn't thread-safe... So lots of fun fork()ing all over the place!

I actually had a separate demon to start up and shut down all those processes, which I called the Master Control Program. In a stakeholder meeting the business people nodded as I explained, the nerds just laughed behind their beards.
 
  • Like
Reactions: AndrewZ

bjn

Ars Praefectus
5,633
Subscriptor++
I find Python my goto language if what I'm writing doesn't need to be performant, or if it does need to be performant, that there is a performant library available for it (and there are alot of C/C++/Rust libs with python bindings). Also for quick and nasty protoypes. I have many gripes about the language, but it does those jobs well enough most of the time.
 

iljitsch

Ars Tribunus Angusticlavius
9,637
Subscriptor++
Ok, so I'm now facing a deadline in a project where I decided that some stuff I previously did with shell scripts wouldn't work well that way. Still the correct call, I think.

So I heeded my argument that started this thread and thought I'd do it in Python 3. Now regretting that. Python really makes a lot of things a lot easier than older languages that I've worked with such as C and PHP. But then again, it also insists on making things that should be easy completely inscrutable, Javascript-style but worse. Why do I get type errors trying to do a simple for range loop? Why do I need to manually work around an off-by-one "feature"? Why do I need to type 8 extra characters to NOT have a newline after a print statement? On my newly revived Commodore 64 with the worst BASIC in the business even back in 1982, that only takes a ;

But the real insanity is trying to work with multidimensional arrays. Yes, also impossible to understand in Javascript, but that's not an excuse.

Shells all suck in their own unique way and are just too limited.

C sucks but at least it sucks in ways that make sense and it has the excuse of being created back when having to manually manage your magnetic core memory was not an insane proposition.

Javascript on the commandline? Yeah right I'm not importing ten million dependencies.

PHP sucks but at least with 30 years of it under my belt I can bend it to my will.

Python mostly doesn't suck at all, but then completely out of left field makes you want to kill puppies. (Yeah I started to watch "Ned & Stacey" right around the same time I started writing PHP.) For instance, pick a lane, do you want strict typing or not? I can work with both. But straddling the middle like Python or Javascript is just so annoying.

I really only see one solution: i. My very own programming language. Basically PHP without the dolar signs and with indentation to create blocks.
 

Pino90

Ars Tribunus Militum
1,715
Subscriptor
@iljitsch

The range thing... That's just how python works. You can't cast a float into a range. But it's just a "int(number)" away.

But also, it's pretty rare in python to use range. You just iterate on the iterable directly or use enumerate if you absolutely also need the index.

A lot of the things you mention seen to come down to applying a C-shaped mental model (memory) to a language that was designed around a different one (objective). Python's model is closer to "describe what you want" than "describe how to do it in memory."

Tthe two dimensional array thing is a bit nuanced. If for some reason you absolutely need it for computation, then the more usable solution is to install numpy and to use their arrays.

If you just need a grid, the pythonic solution is to use a dict and index it by tuples (which is espeocslly effective if your grid is sparse).

my_grid : defaultdict = defaultdict(list)

If you absolutely don't want to use numpy but you actually need an higher dimensional array then yes, you need a list comprehension:

grid = [[0] * 3 for _ in range(3)]

I understand your complaints but then, when you use python for a bit, you wonder why you were forced to care about memory instead of what you actually wanted to do. And in python you can still optimize the shit out of it if you really really need to.

Hope this helps.
 

hanser

Ars Legatus Legionis
43,847
Subscriptor++
I'd rather choose .NET Core or plain old Java over golang for almost anything. Just so much more consistency and far fewer supply chain attacks / issues. Great performance. .NET Core has especially come such a long way and fits into the open ecosystem really well now.
Not for CLIs or any other very-short-running process. 🙃
 

w00key

Ars Legatus Legionis
10,097
Subscriptor
Is the JIT penalty truly a thing for agentic anything? The API latency per tool call is hundreds of ms to many seconds to minutes of thinking, tokens/sec isn't huge on SOTA models. Or anything that hits the network, Atlassian APIs aren't particularly speedy.

I never thought of Java CLI processes of being slow, but in my time so ~Java 8/11, long time ago, packinging is so clunky that you would rather not deal with it. No uv tool install or go install that just fixes it.

Npm/npx is also quite neat and seamless for CLIs.

Note that the Python version is often far neater, install means pulling whl files for your platform and arch, unlike Go that pulls in a ton of dependencies and spends quite a while compiling.


In my experience, Python, Java, Go, Rust all feel instant enough that I don't care. Yes Java would run in interpreted code mode. Who cares haha, not everything needs java -server and the Hotspot compiler spending time turning it into native code. See js/py.

Java in particular knows its stdlib is a bit chunky, extensive, and loading that in each small jvm process is a bit overkill. Solution is Class Data Sharing, just mmap it into each jvm's space, no need to reprocess it each time, saving cycles and memory.
 

iljitsch

Ars Tribunus Angusticlavius
9,637
Subscriptor++
Hope this helps.
It doesn't, by no fault of yours.

If you invent a new language with new logic, yes, to some degree you can ask people to learn the new logic. But being unable to carry over any existing logic just makes your new language not great.

The pritn() thing is supremely annoying, but easy to understand.

But after scouring all sources of programming tips and not being able to figure out how to work with multidimensional arrays is a big fail.

range() is a complete disaster, even before it gave me inscrutable type errors. One of the first thing I did with Python was a super simple benchmark script:

Code:
import sys
import math
 
n = int(sys.argv[1])
 
if (n % 2 == 0):
    print(2)
 
for i in range(3, n, 2):
    if (n % i == 0):
        print(i)

That didn't work so well with nice big numbers. Why, you ask? Because range() creates its range in memory, so that took so much memory that the computer was swapping virtual memory, using up a lot of time.

So basically for loops that match what you'd do in C or PHP are useless in Python for anything non-trivial as you're using massive amounts of memory for no reason, so you need to revert to while loops.

Why can there never be a programming language that doesn't have massive disadvantages?
 

bjn

Ars Praefectus
5,633
Subscriptor++
It doesn't, by no fault of yours.

If you invent a new language with new logic, yes, to some degree you can ask people to learn the new logic. But being unable to carry over any existing logic just makes your new language not great.

The pritn() thing is supremely annoying, but easy to understand.

But after scouring all sources of programming tips and not being able to figure out how to work with multidimensional arrays is a big fail.

range() is a complete disaster, even before it gave me inscrutable type errors. One of the first thing I did with Python was a super simple benchmark script:

Code:
import sys
import math
 
n = int(sys.argv[1])
 
if (n % 2 == 0):
    print(2)
 
for i in range(3, n, 2):
    if (n % i == 0):
        print(i)

That didn't work so well with nice big numbers. Why, you ask? Because range() creates its range in memory, so that took so much memory that the computer was swapping virtual memory, using up a lot of time.

So basically for loops that match what you'd do in C or PHP are useless in Python for anything non-trivial as you're using massive amounts of memory for no reason, so you need to revert to while loops.

Why can there never be a programming language that doesn't have massive disadvantages?
It doesn’t populate the range of values in memory and iterate over those values, it basically iterates a counter from start to stop as you'd expect. I ran your little program feeding it 1000000000, it just took a while, no swapping on my ancient mac.

The docs clearly state that to be the case, or you can look at the cpython implement if you don't believe me.
 

Pino90

Ars Tribunus Militum
1,715
Subscriptor
Ninj'd by bjn but since I wrote it...

The print statement... Idk man. I hate writing the freaking /n at the end of every string I want to print. Ask me what I think about the string termination character and other amenities. But anyway, in 2026 you shouldn't print unless absolutely needed (e.g. a CLI tool), you should be using a logger that handles things for you. I understand you're doing scripting, but still, it's good practice to have the output on a file in case something goes very wrong.

On the multi dimensional arrays: you've been given three solutions. Is your problem that you don't want to write a list comprehension to initialize them? Do you absolutely need to pre-allocate memory? Do you have a specific problem with the syntax? What's the actual issue? I don't get it, sorry.

I also think that your complaint about "can't carry over existing logic" is, to be nice, a bit unfair. It does carry over. What doesn't is the mechanical thinking, which you seem to be stuck in. And not having to do the mechanical thinking is kinda... Python's point. Completely.

There's a huge distinction between logic (eg the algorithm or business logic) and the acrobatics you need to do to implement it in a given language. Thanks God the mechanics don't carry over, but all the rest does.

On your example using range() I have a couple of comments.

1) not to nitpick but the logic you posted is a huge algorithmic failure. You only need to check up to sqrt of n, and since you've imported math, you're halfway there.

2) I don't know what you're doing but range in python 3 uses lazy memory initialization. Technically speaking range() is a generator, so it doesn't instance anything besides the generator itself. I can run this just fine without any memory leak, using a large number like 2^300 (which doesn't require me to declare a new type, btw, which is sad, because I absolutely loved declaring bool_t, long_t, very_long_t, big_number_t etc. etc. /s).

I think that either you're using python 2 (but it doesn't look like it) or you're doing something very weird. I'm calling BS on this straight away, sorry!

Also, for what you're trying to do, you could use a while which is exactly like in the languages you love (that however would force you to declare a type).

Python:
import time
import math
start = time.time()
# this is a momumentally huge effing number
n = 2 ** 300 +1
start = time.time()
for i in range(3, n, 2):
    if n % i == 0:
        print(i) # this is so much better and cleaner than printf("%d\n", i)
end = time.time()
print(f"Executed in: {end-start}")

# correct implementation because we can't have factors
# larger than sqrt(n)
start = time.time()
for i in range(3, int(math.isqrt(n)) + 1, 2):
    if n % i == 0:
        print(i)
end = time.time()
print(f"Executed in: {end-start}") # this is so much faster

# # exactly as in C, BASIC and any older language
# # but why would I write something like this? Slow and clunky
# # and I'm not a masochist
# start = time.time()
# i = 3
# while i < n:
#     if n % i == 0:
#         print(i)
#     i += 2
#end = time.time()
#print(f"Executed in: {end-start}")
 
Last edited:
  • Like
Reactions: bjn

Pino90

Ars Tribunus Militum
1,715
Subscriptor
Also, if you don't like print's behavior, you can define your own. You can monkey patch print at runtime to make it behave like you want, you can use sys.stdout.write or you can define a helper:
Python:
from functools import partial
print = partial(print, end="")

Or if you want to make it permanent across your project, you can do it by putting these lines somewhere that's always loaded (for instance an init.py ).

Python:
import builtins
from functools import partial

builtins.print = partial(builtins.print, end="")

I stand by my opinion that if you're printing this much, you have other challenges to fix before resorting to monkey patching the builtins, and I stress that this is terrible terrible software design which will confuse anything and anyone reading the code, possibly including future you.

But still, there's a solution to (almost) anything.

Try the numpy arrays next, they behave in a less pythonic and more standard way. And anyway, half the libraries out there expect a numpy array anyway :)
 
  • Like
Reactions: bjn

iljitsch

Ars Tribunus Angusticlavius
9,637
Subscriptor++
Well, I do largely appreciate the criticisms as or or two of you definitely spend a good amount of time delivering them and obviously if I want to get better with Python then obviously complaining about it should only be a small fraction of that effort.

That said, I think the feeling that some parts of this language are hard to understand and could have been simpler and/or better explained. Literally nothing I've looked up on python.org actually helped me answer my questions.

As for my issues with my supremely poorly put together simple benchmark: I'm almost certain this was Python 2. But believe me, I am absolutely sure about that memory swapping issue.

But one cool thing about that benchmark was that it showed that Javascript was barely any slower than C.

In pandemic times I had too much time on my hands so another thing I did was go in search of the perfect sorting algorithm, attempting to implement and benchmark different ones in Python. That worked just fine, but that ended up being a referendum of different Python under the hood data structures rather than the sorting algorithms themselves, so I switched back to C.
 

hanser

Ars Legatus Legionis
43,847
Subscriptor++
Is the JIT penalty truly a thing for agentic anything? The API latency per tool call is hundreds of ms to many seconds to minutes of thinking, tokens/sec isn't huge on SOTA models. Or anything that hits the network, Atlassian APIs aren't particularly speedy.

I never thought of Java CLI processes of being slow, but in my time so ~Java 8/11, long time ago, packinging is so clunky that you would rather not deal with it. No uv tool install or go install that just fixes it.

Npm/npx is also quite neat and seamless for CLIs.

Note that the Python version is often far neater, install means pulling whl files for your platform and arch, unlike Go that pulls in a ton of dependencies and spends quite a while compiling.


In my experience, Python, Java, Go, Rust all feel instant enough that I don't care. Yes Java would run in interpreted code mode. Who cares haha, not everything needs java -server and the Hotspot compiler spending time turning it into native code. See js/py.

Java in particular knows its stdlib is a bit chunky, extensive, and loading that in each small jvm process is a bit overkill. Solution is Class Data Sharing, just mmap it into each jvm's space, no need to reprocess it each time, saving cycles and memory.
It bothers my sense of aesthetics. Since I'm not writing the code myself, it sorta doesn't matter. goreleaser is an amazing piece of technology. I just find the go ecosystem really well suited to building CLIs. Single binaries work really, really well for chocolatey, winget, homebrew, etc. It's as easy as it gets. No required runtime, no JIT. Simple, clean, effective.

I also considered rust, and am about to embark on a rust adventure as soon as time/attention allows. I needed the codereview building block first before I could get going.
 
As for my issues with my supremely poorly put together simple benchmark: I'm almost certain this was Python 2. But believe me, I am absolutely sure about that memory swapping issue.
Yes, under Python 2 range() does return an actual list containing the elements. However, for very long ranges you were supposed to use xrange which behaves similarly to the current range which is actually a full type. Your example was confusing because the print function only exists built-in on 3 and requires an explicit import in the 2 versions that support (2.6, 2.7).
 
  • Like
Reactions: Pino90