I’ll just leave this here…
Python 3.6
ceverett@icecream:~/Code/python$ cat hello.py
#! /usr/bin/python3
print("Hello, world!")
ceverett@icecream:~/Code/python$ ./hello.py
Hello, world!
ceverett@icecream:~/Code/python$ valgrind ./hello.py
...
==19264== HEAP SUMMARY:
==19264== in use at exit: 320,946 bytes in 166 blocks
==19264== total heap usage: 1,698 allocs, 1,532 frees, 2,505,946 bytes allocated
==19264==
==19264== LEAK SUMMARY:
==19264== definitely lost: 0 bytes in 0 blocks
==19264== indirectly lost: 0 bytes in 0 blocks
==19264== possibly lost: 5,608 bytes in 10 blocks
==19264== still reachable: 315,338 bytes in 156 blocks
==19264== suppressed: 0 bytes in 0 blocks
...
==19264== ERROR SUMMARY: 8163 errors from 116 contexts (suppressed: 0 from 0)
ceverett@icecream:~/Code/python$
Python 2.7
ceverett@icecream:~/Code/python$ cat hello2.py
#! /usr/bin/python
print "Hello, world!"
ceverett@icecream:~/Code/python$ ./hello2.py
Hello, world!
ceverett@icecream:~/Code/python$ valgrind ./hello2.py
...
==19416== HEAP SUMMARY:
==19416== in use at exit: 417,246 bytes in 199 blocks
==19416== total heap usage: 2,958 allocs, 2,759 frees, 3,085,205 bytes allocated
==19416==
==19416== LEAK SUMMARY:
==19416== definitely lost: 0 bytes in 0 blocks
==19416== indirectly lost: 0 bytes in 0 blocks
==19416== possibly lost: 528 bytes in 1 blocks
==19416== still reachable: 416,718 bytes in 198 blocks
==19416== suppressed: 0 bytes in 0 blocks
...
==19416== ERROR SUMMARY: 489 errors from 30 contexts (suppressed: 0 from 0)
ceverett@icecream:~/Code/python$
Erlang R23
(On this one I can include the entire output.)
ceverett@icecream:~/Code/erlang$ cat hello_world
#! /usr/bin/env escript
% Example of an escript
-mode(compile).
main(_) ->
ok = io:setopts([{encoding, unicode}]),
io:format("Hello, world!~n").
ceverett@icecream:~/Code/erlang$ ./hello_world
Hello, world!
ceverett@icecream:~/Code/erlang$ valgrind ./hello_world
==25872== Memcheck, a memory error detector
==25872== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==25872== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==25872== Command: ./hello_world
==25872==
Hello, world!
ceverett@icecream:~/Code/erlang$
Hey, Python! What the actual fsck is going on here?!? Jeebus… The Good Idea Fairy came along and convinced the webtarded among you to start throwing kitchen sink features in (“walrus operator” — yeah, great idea, that, and totally worth losing the sober guidance of Guido over…) along with 8163 memory errors. Sweet! Oh how far the great have fallen…
Honorable mention: Ruby 2.5
I didn’t expect much better from Ruby as the Good Idea Fairy has been forwarding all xer mail there for years, but wow… just wow…
ceverett@icecream:~/Code/ruby$ cat hello_world.rb
#! /usr/bin/ruby
print "Hello, World!\n"
ceverett@icecream:~/Code/ruby$ ./hello_world.rb
Hello, World!
ceverett@icecream:~/Code/ruby$ valgrind ./hello_world.rb
...
==27051== HEAP SUMMARY:
==27051== in use at exit: 2,921,234 bytes in 20,690 blocks
==27051== total heap usage: 65,312 allocs, 44,622 frees, 16,447,358 bytes allocated
==27051==
==27051== LEAK SUMMARY:
==27051== definitely lost: 385,479 bytes in 4,421 blocks
==27051== indirectly lost: 640,953 bytes in 5,808 blocks
==27051== possibly lost: 1,626,429 bytes in 9,663 blocks
==27051== still reachable: 268,373 bytes in 798 blocks
==27051== suppressed: 0 bytes in 0 blocks
...
==27051== ERROR SUMMARY: 162050 errors from 402 contexts (suppressed: 0 from 0)
ceverett@icecream:~/Code/ruby$
162,050 memory errors. For Hello, World. How can there even be 162,050 instructions in the resulting set of commands to the system?
The same program happens to work for Perl:
Also for Julia (and this is a disaster):
~~~ Shitload of errors about invalid reads (past variables end), accesses to uninitialized data and such
Julia?!? Oh noes! But you were the chosen one!
These are quite a lot of fun to play around with.
A friend found the same thing as you when testing Perl. I just wish Perl’s syntax was as clean as its runtime’s memory allocation practices!
To test Python with valgrind you have to enable the malloc allocator:
See https://docs.python.org/3/using/cmdline.html#envvar-PYTHONMALLOC
Interesting! With my installation (Ubuntu’s build of 3.6.9) the output has changed to:
Which build of Python are you testing?
Thank you. Excellent visualization of today state of affairs in complang land …
I’m lately in loved with Elixir (BEAM, Erlang ;-).
Am asking for a friend, how about Java? Is Java doing any better?
Java… the OpenJDK seems to be a bit of a problem child in this regard. The Oracle and IBM JVMs I have not tested so I can’t say. I assume Oracle would sue me if I checked it, as litigation is their main business now, and IBM would probably rope me into a $10k/month perpetual contract — so I’m holding off.
For this program that literally does nothing
…
we have.. six hundred and twenty three thousand, nine hundred and
eighty nine errors.
Let’s try Hello World
…
nine hundred and eleven thousand, nine hundred and eighty errors.
FizzBuzz
…
Only… eight hundred and twenty six thousand, six hundred and
forty-six errors. So we’re down from hello world. I mean Hello World
is pretty hard.
Oh and since you asked, Elixir is for faggots.
WOW! That’s a lot of errors… Fortunately I don’t have to deal with Java.
And yes:
It is known. Well, only known to a handful of people because very few people research or try a new thing if it isn’t pumped on YouTube by a fake programmer paid by AWS/Google/Apple/MS who hates everything because he realizes for the first time as a paid shill that everything popular is retarded and built on fake paid hype…
Nadir Dabit’s new video (which he dropped immediately after quitting his job as a paid AWS shill, er “developer advocate”) is instructive:
Epic.
Anyway… Java is like junk food, produced by smart people for consumption by masses of people less intelligent than them.