www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - D and Programming Theory (Suggestions?)

reply Louis <lscarrozzi hotmail.com> writes:
Dear Friends,

Here is the QUESTION:

Does anyone know of any good books that talk about how computers work
abstractly enough to be a solid cross language foundation?

To put this question another way, I REALLY want to actually understand "The D
Programming Language" by Andrei Alexandrescu.  I understand enough of it to be
really excited about D, but not enough to start really programming with it.

EXPLANATION:

I'm new to systems language programming, although I have attempted to
self-learn C++ a few times.

I had been looking over C, C++ and C#, and there is a tremendous amount of
information about those languages available, but on a whim I decided to search
and see if there was actually a "D" programming language.

Not only did I find "D", but I also found out that it's a relatively new
language, and it appears to be cutting edge.  From what little knowledge I
have about C++ programming, I can already see some serious advantages of
putting time and effort into learning D because I think in the long run, it
will be worth the effort.  Not to mention that "D" appears to have "fixed"
some really complex, and potentially dangerous issues with C++ - issues that
are over my head at the moment - but clearly stated enough that even a noob
like me can see some ugly problems coming at me with C++ over the long haul.
(Yes, I have crashed windows with bad C++ before).

I bought "The D Programming Language" and have been fascinated by it even
though a lot of it is way over my head.

As I am pouring over my C++ books and my D book it has become painfully
obvious to me that while the syntax of language(s) are unique and important,
what is far more important is understanding the computer theories underlying
the code.  Things like understanding linear programming, OOP, functional
programming etc.  Also, things like understanding how a computer works
internally and how that relates to language (and compilation...).

I have made the mistake of trying to understand how a language works through
learning its syntax as defining function rather than understanding how
function dictates syntax.  With a new language like D with few books written
on it (actually 2 as far as I can see) it's difficult for a newcomer like me
just to jump in.

There is no "Beginning D" or "D For Dummies" yet.

I'm a quick study if I can find a few good books, and that's what I am looking
for.

Thanks!
Oct 12 2011
next sibling parent Justin Whear <justin economicmodeling.com> writes:
Here's a classic: 
http://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs

A video series by the authors (from the 80s I believe) was recently made 
freely available and I found it really fascinating though I was already 
familiar with the content. Highly recommended: 
http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/

The use of Lisp might be turn-off for you, but pretty much everything is of 
use in making you a better programmer. Also, some of the later videos get 
into issues like compilation, register machines, etc. which will give you 
some insight into how programming languages make computers work.

Justin


Louis wrote:

 Dear Friends,
 
 Here is the QUESTION:
 
 Does anyone know of any good books that talk about how computers work
 abstractly enough to be a solid cross language foundation?
 
 To put this question another way, I REALLY want to actually understand
 "The D
 Programming Language" by Andrei Alexandrescu.  I understand enough of it
 to be really excited about D, but not enough to start really programming
 with it.
 
 EXPLANATION:
 
 I'm new to systems language programming, although I have attempted to
 self-learn C++ a few times.
 
 I had been looking over C, C++ and C#, and there is a tremendous amount of
 information about those languages available, but on a whim I decided to
 search and see if there was actually a "D" programming language.
 
 Not only did I find "D", but I also found out that it's a relatively new
 language, and it appears to be cutting edge.  From what little knowledge I
 have about C++ programming, I can already see some serious advantages of
 putting time and effort into learning D because I think in the long run,
 it
 will be worth the effort.  Not to mention that "D" appears to have "fixed"
 some really complex, and potentially dangerous issues with C++ - issues
 that are over my head at the moment - but clearly stated enough that even
 a noob like me can see some ugly problems coming at me with C++ over the
 long haul. (Yes, I have crashed windows with bad C++ before).
 
 I bought "The D Programming Language" and have been fascinated by it even
 though a lot of it is way over my head.
 
 As I am pouring over my C++ books and my D book it has become painfully
 obvious to me that while the syntax of language(s) are unique and
 important, what is far more important is understanding the computer
 theories underlying
 the code.  Things like understanding linear programming, OOP, functional
 programming etc.  Also, things like understanding how a computer works
 internally and how that relates to language (and compilation...).
 
 I have made the mistake of trying to understand how a language works
 through learning its syntax as defining function rather than understanding
 how
 function dictates syntax.  With a new language like D with few books
 written on it (actually 2 as far as I can see) it's difficult for a
 newcomer like me just to jump in.
 
 There is no "Beginning D" or "D For Dummies" yet.
 
 I'm a quick study if I can find a few good books, and that's what I am
 looking for.
 
 Thanks!

Oct 12 2011
prev sibling next sibling parent maarten van damme <maartenvd1994 gmail.com> writes:
--001485f1bdc4fd7f1604af20ad19
Content-Type: text/plain; charset=ISO-8859-1

I've started in java with the book "java for students" at the age of 13, it
was a very well-written book and easy to understand so I bought another book
from that author "vb.net for students". fascinated by one of the last
chapters which went 'under the hood' I searched some more about compilation
and stuff.
I then stumbled on a site which tried to explain how to make a language
(simple lexer using antlr and interpreter) but didn't got further then a
half-working lexer.

Then I went into reverse engineering and doing some crackme's (easy ones).
trying them out gave me a better understanding how compilation really works.
After I've plunged in the world of game-hacking I really understood how most
stuff works internally, what buffer overflows are,... .

This is of course only a tip of the iceberg but it's enough for me (for
now). My advice: if you really want to know how programs work 'under the
hood' then go and read a bit about reverse engineering, you'll know a lot in
short time (but it's not easy). but if you don't then it's also fine as
everything will come with time. read one chapter at a time and try to
understand everything before moving on. Practice enough or you'll simply
forget. You have time, use it :). make notes!

Mind you that this is only my opinion and I'm also learning and could be
terribly wrong in my approach :p.

--001485f1bdc4fd7f1604af20ad19
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I&#39;ve started in java with the book &quot;java for students&quot; at the=
 age of 13, it was a very well-written book and easy to understand so I bou=
ght another book from that author &quot;<a href=3D"http://vb.net">vb.net</a=
 for students&quot;. fascinated by one of the last chapters which went &#3=


mple lexer using antlr and interpreter) but didn&#39;t got further then a h= alf-working lexer.</div><div><br></div><div>Then I went into reverse engine= ering and doing some crackme&#39;s (easy ones).</div> <div>trying them out gave me a better understanding how compilation really = works. After I&#39;ve plunged in the world of game-hacking I really underst= ood how most stuff works internally, what buffer overflows are,... .</div> <div><br></div><div>This is of course only a tip of the iceberg but it&#39;= s enough for me (for now). My advice: if you really want to know how progra= ms work &#39;under the hood&#39; then go and read a bit about reverse engin= eering, you&#39;ll know a lot in short time (but it&#39;s not easy). but if= you don&#39;t then it&#39;s also fine as everything will come with time. r= ead one chapter at a time and try to understand everything before moving on= . Practice enough or you&#39;ll simply forget. You have time, use it :). ma= ke notes!</div> <div><br></div><div>Mind you that this is only my opinion and I&#39;m also = learning and could be terribly wrong in my approach :p.</div> --001485f1bdc4fd7f1604af20ad19--
Oct 12 2011
prev sibling next sibling parent Brad Roberts <braddr puremagic.com> writes:
One really good book I read ages ago that takes the magic away from c++ 
and talks about how it's translated into an underlying implementation is 
"Inside the C++ Object Model" by Stanley Lippman.  While it's written with 
c++ in mind, it's details can be abstracted to just about any object 
oriented language.  Unfortunatly it doesn't get into some of the 
interesting (to me) lower level details like function prolog/epilogs, 
argument passing, etc.  Those details vary quite a bit between platforms 
(both os and cpus) since they're among the lowest level details.

Another good book that talks about how applications go from bits on disk 
to running in memory is "Linkers and Loaders" by John Levine.

Neither of those really get into the guts of how computers work.  I'll 
leave that one for Walter to point you to.. I'm sure he's got a favorite 
'how x86 works from the inside out' kind of book.

If you're particularly interested in the HOW part of how they work, some 
digital logic classes plus a cpu architecture class would fit the bill 
nicely.  The latter was one of my favorite college courses... designing on 
paper a simple cpu (address decoders, alu, registers, etc).

None of these topics are really 'for dummies' though.  I highly suggest 
gaining some level of comfort working at the high level of writing code 
before diving deep into the how it works parts.  Starting at the bottom 
could well mean you never get to the point of writing code out of sheer
enormity of the details.

Later,
Brad

On Wed, 12 Oct 2011, Louis wrote:

 Dear Friends,
 
 Here is the QUESTION:
 
 Does anyone know of any good books that talk about how computers work
 abstractly enough to be a solid cross language foundation?
 
 To put this question another way, I REALLY want to actually understand "The D
 Programming Language" by Andrei Alexandrescu.  I understand enough of it to be
 really excited about D, but not enough to start really programming with it.
 
 EXPLANATION:
 
 I'm new to systems language programming, although I have attempted to
 self-learn C++ a few times.
 
 I had been looking over C, C++ and C#, and there is a tremendous amount of
 information about those languages available, but on a whim I decided to search
 and see if there was actually a "D" programming language.
 
 Not only did I find "D", but I also found out that it's a relatively new
 language, and it appears to be cutting edge.  From what little knowledge I
 have about C++ programming, I can already see some serious advantages of
 putting time and effort into learning D because I think in the long run, it
 will be worth the effort.  Not to mention that "D" appears to have "fixed"
 some really complex, and potentially dangerous issues with C++ - issues that
 are over my head at the moment - but clearly stated enough that even a noob
 like me can see some ugly problems coming at me with C++ over the long haul.
 (Yes, I have crashed windows with bad C++ before).
 
 I bought "The D Programming Language" and have been fascinated by it even
 though a lot of it is way over my head.
 
 As I am pouring over my C++ books and my D book it has become painfully
 obvious to me that while the syntax of language(s) are unique and important,
 what is far more important is understanding the computer theories underlying
 the code.  Things like understanding linear programming, OOP, functional
 programming etc.  Also, things like understanding how a computer works
 internally and how that relates to language (and compilation...).
 
 I have made the mistake of trying to understand how a language works through
 learning its syntax as defining function rather than understanding how
 function dictates syntax.  With a new language like D with few books written
 on it (actually 2 as far as I can see) it's difficult for a newcomer like me
 just to jump in.
 
 There is no "Beginning D" or "D For Dummies" yet.
 
 I'm a quick study if I can find a few good books, and that's what I am looking
 for.
 
 Thanks!
 
 
 

Oct 12 2011
prev sibling parent reply Ali =?iso-8859-1?q?=C7ehreli?= <acehreli yahoo.com> writes:
On Wed, 12 Oct 2011 21:10:00 +0000, Louis wrote:

 Does anyone know of any good books that talk about how computers work
 abstractly enough to be a solid cross language foundation?

 There is no "Beginning D" or "D For Dummies" yet.

There is a Turkish D book that targets programming novices: http://ddili.org/ders/d/index.html It starts with the basic concepts and and ends with Parallelization, Concurrency, Manual Memory Management, etc. Unfortunately, it doesn't go into programming theory or how computers work. It must be seen as some information from a craftsperson to new craftspeople. I am in the process of translating that book to English. This is the first time that I am giving a link to a very draft current state of the English translation: http://ddili.org/ders/d.en/index.html Contrary to what that page may makes one think, the Exceptions chapter has a draft translation as well: http://ddili.org/ders/d.en/exceptions.html And finally the Ranges chapter is a work in progress: http://ddili.org/ders/d.en/ranges.html All of the above is a draft and I haven't "announced" the English version yet. Not even here! :) I have to go over the chapters at least five more times to make many corrections. Although, since it's a translation, I don't think I will change the content much. Enjoy! Ali
Oct 12 2011
parent Granville Barnett <granville gbarnett.org> writes:
On 13/10/2011 06:25, Ali Çehreli wrote:
 On Wed, 12 Oct 2011 21:10:00 +0000, Louis wrote:

 Does anyone know of any good books that talk about how computers work
 abstractly enough to be a solid cross language foundation?

 There is no "Beginning D" or "D For Dummies" yet.

There is a Turkish D book that targets programming novices: http://ddili.org/ders/d/index.html It starts with the basic concepts and and ends with Parallelization, Concurrency, Manual Memory Management, etc. Unfortunately, it doesn't go into programming theory or how computers work. It must be seen as some information from a craftsperson to new craftspeople. I am in the process of translating that book to English. This is the first time that I am giving a link to a very draft current state of the English translation: http://ddili.org/ders/d.en/index.html Contrary to what that page may makes one think, the Exceptions chapter has a draft translation as well: http://ddili.org/ders/d.en/exceptions.html And finally the Ranges chapter is a work in progress: http://ddili.org/ders/d.en/ranges.html All of the above is a draft and I haven't "announced" the English version yet. Not even here! :) I have to go over the chapters at least five more times to make many corrections. Although, since it's a translation, I don't think I will change the content much. Enjoy! Ali

There are actually quite a few books that may help you...some more formal than others. For low-level application of ideas you might want to check out SSCLI Internals which uses the Rotor open source runtime as its running example - http://blogs.tedneward.com/2009/05/27/SSCLI+20+Internals.aspx. The material isn't "advanced" but obviously it will help if you can get a grounding in the model of how things are laid out first. For formal language theory there are many books: - Theories of Programming Languages (http://www.cs.cmu.edu/~jcr/tpl.html) - Types and Programming Languages (http://www.cis.upenn.edu/~bcpierce/tapl/) ...and countless others of operational, denotational, axiomatic semantics etc. (Just do a search.) The problem you may have is that most of this stuff is the bastion of a relative few and much of the literature is defined in terms that those few understand well (I'm talking about the non-trivial applications, e.g. a denotational semantics for a "complete" language.) HTH, GB
Oct 16 2011