Live data from Hacker News

Paint16b: A 16 byte paint program written in 12 lines

sizecoding.org

61–70 of 70 posts

Re: Paint16b: A 16 byte paint program written in 12 lines

#61

Earlier quoted context omitted.

I don’t think everyone who writes code needs to know how to write assembly, but I think it’s important to know that it exists and possibly what it looks like. Maybe not while you’re still learning to code, but once you’ve actually started working in the industry it’s a good thing to know, if only because it gives you a bit of context of how computers actually work.

1) No, you only need to know about assembly language if you go for deep microoptimizations. 2) Assembly is vastly more high level than modern hardware, so much that most of those CISC instructors are broken into tens to thousands micro operations. It's not even close to any kind of machine architecture course. You will need that kind of deep knowledge to write optimal compilers which probably take (extended) C and no…

Assembly (well, machine code if you want to nitpick) is still the representation of a program right at the interface between software and hardware. It's the processor's native API, no matter how many layers of additional abstraction behind that API. So it's a pretty important level of abstraction if you want to have a reasonable high-level idea of how a computer works.

Re: Paint16b: A 16 byte paint program written in 12 lines

#62
post #6
post #4

Earlier quoted context omitted.

Is assembly not common knowledge anymore?

It's interesting how many people would not recognize assembly language if shown a sample. In a way that is a statement as to how far compilers have come, that it is possible to produce perfectly good software that runs fast enough that only a limited number of people still has to know about the details of the underlying processor. And in the case of interpreted languages or JIT'd languages the lines get blurred a bit…

Now I'm wondering if there are frontend devs who don't know where the name "WebAssembly" comes from...

Re: Paint16b: A 16 byte paint program written in 12 lines

#63
post #2

Be helpful if the page mentioned what language the program was written in.

It's obvious in the context of that wiki. From the front page:

> SizeCoding.org is a wiki dedicated to the art of creating very tiny programs for the 80x86 family of CPUs. By "very tiny programs", we mean programs that are 256 bytes or less in size, typically created by members of the demoscene as a show of programming skill. The size of these tiny programs is measured by their total size in opcode bytes, and are usually presented as executable .COM files to be run in pure DOS, a DOS VM running inside another operating system, or an emulator that can run DOS such as DOSBox.

Re: Paint16b: A 16 byte paint program written in 12 lines

#64

Earlier quoted context omitted.

Why? Serious question. Nothing about that bio says “this person should know about the existence of assembly” to me. And besides, with their question they’ve made an effort to learn about it so I don’t see any reason to criticize them for not knowing. It’s like the xkcd referenced says, every day there are a bunch of people hearing about something for the first time. We should be happy that they hear about it!

We have web pages with multiple seconds of latency because devs don't have a deep understanding of the performance hits of composing programs. And for that you need to understand how the CPU works.

ASM is fairly useless knowledge for that problem, unless you go in the deep weeds of internals of your JS interpreter.

Re: Paint16b: A 16 byte paint program written in 12 lines

#65

Not to poo-poo this (I think this is very impressive) but the reason why it is so small is that it just calls a bunch of bios and mouse driver routines. If those items didn’t already exist the program would surely be larger.

Not unique to Wintel, or this program. That's the reason programs were so small for the original Macintosh. Most of the essential routines, especially Quicktime, were in ROM.

(I think you mean QuickDraw.) Yes, and the ROM itself was only 64kb of hand-written assembly, using a variety of techniques to cram in all that functionality, like sharing function prologues and epilogues.

Re: Paint16b: A 16 byte paint program written in 12 lines

#66

Earlier quoted context omitted.

There is a significant portion of developers ( particular web and app ) and IT staff who never studied computer science in college but instead moved into programming/IT mid career. Most of them probably never heard of or seen assembly code. However, I would be shocked if anyone who went through a CS program wasn't aware of assembly programming.

CS tends to be algorithms not low level programming. Unlike say robotics or electronics.

CS usually includes classes on compilers, at least that's where I learnt some assembly

Re: Paint16b: A 16 byte paint program written in 12 lines

#67
post #65

Earlier quoted context omitted.

Not unique to Wintel, or this program. That's the reason programs were so small for the original Macintosh. Most of the essential routines, especially Quicktime, were in ROM.

(I think you mean QuickDraw.) Yes, and the ROM itself was only 64kb of hand-written assembly, using a variety of techniques to cram in all that functionality, like sharing function prologues and epilogues.

Yep. QuickDraw. Been too long.

Re: Paint16b: A 16 byte paint program written in 12 lines

#69

Earlier quoted context omitted.

lots of 'programmers' don't even know what a debugger or a cpu is xD let's not talk about common knowledge in 2018 please its depressing :D

Last week I had to explain to an IT guy what a tractor feed printer is. He'd never heard of "tractor feed."

ASM is arguably not obsolete technology, while tractor feed pretty clearly is.

Re: Paint16b: A 16 byte paint program written in 12 lines

#70
post #11
post #9

Earlier quoted context omitted.

In the parents defense 'assembly' isn't one thing. Every assembler has a different syntax, as does every chip family. The parent might be a master of 6502 ASM. And as that XKCD comic says. Everyone has to learn even the most obvious thing for the first time at some point.

Hm... If you know one assembly you can easily recognize when it is assembly, even if you don't know the specific architecture.

I'm the worst type of bootcamp web developer you can imagine.

I only knew it was Assembly because i once looked at the apollo guidance computer's source code.

Post reply on HN