Live data from Hacker News

Ask HN: What is hand-coded assembly language used for these days?

news.ycombinator.com

41–50 of 60 posts

Re: Ask HN: What is hand-coded assembly language used for these days?

#41
Joshua Block, Chief Java Architect at Google, says in Coders at Work:

"But for the absolute core of the system—the inner loops of the index servers, for instance—very small gains in performance are worth an awful lot. When you have that many machines running the same piece of code, if you can make it even a few percent faster, then you’ve done something that has real benefits, financially and environmentally. So there is some code that you want to write in assembly language."

Re: Ask HN: What is hand-coded assembly language used for these days?

#43
post #27
post #20

Earlier quoted context omitted.

Having read and written assembly on a daily basis for years, I have to disagree entirely. The only simple thing about assembly is that it happens to map to machine code directly, but macros and quasi-instructions even make that iffy. There are so many idiosyncrasies in every ISA, so many ways in which the code you write has side effects. Assembly isn't just complex in practice, it's complex in concept. If you want si…

Try ARM. x86 assembly is ugly and wart ridden. ARM is like a breath of fresh air. Unbelievably well designed.

Stack-based machines are even simpler. Too bad Forth didn't took of.

Re: Ask HN: What is hand-coded assembly language used for these days?

#44
post #27
post #20

Earlier quoted context omitted.

Having read and written assembly on a daily basis for years, I have to disagree entirely. The only simple thing about assembly is that it happens to map to machine code directly, but macros and quasi-instructions even make that iffy. There are so many idiosyncrasies in every ISA, so many ways in which the code you write has side effects. Assembly isn't just complex in practice, it's complex in concept. If you want si…

Try ARM. x86 assembly is ugly and wart ridden. ARM is like a breath of fresh air. Unbelievably well designed.

And amusingly it's possible to write some significant desktop software, just in ARM assembler.

http://www.cconcepts.co.uk/products/publish.htm http://www.cconcepts.co.uk/products/artworks.htm

Although I wouldn't recommend choosing assembler for a destkop app, but it made sense when they were written. And I still think Impression beats many a word processor and DTP package available today, and it ran in 2MB of memory with no hard disc.

Re: Ask HN: What is hand-coded assembly language used for these days?

#45
post #6

Inner loops of graphics algorithms - Picasa, Photoshop, etc.

Yes.

Tangentially related but not quite the same, I work at a company that makes barcode recognition software and some of our most performance-sensitive areas use assembly. It is mostly C, though.

Re: Ask HN: What is hand-coded assembly language used for these days?

#46
post #35
post #33

Earlier quoted context omitted.

People are still playing C&C: RA2?!

Come on, people are playing all kinds of games! I'm sure people still play Master of Magic, a strategic game from 1994. I've been playing it on and off since it came out, and I began to think - is it something wrong with me that I like this old game so much? I mean, surely there must be newer games that are better. I showed it to my teenage brother in the mid 2000's and he loved it too. I had my non-computer-gaming f…

http://www.infocom-if.org/downloads/downloads.html

Re: Ask HN: What is hand-coded assembly language used for these days?

#47
post #32

Going the other way around - can anyone think of an open source project that could benefit from some assembly optimization, and isn't? I'd love an excuse to play with this stuff in a useful fashion. (I love what I do, but my twelve year old self would be disgusted that I'm not writing games.)

video playback and compression is sufficiently cool, and could benefit from optimisation. Have a look to see if any help is needed in the ffmpeg tree at the moment.

Re: Ask HN: What is hand-coded assembly language used for these days?

#48
post #9

Earlier quoted context omitted.

That has more to do with reading assembly than writing it by hand.

There are certainly people who write shellcode. As I understand it, people have written shellcodes that use only bytes that happen to map to ASCII, are obfuscated to bypass intrusion detection systems, and so on. I'm sure it requires quite a bit of (specialized) knowledge.

Well, more like bytecode that doesn't contain a zero-byte, which'd stop a string dead-on.

Re: Ask HN: What is hand-coded assembly language used for these days?

#49
post #29
post #9

Earlier quoted context omitted.

That has more to do with reading assembly than writing it by hand.

Actually, no. If you're dealing with obfuscation, IDS and antivirus evasion etc. you need to know how to read, write and otherwise manipulate assembly code (debug, self-modification, name-it).

First, for dealing with obfuscation and evasion, you're reading, not writing.

Second, for every 100 people that talk about e.g. self-modifying viruses or shellcode, there is perhaps 1 person who can actually write something soup-to-nuts, and maybe 5-10 more who can modify that code to make it do something new.

Reading assembly is important for security research. Writing, not as much.

Re: Ask HN: What is hand-coded assembly language used for these days?

#50
post #38

It's used in bits of kernel programming - often because there is no other way to do the task.

Modern kernels have very little assembly, outside of things like locore. They've heavily abstracted away the things you'd normally write in assembly, like modifying MSRs; also, so much of what you do now is simply memory mapped.

In all of xnu, not counting AES, there are ~17kloc in x86 assembly, most of it in osfmk/i386 --- where no normal developer is ever going to go. There are over 730kloc in C.

Post reply on HN