TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Do people still program in machine code?

10 点作者 solipsist将近 14 年前
"<i>Looking at a program written in machine language is vaguely comparable to looking at a DNA molecule atom by atom.</i>" - Douglas Hofstadter<p>I am curious if there still are a few, select number of people who write machine code for a living. Is there a need for machine code, or even assembly code, to be written when new pieces of hardware come out?<p>And also, does anyone here on HN have experience with machine or assembly code?

10 条评论

mcpherrinm将近 14 年前
In the open source community, there's certainly a bunch. The FFMPEG h.264 decoder consists of big chunks of assembly. WebM will require more to be written as it becomes production-quality in various decoders. JIT for Javascript is causing the browser developers to be working on low-level code, but of course that's very contained. LLVM is another project that gets a lot of attention that involves assembly programming.<p>I just spent some time writing ARM assembly for some operating-system type things. The rise of ARM is causing some work to has to happen here, as a lot of legacy x86-only stuff will need to be replaced.<p>All the low-level stuff still has to happen, but there's very little happening in the startup-type crowd that tends to be around HackerNews. The only startup that I can think of offhand that would require that low-level type code is inPulse, <a href="http://getinpulse.com/" rel="nofollow">http://getinpulse.com/</a> but I'm sure there's more around.
hoodoof将近 14 年前
I believe assembly language programming is pretty common in embedded systems programming and for some performance critical parts of games programming.<p>MenuetOS is entirely written in assembly language <a href="http://www.menuetos.net/" rel="nofollow">http://www.menuetos.net/</a><p>I haven't done any assembly language programming but I enjoy reading about it because it's good to understand what a computer does down deep.<p>Jeff Duntemann's Assembly Language Step-by-step: Programming with DOS and Linux <a href="http://www.amazon.com/Assembly-Language-Step-step-Programming/dp/0471375233" rel="nofollow">http://www.amazon.com/Assembly-Language-Step-step-Programmin...</a> is a great book.
zwieback将近 14 年前
Haven't done machine code since my Apple ][ days. Assembly, however is still heavily used in embedded systems. Most commonly in boot code and interrupt handlers. Handcrafting inner loops for DSP applications is also still common.<p>The percentage of assembly in my projects is typically very small, I'm sure it's way less than 1% in my case.<p>Another area where assembly is still common is around specialized HW features, e.g. putting the processor into low power modes or other situations where specific instructions have to be issued in a specific order.<p>For speed optimisation more often than not I start out with the output of the C compiler to see where I can optimize.
fbnt将近 14 年前
Instruction List (IL) on PLC &#38; other microcontrollers is widely used in automatic controls, My engneering course had some odd classes of PLC assembly-like programming (and some 8086 and useless PXA assembly, a 1st gen. PocketPC processor, aswell)<p>Anyway, writing machine code from scratch might still be readable, looking at compiler-generated code could be really complicated, as lots of redundant information is added.<p>I remember dealing with x86 assembly only when.. ermm.., 'bypassing' some software restrictons. It's amazing how much money a single JMP instruction, surgically replaced in an executable file, can save you :)
drallison将近 14 年前
Yes, of course. There are problems or portions of problems where direct hands-on control of the bare metal gives better performance, sometimes spectacularly better performance. Programming in assembly language for this kind of problem is often simpler than trying to make a compiler do what's needed. As the size and complexity of the problem grows, the structuring and abstraction support of programming languages provide win out.<p>And, of course, the last refuge of the assembly language programmer is the optimization and code generation phases of a compiler where reasoning about programs at a very low level pays off.
cerebrum将近 14 年前
LuaJIT is done in assembly and the author explains why:<p><a href="http://article.gmane.org/gmane.comp.lang.lua.general/75426" rel="nofollow">http://article.gmane.org/gmane.comp.lang.lua.general/75426</a><p>Source(reddit): <a href="http://www.reddit.com/r/programming/comments/hkzg8/author_of_luajit_explains_why_compilers_cant_beat/" rel="nofollow">http://www.reddit.com/r/programming/comments/hkzg8/author_of...</a>
diminium将近 14 年前
Let me see. The last biggest commonly used software project I remember (desktop software, not embedded and industrial stuff) that was programmed in assembly was this game<p><a href="http://en.wikipedia.org/wiki/RollerCoaster_Tycoon" rel="nofollow">http://en.wikipedia.org/wiki/RollerCoaster_Tycoon</a><p>Now, that's one level above machine code but you get the idea.
walrus将近 14 年前
Some smaller microcontrollers don't have any RAM, so C doesn't work too well with them.<p>For example: <a href="http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_tinyavr_c" rel="nofollow">http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_tiny...</a>
veyron将近 14 年前
Assembly code is used frequently in ultra low latency trading and in other contexts for which special instructions are not exposed in C libraries or constructs. For example, there is no libc exposure to the RDTSC x86 instruction
winkv将近 14 年前
yes,especially in area of digital signal processing,people still write the code in assembly and get paid for it.though there aren't many.its a low demand low supply area.