Post AW4x6WMf6YPPVq5cUi by tiago@social.skewed.de
 (DIR) More posts by tiago@social.skewed.de
 (DIR) Post #AW4x6WMf6YPPVq5cUi by tiago@social.skewed.de
       2023-05-27T11:31:05Z
       
       0 likes, 0 repeats
       
       I shan't be putting down my C/C++ compiler anytime soon.But I wonder what's going on with Fortran... It's hard to believe it's 4x slower than C, and there's just no way it's slower than Lisp!QT FRicciTersenghi: Python codes are on average 70 times slower and energy consuming than C codes!! One more very good reason to teach C programming to my students 😉[data and image taken from https://doi.org/10.1016/j.scico.2021.102609]
       
 (DIR) Post #AW4xNSkjmnYhEZQfnU by promovicz@chaos.social
       2023-05-27T11:34:06Z
       
       0 likes, 0 repeats
       
       @tiago Even Java can beat C when the problem is helped by an optimizing JIT or trace compiler. C provides good control and optimization for optimal algorithms - it's less good with suboptimal ones.
       
 (DIR) Post #AW4xsR3w7XkKy7B7Hk by Zeugs@social.cologne
       2023-05-27T11:39:44Z
       
       0 likes, 0 repeats
       
       @tiago If you do a good implementation in machine code it's probably faster than C. Also implementing stuff right is harder in C than it is in Python. Since Python mostly depends on libraries written in c/c++ it's a bit hard to compare. Python is often just glue code. In my opinion it's a question where and how to use a programming language, since they are a bridge between humans and machine code. A Bad implementation and wrong memory management can nullify speed advantages.
       
 (DIR) Post #AW4y3jRY7aYvA3brH6 by kisharrington@mastodon.social
       2023-05-27T11:41:45Z
       
       0 likes, 0 repeats
       
       @tiago This table goes around every now and then, but it is pretty misleading for the real-world usage because the tests don't use popular libraries like numpy. I haven't dug into examples from all the other languages, but after looking at how this was done for Python my interpretation was: Use programming languages in a way that matches their nature. If you want to see how fast it takes for a snake to get somewhere, asking it to run is not going to lead to a meaningful comparison.
       
 (DIR) Post #AW4y9tlyd5scw26Z9M by tiago@social.skewed.de
       2023-05-27T11:42:55Z
       
       0 likes, 0 repeats
       
       @promovicz Sure, but there are inherent limitations with Java that are possible to circumvent or are nonexistent in C (e.g. floating point arithmetic), while the opposite is not true. So, performance wise, the C language dominates Java.However, this is not true for Fortran vs C. So that benchmark must be doing something stupid with Fortran.
       
 (DIR) Post #AW4zFYtTGpTDs4sHk8 by promovicz@chaos.social
       2023-05-27T11:55:06Z
       
       0 likes, 0 repeats
       
       @tiago Absolutely - but I hold that these measures are really just spot measurements of how we implement languages. Python is basically a Lisp at this point, and it could be similarly fast if it had an abstraction-lifting compiler. Hand-tuned OCaml often beats C because they force similar axioms.... I see language performance as a much more complicated equation.
       
 (DIR) Post #AW4zgIwefvAiE57EtU by lmrocha@qoto.org
       2023-05-27T11:59:56Z
       
       0 likes, 0 repeats
       
       @tiago from the phone I can't read the whole thing, but I wonder what version of Pascal they used that is slower than Java. Way, way back Borland (object) Pascal (later Delphi/Kylix) produced compiled C++ code.
       
 (DIR) Post #AW536o8vbWLMNPBZfk by vivtek@indieweb.social
       2023-05-27T12:38:20Z
       
       0 likes, 0 repeats
       
       @tiago I think Perl isn't trying hard enough - we could easily get that figure over 80.