Live data from Hacker News

The Art of 64-bit Assembly

nostarch.com

51–60 of 122 posts

Re: The Art of 64-bit Assembly

#51

Earlier quoted context omitted.

an LLM can easily code it without errors can't tell if sarcasm or not. Just in case it's not.. in that case why don't we all vibe everything in assembly? No need for abstractions anymore since that's a human concept. LLM can do it without errors, as you say, and we'll reap the benefits of speed!

Because it's not portable. The world we find ourselves in is at least x86 and ARM, and assembly for one isn't good for the other. LLVM has a hardware agnostic intermediate representation (IR) that one could use though.

you're not thinking vibe enough. Your prompts are now the program, that's your abstraction. Ideally, if it would work, LLM would be the one then producing each platform's output. Maybe even compiling from higher languages to gather some compiler optimization hints and then doing full salvo of asm. Ideally.

Re: The Art of 64-bit Assembly

#52

Earlier quoted context omitted.

an LLM can easily code it without errors can't tell if sarcasm or not. Just in case it's not.. in that case why don't we all vibe everything in assembly? No need for abstractions anymore since that's a human concept. LLM can do it without errors, as you say, and we'll reap the benefits of speed!

Except for some odd corner cases, it is very hard for a good engineer to beat compilers these days (they are very good now). Not to mention, tuning depends on the platform, and often the exact model of chip.

* it is very hard for a good engineer to beat compilers these days (they are very good now).*

I keep hearing this for the last 20 odd years, yet I see evidence to the contrary each and every day. It is hard and honest work though.

Re: The Art of 64-bit Assembly

#53

i'm sorry, starting with "you can ask AI to … [but it'll do an incomplete and bad job]" and then launching forth into a hundred words of AI-produced text is not very appetizing i hope this is the publisher's fault and the author replaces it with something decent of their own. contrary to the opinions i've heard around (including elsewhere on this thread) learning asm is still meaningful today and it's something i'd l…

This text doesn’t seem AI generated to me.

Re: The Art of 64-bit Assembly

#54
post #6

Is anyone still writing assembly in the age of LLMs? Asking seriously because most assembly is just doing one very simple thing very fast and because it's so simple conceptually, an LLM can easily code it without errors.

I wrote a lisp compiler recently, and that involved generating assembly language.

My output is linux/amd64 assembly language which is compiled by nasm. I don't link to glibc, so I had to implement my "print int", "print string", and similar primitives in raw assembly.

I successfully implemented a stop&copy garbage collector, and other interfaces to the OS such as reading command-line arguments, environmental variables, and so on. All in assembly. Though my compiler is written in golang the runtime, and all supporting functions have to be in assembly to make sure that the binaries it produced are static.

(I wrote a lisp interpreter which can be compiled, and which can be used to run itself, so I got an indirect REPL.)

Re: The Art of 64-bit Assembly

#55
post #6

Is anyone still writing assembly in the age of LLMs? Asking seriously because most assembly is just doing one very simple thing very fast and because it's so simple conceptually, an LLM can easily code it without errors.

[deleted]

Re: The Art of 64-bit Assembly

#56
post #6

Is anyone still writing assembly in the age of LLMs? Asking seriously because most assembly is just doing one very simple thing very fast and because it's so simple conceptually, an LLM can easily code it without errors.

>> an LLM can easily code it without errors.

An LLM knowns nothing of the taste of ginger.

Re: The Art of 64-bit Assembly

#57
post #19

Weird title for a book on assembly - for x64 - on Windows - using MASM There are other 64-bit OSes, CPUs and assemblers for them, and people do use them.

If you're actually writing software in assembly (as opposed to merely optimizing hot functions in an otherwise high-level codebase), in my experience MASM is the most pleasant tool for the job.

Re: The Art of 64-bit Assembly

#58
post #53

i'm sorry, starting with "you can ask AI to … [but it'll do an incomplete and bad job]" and then launching forth into a hundred words of AI-produced text is not very appetizing i hope this is the publisher's fault and the author replaces it with something decent of their own. contrary to the opinions i've heard around (including elsewhere on this thread) learning asm is still meaningful today and it's something i'd l…

This text doesn’t seem AI generated to me.

We've really gotten to the point that certain styles seem AI generated in many cases because many folks are poor writers and anything past a high school level is difficult for them. I'm not speaking in this case specifically, just in general.

It's also one of the reasons its insanely popular in ESL countries and frustrating/disliked in English-speaking countries because it makes things easier in one and harder in the other.

It was never the goal, but it is the reality. The same style people call AI, was often called being a pedant or being wordy 10 years ago.

Re: The Art of 64-bit Assembly

#59
post #6

Is anyone still writing assembly in the age of LLMs? Asking seriously because most assembly is just doing one very simple thing very fast and because it's so simple conceptually, an LLM can easily code it without errors.

Yep. In my experience, LLMs easily go in circles with even simple assembly, creating fixes that result in 2x slower code and then fixing those with even slower code. They are pretty great as a reference or finding needle in the haystack bugs though!

Is that with or without the LLM being able to assemble + profile its hypotheses itself? Because “optimize this code to execute in fewer CPU cycles under the test harness” seems like one of those perfect self-contained problems for LLMs (their equivalent of an “embarrassingly parallel problem”: an “embarrassingly-easily-explored solution space with embarrassingly-easily-measured objective success criteria.”)

Sure, they might make all sorts of dumb hypotheses at first, but as long as the results of those stay in their context, they do seem to eventually “run out of ways to be stupid.” (Which is to say, LLMs seem to experience in-context learning even via self-directed trial-and-error, if given a sufficiently-large number of iterations and no way to cheat.)

Post reply on HN