Live data from Hacker News

Learn C and build your own Lisp (2014)

buildyourownlisp.com

41–50 of 90 posts

Re: Learn C and build your own Lisp (2014)

#41
post #39

This book is on "Stuff that should be avoided" list[0]. [0] http://iso-9899.info/wiki/Main_Page#Stuff_that_should_be_avo...

> Bad C and terrible rationales. It would be nice if they actually bothered to explain. I'm inclined to trust Build Your Own Lisp over blah blah dot info if the latter is going to engage in nonspecific mudslinging.

I found this book, it's approach and tone to be really engaging, it answered a bunch of questions I didn't know I had and allowed me to understand and engage with my work as a web dev on another level. Parser Combinators for example are fascinating. I find Daniel Holden's work similar to many ways to Brian Lonsdorf's... Honestly surprised there are haters for this type of thing!

Re: Learn C and build your own Lisp (2014)

#43
post #11

I've had this in my bookmarks for awhile, intending to work through it. I think I can probably even do it solo without the guide, at this point. After years of programming, and learning (or at least playing with) many languages, I've come to a philosophical conclusion of sorts: C and Lisp should be the two languages all students start with, in my opinion. Probably SICP style Scheme education, and classic simple C89.…

I also have had this thought - start people with very simple (C89) C and Scheme. When they learn data structures have them use C and scheme and show additional examples in class in Python/Java/JavaScript. When they take an AI class, they build the fundamentals in Lisp and see examples/ecosystem in Python. When they take some form of "Programming Languages" they get introduced to SML and see some Java+ANTLR. When they take Software Design I and II, they work in Java.

From that foundation, they'd have the exposure they need to expand out.

I also enjoyed the path my University took. You started with Java. Data Structures was in C++, Java, and Python. Operating Systems was in C. AI was in Common Lisp (with some examples in Java and Python). Programming Languages was in any language you wanted, but examples were mostly in C and SML (SML/NJ). Computer System Design was in HDL, Assembly, and C. Software Design I and II used Java. Requirements Elicitation and Specification used Z. Concurrent/Distributed systems I and II used Promela, SPIN, TLA, and code was in Java.

Re: Learn C and build your own Lisp (2014)

#44
post #11

I've had this in my bookmarks for awhile, intending to work through it. I think I can probably even do it solo without the guide, at this point. After years of programming, and learning (or at least playing with) many languages, I've come to a philosophical conclusion of sorts: C and Lisp should be the two languages all students start with, in my opinion. Probably SICP style Scheme education, and classic simple C89.…

PUC-Rio (birthplace of Lua) does an intro to programming with Scheme (kind of a watered down SICP-type course) and then data structures in C.

Re: Learn C and build your own Lisp (2014)

#45

Earlier quoted context omitted.

Looks like a bunch of C gatekeepers got together and decided to reject any other path ways of learning C except their own.

C programming - luckily in my opinion - has a culture of very rigorous evaluation of programming techniques especially towards memory-unsafe programming, arguably the biggest weakness of C as a programming language. This book uses gets() which is a function that can not be used safely. Any input that exceeds the buffer length will corrupt memory. The conventional wisdom in the C community is to NEVER use gets. I pers…

Unfortunately, there are not a single but a multitude of cultures within the C programming community that compete with others, most of them claiming they are safer than others.

The aforementioned list for example has Jed Shaw's Learn C The Hard Way as having "[t]oo many factual problems and a presentation that gets you to do things wrongly before being shown how to do it correctly, and not even always then". This is an opinion held by the ##c channel, not necessarily every (competent) C programmer. LCTHW itself did a great service by introducing valgrind very early, and most criticisms [1] seem to be presentation issues that might be partly necessary for beginners and partly a matter of taste. (I personally think LCTHW was in particular unfairly attacked because of its merciless treatment of K&R. It's a shame that Jed Shaw gave up then.) To this date I don't have any good beginner-level C book to recommend, including K&R.

[1] as judged by famous Don't Learn C the Wrong Way essay by Tim Hentenaar: http://hentenaar.com/dont-learn-c-the-wrong-way

Re: Learn C and build your own Lisp (2014)

#46

mal is much, much better IMO: https://github.com/kanaka/mal

MAL and this book serve different purposes, this book's purpose is learning C by writing a Lisp interpreter, whereas MAL is more focused on writing a Lisp interpreter and is language agnostic

Re: Learn C and build your own Lisp (2014)

#47

Earlier quoted context omitted.

Looks like a bunch of C gatekeepers got together and decided to reject any other path ways of learning C except their own.

C programming - luckily in my opinion - has a culture of very rigorous evaluation of programming techniques especially towards memory-unsafe programming, arguably the biggest weakness of C as a programming language. This book uses gets() which is a function that can not be used safely. Any input that exceeds the buffer length will corrupt memory. The conventional wisdom in the C community is to NEVER use gets. I pers…

I see usages of fgets in Ch4, not bare gets (didn't check thoroughly)

    /* Read a line of user input of maximum size 2048 */
    fgets(input, 2048, stdin);
So that fgets does not read in too much data we also must also supply the size of the buffer 2048.

Maybe they updated? Also I'd understand not trying to be 100% safe in the code here to make the code easier to read, unlike in a production version of the tool.

Re: Learn C and build your own Lisp (2014)

#48
post #16

Building a simple Lisp interpreter which can be then embedded in your project is the single best thing that you can do. Configuration? Solved. Serialization? Solved. Separating the application logic from the gory details of its implementation? Done.

"Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp." -- Philip Greenspun

Re: Learn C and build your own Lisp (2014)

#49

This book is on "Stuff that should be avoided" list[0]. [0] http://iso-9899.info/wiki/Main_Page#Stuff_that_should_be_avo...

My first reaction to those reviews was that they read pretty disrespectfully. Writing a book is extremely challenging and some of the feedback is not appropriate for a page that's associated with a standards body.

Then I wondered, "If these are the resources to avoid, where do these people recommend I find the good information?"

Alas, those links are mostly broken.

As a long time programmer recently learning C, I've been surprised by how prickly and unhelpful C culture tends to be.

The concensus seems to be that no published information is good enough, and none of the critics are willing to publish the good information.

Maybe I just haven't found the right groups?

Re: Learn C and build your own Lisp (2014)

#50
post #11

I've had this in my bookmarks for awhile, intending to work through it. I think I can probably even do it solo without the guide, at this point. After years of programming, and learning (or at least playing with) many languages, I've come to a philosophical conclusion of sorts: C and Lisp should be the two languages all students start with, in my opinion. Probably SICP style Scheme education, and classic simple C89.…

That was the progression when I took (the now well-known) CS50 at Harvard. Learn C first, then Lisp, then write a Lisp compiler in C. That was a lot of years ago, so one could argue that is an outdated approach now, but I think it still provides a strong foundation of CS fundamentals.
Post reply on HN