Live data from Hacker News

Programming from the Ground Up [pdf]

download-mirror.savannah.gnu.org

21–30 of 56 posts

Re: Programming from the Ground Up [pdf]

#21
post #18

Does it make sense to learn x86 assembly now, or is x64 assembly simpler? All the machines I use are x64 and the binaries I generate are 64-bit. (I realize it's a superset, but I suppose I want to learn the smallest useful subset, since it's a big topic...)

Learn the x86 instructions that are supported in x86-64 and ignore those that aren't. When you need a specific extension, learn it then. For example, I haven't needed to use the AES instructions yet, so I've yet to learn them.

Re: Programming from the Ground Up [pdf]

#22
post #15

Hah, just today I started to read "Haskell programming from first principles"[1] which also targets non-programmers but builds on lambda calculus instead of assembly. Would anyone actually recommend to a beginner to start learn assembly first? [1] http://haskellbook.com/

If you start with assembly I would suggest not picking x86. I would suggest a RISC or virtual assembly like LLVM. x86 just has too much historic weirdness.

Re: Programming from the Ground Up [pdf]

#23
post #12

This is another nice book about x86 assembly: http://www.drpaulcarter.com/pcasm/

One of his two nameservers, ns2.missoulaweb.com (66.235.178.171), is non-responsive. The other one works but it's listed second. No round-robin. That can slow down the DNS lookup, as the first listed nameserver will likely be tried first, adding to the "slowness" of a website.

Dead nameservers are relatively rare among sites that get posted to HN, since many are high traffic and use CDNs (that rely on DNS kludges). But it is still a regular occurrence. No one ever talks about it. But it's one of the DNS kludges that's continually slowing things down behind the scenes.

There is that term "link rot" for URL's that do not work anymore. And "bit rot" for source code. I propose a new one: "NS rot".

Re: Programming from the Ground Up [pdf]

#24
post #2

Top of HN with 4 upvotes and no comments?

Books generally collect lots of upvotes, but few comments, since you generally have to read the book first before commenting. Controversial news articles, whose entire content can be summed up in the headline, collect both upvotes and comments. The ranking algorithm punishes submissions with many comments, to push those submissions off the front page.

Is 4 lots?

Re: Programming from the Ground Up [pdf]

#25
Learning assembly was probably the biggest thing that made computers click in my head. Since then, I've always thought that learning assembly as your first programming language would be a great place to start. Of course, I'm sure this doesn't apply to everyone.

In CS you're usually started off with something like C, Java, or Python. But those languages are so HUGE (in comparison) that it can be really overwhelming. Meanwhile, with assembly, you have far fewer items in your toolbox and you have no abstractions between what you write and what's being executed.

After googling, I found emu8086 [0], which I think is what I used to debug the tiny apps I was writing. It was great! You could step back and forward in time, and you could inspect every detail.

[0] http://www.emu8086.com/

Re: Programming from the Ground Up [pdf]

#26
post #18

Does it make sense to learn x86 assembly now, or is x64 assembly simpler? All the machines I use are x64 and the binaries I generate are 64-bit. (I realize it's a superset, but I suppose I want to learn the smallest useful subset, since it's a big topic...)

Use x64 - the calling convention is simpler and you get more registers. Avoid the exotic instructions.

Re: Programming from the Ground Up [pdf]

#28
I think many of us learned the other way 'round.

(1) Start off by making changes to a program that someone/some book gave us as a basis and blindly stumble through some changes and compiler/interpreter/runtime errors.

(2) Take a step back, absorb what we've learned from the errors.

(3) Read more about the principles of the programming language/OS/API/operating environment.

(4) Internalize concepts behind the language/OS/API/operating environment.

(5) Goto (1).

It's only after many iterations through this process that I can now see similarities among different processors (CPU/DSP/GPU/etc), operating systems, APIs, programming languages. So many classes of problems can be solved effectively without ever understanding these details, so it makes sense for those new programmers not to learn the details at first. IMO, this is at least an intermediate-level text.

Re: Programming from the Ground Up [pdf]

#29

Learning assembly was probably the biggest thing that made computers click in my head. Since then, I've always thought that learning assembly as your first programming language would be a great place to start. Of course, I'm sure this doesn't apply to everyone. In CS you're usually started off with something like C, Java, or Python. But those languages are so HUGE (in comparison) that it can be really overwhelming. M…

I think this is tricky. I was exposed to 8086 assembly having only previously seen a couple flavors of BASIC, and I have to say that it mostly went over my head. It was hard for me to see the bigger picture, the useful functionality that we were painstakingly working toward with our little instructions moving bytes around and taking different paths based on flags. I remember system calls (which are covered early on in the OP) seeming especially confusing and magical. On the other hand, when I dove deeper into (m68k) assembly a few years later, after getting some C and C++ under my belt, it was an amazing eureka moment that made both the earlier assembly exposure and what I had learned of higher level languages click into place. So I do think learning assembly early on is great, but I'm not sure it's such a panacea to learn it first.

Re: Programming from the Ground Up [pdf]

#30

Learning assembly was probably the biggest thing that made computers click in my head. Since then, I've always thought that learning assembly as your first programming language would be a great place to start. Of course, I'm sure this doesn't apply to everyone. In CS you're usually started off with something like C, Java, or Python. But those languages are so HUGE (in comparison) that it can be really overwhelming. M…

I had the same epiphany. For the long time, I regarded computers deeply magical, and didn't understand why some programming languages had the features they had, and some don't. (At the time, I only knew Python and some superficial C.)

Then I read a book that explained how assembly works and how a compiler would implement C's features with assembly. It all clicked since then. Too bad I've forgotten the name of the book.

Post reply on HN