Live data from Hacker News

Paint16b: A 16 byte paint program written in 12 lines

sizecoding.org

21–30 of 70 posts

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

#21
post #18

Earlier quoted context omitted.

https://xkcd.com/1053/

This applies to general public but someone with Freelance Web developer based in Amsterdam. Mostly Node and React. in their bio should probably know what Assembly is...

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!

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

#22
post #18

Earlier quoted context omitted.

https://xkcd.com/1053/

This applies to general public but someone with Freelance Web developer based in Amsterdam. Mostly Node and React. in their bio should probably know what Assembly is...

Should they? Why?

Look, I wrote assembly when I was a teen, went to school for CS twice and can't do squat with it today. I know it is ASM but beyond that it's not that interesting or exciting to me.

This person's job is strictly to build frontend web apps. Knowledge of assembly is largely ornamental to that pursuit. I'm not even sure someone getting as BSCS and MSCS would spend enough time with it to care.

It's important, critically so for some people, but I wouldn't ding a job applicant for a node job for not recognizing it.

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

#23
post #15
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.

I admit my experience is limited, but there are few things that should immediately identify some code as assembly to someone with previous experience, regardless of the platform, such as the prevalence of the "mov" command, a "jump" command or the use of registers, using memory addresses as parameters, accssing stack using "push" and "pop" commands. Registers might have different names depending on the platform, actu…

I suppose my gp wasn't very clear. Language in this context could be just ASM or it could be intel x86 DOS ASM. As I said, the gp could be a master of 6502 ASM, but not be able to tell the difference between ARM and X86.

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

#24
post #8

And if you liked that http://www.hugi.scene.org/compo/compoold.htm And something I found useful https://www.muppetlabs.com/~breadbox/software/tiny/teensy.ht... It really is quite amazing how small you can make things when you try. Then you realise you're wasting most of a disc sector, and the thing you have is unportable and unmaintainable. But still, being able to look at a binary and know what every byte does, bein…

Thanks ! Is there anything about Tetris like game ?

I found this : https://developers.slashdot.org/story/12/02/19/1351213/tetri... but it's in Javascript.

A long time ago I wrote this : https://github.com/dalf/stetris/blob/master/STETRIS-UTF8.ASM

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

#25
post #18

Earlier quoted context omitted.

This applies to general public but someone with Freelance Web developer based in Amsterdam. Mostly Node and React. in their bio should probably know what Assembly is...

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!

Really? A programmer of any stripe who doesn't recognize assembly just seems like a very wrong thing. One wonders what their mental model of the computer is like.

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

#26
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…

If IT person doesn't know even the general looks of assembly code then something is wrong with the education. For non-IT that's another topic

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

#28
All the program has to do is repeatedly get the current mouse position and set the pixel there, and that's all it does. These two links should help make sense of it:

http://stanislavs.org/helppc/int_33.html

http://stanislavs.org/helppc/int_10.html

The main loop contains an implicit state-machine that does multiple things on different iterations, which is partly responsible for the small size.

Another thing that you can clearly see is how efficient it is at using the registers; this is one area where compiler-generated code is consistently behind, and something I wish compilers would get better at --- an HLL could take as many bytes as this entire program just to put the parameters onto the stack and call a function.

Finally, one small correction:

    ret             ; assume [[FFEE]] = [0] = CD20 = int 20
...should be "assume [FFFE] = 0", because that's where the stack pointer is initially, and this program does not use the stack itself for its entirety --- it doesn't need to!

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

#29
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.

Not if it is your first time seeing assembly.

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

#30
pretty cool, but why not have it a tiny tiny bit longer code and not strt with 2 flat out assumptions? I mean im not familiar with dos deeply and if these will be true 100% of the time, but as it reads, it reads like silly code which might crash or work unexpectedly in certain situations.

either way cool! :D

Post reply on HN