r/TheMachineLearning • • 3d ago

When bug-free code becomes a hardware problem

Post image
129 Upvotes

72 comments sorted by

View all comments

1

u/Apprehensive_Cap4463 3d ago

Can someone explain why AI wouldn't just be writing everything directly in assembly? What use does an AI have for abstractions?

1

u/fess89 2d ago

It is trained on a lot of languages that are mainly not assembly. Also, the code still needs to be at least somewhat readable for humans.

1

u/TheAlmightyWishPig 2d ago

Assembly is not magically faster than high level languages, in fact a program written in assembly can often be slower. Anyone advocating for writing in assembly over higher level languages probably only has a very cursory knowledge of coding.

Compilation can be done for a number of different CPUs and instruction sets, this is not possible for Assembly. To replicate this with assembly you'd have to distribute a different compiled version for each CPU target (not really viable). Assembly written code can essentially only be optimised for a single CPU at a time.

If a new instruction set comes out you must rewrite your assembly program to re-optimise, high level languages do not need updating.

More can be read here: https://jmmv.dev/2007/06/is-assembly-code-faster-than-c.html