Live data from Hacker News

Programming from the Ground Up [pdf]

download-mirror.savannah.gnu.org

41–50 of 56 posts

Re: Programming from the Ground Up [pdf]

#41
post #40

Earlier quoted context omitted.

>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/06...

Out of curiosity, have you looked at the 3rd edition? http://www.amazon.com/Programming-Absolute-Beginners-Guide-3...

No, sorry; but I suspect it's just as good.

Re: Programming from the Ground Up [pdf]

#42

Earlier quoted context omitted.

>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/06...

The 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 :)

Yeah, 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 :)

Re: Programming from the Ground Up [pdf]

#43
post #36
post #31

Earlier quoted context omitted.

Assembly 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…

I've been looking to buy "Introduction to 64 Bit Assembly Programming for Linux and OS X: Third Edition - for Linux and OS X". It's an introduction to x84-64 assembly, which I thought makes sense for me to learn, because it is the architecture all my computers use. You say x86 is not a good choice to learn, but this book purports to make assembly for this architecture accessible. If you stand by your opinion, are the…

As a first language, or even as a first assembly language. Once can certainly learn it, and it may even come across as half decent if you skip some of the less used instructions (like LOOP, REP, LODS, STOS, AAD, AAS---basically, the really archaic instructions that aren't really used or optimized). But with nearly 40 years of backwards compatibility, it's a monster of an architecture.

Re: Programming from the Ground Up [pdf]

#44
post #22

Earlier quoted context omitted.

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.

MIPS is a great RISC instruction set to learn and has a ton of good emulators out there too, highly recommended.

definitely this. MIPS is a great start for anyone interested in taking the assembly route at any point.

as for simulators i enjoyed using MARS: http://courses.missouristate.edu/KenVollmar/MARS/

Re: Programming from the Ground Up [pdf]

#45

Terrible, terrible information architecture. Love the idea, but it's sooo hard to find your way around that site.

Blogger.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

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;
   1i\
   

s//

name &/g; s//
uri &/g; s//
generator &/g; s/Blogger//; s//
id &/g; s//
published &/g; s//
email &/g; s//

&/g; s//
total results &/g; s//
start index &/g; s//
items per page &/g; s//
updated &/g; s//
thr:total &/g; s//&


/; s/^M*/
/; ' \ |strings }

Re: Programming from the Ground Up [pdf]

#46
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/

I wouldn't. It's like teaching someone to cook by starting with teaching them chemistry.

Re: Programming from the Ground Up [pdf]

#47
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/

>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/06...

I've used Little Man Computer successfully to teach even very young kids (elementary school age) basics of computer architecture and a very basic assembly language. Some reading materials and a java based LMC simulator here: http://www.yorku.ca/sychen/research/LMC/

Re: Programming from the Ground Up [pdf]

#48
post #34

Earlier quoted context omitted.

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

Can 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 anal…

I'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.

Re: Programming from the Ground Up [pdf]

#49
post #46
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/

I wouldn't. It's like teaching someone to cook by starting with teaching them chemistry.

Right that would be ridiculous! no wait maybe you have something there... Some more Kitchen science might be a good thing.

Re: Programming from the Ground Up [pdf]

#50
post #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.

On the other hand, the x86-64 is a lot nicer and you certainly don't have to go very far to find one to practice with.
Post reply on HN