A Python Substitute? I Tried the Best Programming Language You’ve Never Heard Of
medium.com
medium.com
I don't want to have to click through to know what the language comparison is.
It's marketed as a modern systems programming language, but I don't see any benchmark comparision with C/C++/Rust on language benchmark shootout.
As for me I selected Julia from the language benchmark shootout as my to go programming language, and I'm not looking back (Rust/C++ are a bit too level for my needs, but I still need performance).
Funnily enough this is because the author of that benchmark outright refuses to include new languages such as Nim.
I learned a lot from the benchmarks themselves. Somebody could just fork it if it's not well maintained, but I know that it's extra work.
Virtually any question or problem I run into with Python's core libraries or language features is answered in detail by the first Google result. It's getting rare to not find a reasonably well documented Python binding for any given library, and many projects have official Python bindings. It's almost trivial to find an example of how to do virtually anything in Python.
Any language could be argued as an alternative to Python, but very few can be a substitute for it given the scale of investment and mind-share Python has.
Great as they may be in their own domains, you can’t say that about Julia, Nim, Matlab etc.
Just JavaScript transpiring seem A bit lacking atm, then it is complete...
That’s also how Swift does it too.
Throw in type inference and statically typed languages look much nicer.
Swift uses C style braces, while Nim seems to use white space like Python.
Here is an example:
Given `create_csv.py`:
with open("output.csv", "w") as csv_file:
for i in range(1_000_001):
csv_file.write(",".join([str(i)] * 100)) # creating 100 columns per entry out of a million
csv_file.write("\n")
and `search_csv.py`: import sys
for row in open("output.csv"):
if "1000000" in row.split(","):
print(row)
break
else:
sys.exit("row 1 million not found!")
With the first script creating a 1 million line csv with each row containing 100 columns, and the second one being a worse case search (has to make it all the way to last row, has to search every column). The performance is better than what you mentioned on commodity hardware, very unoptimized Python code, and default Python3 installation:time python3 create_csv.py
real 0m3.267s
user 0m2.589s
sys 0m0.608s
time python3 search_csv.py1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000
real 0m6.132s
user 0m5.954s
sys 0m0.162sI’m very interested in Nim and try to keep up with news, but I just don’t have time for yet another language and community. That’s unfortunate because I see a lot of promise in it, and I think it would be a joy to work with every day.
I’m just quietly waiting, hoping for Nim’s Django.
Nim is case- and underscore-insensitive (except for the first character). Thus HelloWorld and helloWorld are different, but helloWorld, helloworld, and hello_world are all the same
I really don't understand this feature of the language.
Took me some time to understand to but once I tried it, it's pretty cool.
Compiling var my__thing = 10 yields:
Error: invalid token: trailing underscore
Which is actually my biggest complaint about Nim. The error messaging is terrible, as are some of the decisions around the standard library. There's a good amount of bad and Windows-centric language there, unfortunately. Functions in the standard library like "setCtrlCHook" https://nim-lang.org/docs/system.html#setControlCHook%2Cproc...
Overall still a fan of Nim. Unlike many of the people in this thread, "marketing" is not a concern to me. I don't expect to ever program with Nim at my day job because "marketing" programmers are too dogmatic these days. Day-job languages are always going to be hypelang_2020 + dogma_patterns_v3. I very much like that the Nim community feels underground, is small and active. I hope it never suffers from the influence of modern dayjob programmers, but this is because I've seen the fun sapped out of other communities. A selfish desire, if I may.
I've already said this here, but progressive degradation is a great strategy going like this: you start with a sane and nice baseline, and then add crap to that for supported browsers and configurations.
You can be thankful to Medium for adopting this technique, because if everybody did that, you'd get a perfect Web by just blocking Javascript on anything that is supposed to be a freaking document. Please lobby for this. The team behind Medium might even be secretly doing this on purpose but don't tell their boss.