Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I know that feeling. My undergrad CS course had a rigorous electronics component where we coded in ASM for the 8086. One of my fondest moments of that time was when I wrote a program that would split the terminal screen into two halves of different color, and display what you typed on one side and the inverse case on the other.

This could probably be done with less than 50 lines in python, but doing it in assembly, calling all those interrupt routines, making sure your registers contained all the right values, man, when it finally worked, it was the greatest feeling in the world!



Wasn't it? And for that moment, you could look out and imagine "Damn, I could code the whole freaking thing like this!"

Then you realize it would take around 30 years, but still -- it was doable. You finally figured out how it all worked. You could make the computer do anything it was capable of doing. There was no more mystery there.

Fun stuff.


Do you really think it would take 30 years? The NAND-To-Tetris kids do most of it in a semester, and they're starting at the level of individual gates.

I mean, Chuck Moore has been doing it for about 30 years, but he had a working top-to-bottom system after less than five years.

Here's what I think it would look like:

Week 0: build a working interactive Forth system that can compile itself, in machine code. This is assuming you already have hardware and a way to boot it into some code you wrote. If not, that could be a matter of minutes or of months.

Weeks 1-3: build an interactive high-level language interpreter on top of it. Say, JS.

Week 4: enough of TCP/IP to do HTTP GET.

Week 5: write a bitmap font editor and a minimal filesystem.

Weeks 6-8: parse HTML (more or less), lay it out with a simplified box model, and draw it to pixels on a canvas, using a pixel font.

Week 9: cookies, HTTP POST, XMLHttpRequest.

Week 10: a more elaborate filesystem, maybe based on Git.

Weeks 11-12: some more HTML5 features, maybe including WebGL.

Weeks 13-14: TLS.

This is sort of cheating because you're taking advantage of our previous 70 years of experience to figure out what's worth building, and you're likely to end up spending a fair bit of time going back and retrofitting stuff onto previous iterations — JIT compilation, say, and multitasking — but it still seems like rebuilding the personal computing environment ought to be more like a one-semester project than a 30-year project.

You could argue that you get a huge speedup by not writing stuff in assembly, and I agree, but I think that's only a constant factor. You could easily write assembly code that maps directly onto JS semantics:

        ;;; invoke getContext("2d") on the canvas object
        .data
    sgetContext: .asciz "getContext"
    s2d: .asciz "2d"
        .text
        mov $sgetContext, %eax
        call GetProp
        mov $s2d, %edx
        call InvokeMethod
That's more code to write and read, but only by a linear factor. So it might take you two semesters, or four, but not 60.


I, too, know that feel bro.

At 12 I had learned how to program, in Z80 assembly, a routine to output to the graphics card of my dad's ancient-even-then Radio Shack model 16. I created a custom font that looked like the beautiful VGA font and used it to render 16-bit numbers in gorgeous decimal digits.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: