this post was submitted on 15 Feb 2025
406 points (98.8% liked)

Programmer Humor

33559 readers
190 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] milkisklim@lemm.ee 14 points 6 days ago (3 children)

Well I be damned. What does the Fortran do ?

[–] BartyDeCanter@lemmy.sdf.org 35 points 6 days ago (1 children)

Array operations in FORTRAN are much easier for the compiler heavily optimize than it is in c/c++ due to its array model and type system. You can achieve much of the same thing with modern compiler extensions, but it’s difficult and not as portable.

[–] milkisklim@lemm.ee 7 points 6 days ago

That's interesting, thanks

[–] tetris11@lemmy.ml 14 points 6 days ago (1 children)

Its just easy to write super-optimised code snippets in without having to break out into assembly.

[–] recursiveInsurgent@lemm.ee 4 points 6 days ago (3 children)

What is the reason to avoid assembly? Is it prohibitively difficult?

[–] dewritoninja@pawb.social 10 points 5 days ago

Not only is it very difficult to write in assembly, the resulting code is not portable. Meaning that if you wrote it on x86 assembly it can't run on ARM chips without emulation and that takes a significant hit on performance defeating the point

[–] SqueakyBeaver@lemmy.blahaj.zone 8 points 6 days ago (1 children)

Yeah, it's pretty difficult. Think of assembly as just one step above writing 1's and 0's, and you're probably around how difficult it can be

[–] recursiveInsurgent@lemm.ee 8 points 6 days ago (1 children)

I’ve delved into writing assembly only on the level of a student project. I really enjoyed it though. Obviously implementing a python math library would be far more complex but wouldn’t it be worth it for the possible performance gains?

[–] JackRiddle@sh.itjust.works 10 points 6 days ago

I don't think it would be anymore. Modern compilers are really really good at what they do, and often manually optimizing(writing assembly yourself) makes programs slower. So unless you are very good at assembly, I would just trust the compiler.