Hacker News new | ask | show | jobs
by jcranmer 3855 days ago
It's interesting that you try to compare simplicity via manual length and say in the same breath that assembly is simple. Assembly language manuals easily dwarf most programming languages: x86-64 is a whopping 3439 pages (of which ~1500 pages is the instruction set reference). And before you say that's just because x86 is unnecessarily complex, ARM is 1138 pages, PowerPC 640 pages. By comparison, the JLS is only about 800 pages, C11 sans library about 450, and C++14 sans library about 500.
2 comments

The bricks are simple but there are many of them. When I say that assembly language is simple I mean exactly that. The language is simple. If you know what one mnemonic does you'll be able to infer the existence and function of a whole bunch of others since they're usually organized around a matrix of operations and locations to be operated on. Of course a manufacturer would document each and every instruction separately but if you understand the logic behind an instruction set then you have a much easier time of it.

The x86 set, well, let's not go there, it's just too painful.

Assembly may not be simple, as in 'very little language'. Assembly can be thousands of different language elements. But assembly is simple as in 'very little variation'. There are maybe a dozen addressing modes. There may be 100 or more instructions. When you multiply them, you get large manuals.

And assembly is simple as in 'primitive'. The atoms of assembler are instructions, and even they may be clustered into only a few groups i.e. arithmetic, branch.

I find the resistance to learning assembler is mostly fear. When debugging I very often resort to assembler display, even for machines that I'm not familiar with. I can learn the gist of it in a few minutes just by looking at a little generated code. And there's nothing like the actual machine instructions to find what really caused an exception.