8 ms·
Programming from the Ground Up [pdf]
- wskinner 11y agoTop of HN with 4 upvotes and no comments?
- wyldfire 11y agoI don't know the algorithm but it likely gives weight to newness and perhaps a boost for clustered upvotes.
- epalmer 11y agoIt might be because of the strength of luu karam. 45,000+ points.
- cosarara97 11y agoIt won't load here.
- sbierwagen 11y agoPDF version: http://download-mirror.savannah.gnu.org/releases/pgubook/ProgrammingGroundUp-1-0-booksize.pdf http://download-mirror.savannah.gnu.org/releases/pgubook/Pro...
- sbierwagen 11y agoBooks 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.
- xiaoma 11y agoIs 4 lots?
- nickpsecurity 11y agoThat's really weird.
- ilogik 11y agoThe book was mentioned in a previous thread earlier today, about learning assembly
- striking 11y agoIf those upvotes are fast enough, it will have a very high score, and it will shoot straight onto the top of HN. ~(Score) = votes / time Also, people open links, upvote if they like it, and then continue reading (most of the time). That way if their reading is interrupted, they can check their "saved stories" to get back to reading later.
- FlorianMettetal 11y agoWorking Link: http://download-mirror.savannah.gnu.org/releases/pgubook/ProgrammingGroundUp-1-0-booksize.pdf http://download-mirror.savannah.gnu.org/releases/pgubook/Pro...
- dang 11y agoOK, we changed to that from http://savannah.nongnu.org/projects/pgubook/ http://savannah.nongnu.org/projects/pgubook/.
- rashkov 11y agoI've read a few chapters of this and have found it be well written and a great introduction to assembly programming. It was written for 32-bit but so far everything works just fine on my 64 bit linux system. Also it was interesting to learn alongside C. It helped to see the workings of a machine from those two vantage points. Also of note is the author's story of writing the book and giving it away as a labor of love. Very nice
- aap_ 11y agoThis is another nice book about x86 assembly: http://www.drpaulcarter.com/pcasm/ http://www.drpaulcarter.com/pcasm/
- yyin 11y agoOne 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".
- MIKarlsen 11y agoTerrible, terrible information architecture. Love the idea, but it's sooo hard to find your way around that site.
- gwu78 11y agoBlogger.com blogs such as this one ("programminggroundup") can be obtained in a single file containing all posts. Text or minimal HTML file. No gratuitous Javascript and no comment spam. See http://news.ycombinator.com/item?id=6845367 http://news.ycombinator.com/item?id=6845367 Simple, portable shell script. Not perfect, but it still works. ^M means Ctrl-V,Ctrl-M in ed/ex/vi #!/bin/sh # requirements: # netcat # openssl # sed # optional: strings # optional: addcr type strings 2>&1 >/dev/null || strings(){ sed ;} type addcr 2>&1 >/dev/null || addcr(){ sed ;} [ $# -gt 0 ]||exec echo usage: $0 nameofblog { printf "GET / HTTP/1.0\r\n"; printf "Host: $1.blogspot.com\r\n"; printf "Connection: Close\r\n"; printf "\r\n"; } \ |exec nc -vv www.blogger.com 80 \ |exec sed ' s/\\046/\&/g; s/\\46/\&/g; s/\\075/=/g; s/\\75/=/g; /targetBlogID/!d; s/.*targetBlogID=//; s/&.*//; ' |exec sed 1q \ |while read a do { printf "%b" "GET /feeds/$a/posts/default HTTP/1.1\r\n"; printf "Host: www.blogger.com\r\n"; printf "Connection: Close\r\n"; printf "\r\n"; } done \ |openssl s_client -ign_eof -connect \ www.blogger.com:443 -verify 9 \ |exec addcr \ |{ echo sed ' s/</</g; s/>/>/g; s/&/\&/g; s/"/\"/g; 1i\ <br><br> s/<name>/<br><br>name &/g; s/<uri>/<br>uri &/g; s/<generator>/<br>generator &/g; s/Blogger//; s/<id>/<br>id &/g; s/<published>/<br>published &/g; s/<email>/<br>email &/g; s/<title type=.text.>/<br><br>&/g; s/<openSearch:totalResults>/<br>total results &/g; s/<openSearch:startIndex>/<br>start index &/g; s/<openSearch:itemsPerPage>/<br>items per page &/g; s/<updated>/<br>updated &/g; s/<thr:total>/<br>thr:total &/g; s/<\/feed>/&<br><br><br>/; s/^M*/<br>/; ' \ |strings }
- koloron 11y agoHah, 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/ http://haskellbook.com/
- ktRolster 11y ago>Would anyone actually recommend to a beginner to start learn assembly first? Yes, if you can find a good book about it. Assembler isn't particularly difficult, but the information teaching it is rather hard. Right now, the lowest-level language I know of with a really good beginner book is C, and it's this book: http://smile.amazon.com/Absolute-Beginners-Guide-C-2nd/dp/0672305100/ref=sr_1_2?s=books&ie=UTF8&qid=1463344131&sr=1-2&keywords=absolute+beginners+guide+to+c http://smile.amazon.com/Absolute-Beginners-Guide-C-2nd/dp/06...
- deleted 11y ago[deleted]
- matthewwiese 11y agoThe C book you recommended is the exact same one my mum bought for me years ago in late elementary school; I've never seen it mentioned on HN or elsewhere before so I thought I'd also vouch to its effectiveness. Now that I think of it, I should give my mum a call :)
- ktRolster 11y agoYeah, I used to recommend it to students who were struggling. So far everyone I know who's tried it has succeeded. It teaches in a very clear way. I hope my books do too :)
- voltagex_ 11y agoIf you have a Safari subscription: https://www.safaribooksonline.com/library/view/c-programming-absolute/9780133149869/ https://www.safaribooksonline.com/library/view/c-programming...
- chubot 11y agoDoes 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...)
- colejohnson66 11y agoLearn 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.
- MichaelBurge 11y agoUse x64 - the calling convention is simpler and you get more registers. Avoid the exotic instructions.
- spc476 11y agoAnd just accept that half the registers are named (rax, rbx) and the other half are numbered (r8, r9).
- chubot 11y agoCan anyone recommend the best resource for learning x64 then? I did computer architecture and assembly language 15+ years ago in school but haven't really needed to touch assembly language as a professional programmer. So I know the basic idea of registers and addressing modes and pipelines and stuff, but nothing specific to any architecture. My goal is basically to be able to write faster C and C++ programs and analyze constructs like the cost of things like smart pointers, virtual dispatch, templates, etc.
- lorenzhs 11y agoI'd be very interested in such a resource as well. At the moment I'm just staring at the output of 'objdump -S', trying to make sense of things and find what's different between two versions. For smaller things, Matt Godbolt's compiler explorer is very helpful as well. But I'm still having trouble figuring out what exactly is happening and why some things are required, etc.
- TheAceOfHearts 11y agoLearning 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/ http://www.emu8086.com/
- sanderjd 11y agoI 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.
- spc476 11y agoAssembly was my second language (BASIC being my first), but it was not the x86 line I learned first (it was my second assembly language). I can name half a dozen architectures that are probably better for learning than the x86, some of them relevant today. Probably in order: 6502---not my favorite, but tons of material and emulators exist. The most popular 8 bit CPU and one of the most simple ones. 6809---my favorite 8-bit and it lends itself fairly well towards higher level languages. A nice register set (2 8bit general purpose registers, four 16bit index registers) and a regular instruction set makes it easy to program. 8080 (or Z80)---if you are going to start down the dark side of x86 line, it's probably best to start at the beginning. A mess of registers, most of which are somewhat general purpose but each has a specific use. 68000---a very nice 32-bit architecture with enough regularity to make it easy to write compilers for, with enough instructions to make it fun to write assembly code. 8 32bit data registers, 8 32bit index registers. VAX---another nice 32-bit architecture with a very regular instruction set. 16 32bit general purpose registers. MIPS---one of the original RISC architectures that's still in use. Perhaps a bit too spare on instructions. 32 32bit registers. ARM---Kind of reminds me of a RISCish 68000 with unique features that make it, again, fun to program at the assembly level. The x86 line is ... baroque due to its history (you can think of it as an overglorified 8080 that gained power over time, much like the MCP in TRON if you think about it) of ossified layers. It's hard to learn because it's almost all exceptions to a non-regular instruction format.
- amelius 11y agoShouldn't this start by explaining the binary number system? (Now they explain it somewhere near page 180).
- wyldfire 11y agoI 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.
- _nedR 10y agoYet another free book on assembly and computers is The art of assembly language : http://www.plantation-productions.com/Webster/www.artofasm.com/index.html http://www.plantation-productions.com/Webster/www.artofasm.c... This one is quite expansive in coverage of topics.