Live data from Hacker News

Learn C and build your own Lisp (2014)

buildyourownlisp.com

31–40 of 90 posts

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

#31
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.…

Universities should not fear teaching Lisp and Smalltalk in the first year.

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

#32

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

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

I have little C experience. I've always wanted to learn it properly to broaden my horizons, so I really respect the opinions of the gatekeepers: C is a small footprint language with plenty of footguns.

It goes beyond matters of style and straight to things like memory leaks that can cause security issues.

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

#33

Earlier quoted context omitted.

The criticism may be justified but jeez the person who wrote that comes off like a HUGE asshole. Reminds me of people I've worked with in the past who think they know everything and have an arrogance so thick you could cut it with a knife.

Every Lisp programmer I've ever met is like this. I don't know why, but it's probably Erik Naggum's fault. They used to be called "Lisp weenies" and now would be called "abusers". (The Clojure and Racket people are supposedly nice.)

"God help you if you are going to write your first interpreter in C of all things... Without manual intervention[,] C programs do pretty much no error detection... I hate C with a passion." -- Hayley Patton, Don't Build Your Own Lisp

"What a whiny little bitch." -- wudangmonk, https://news.ycombinator.com/item?id=27601530

When I look at these two statements, I wouldn't describe the first as being particularly abusive.

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

#34
I can also recommend the following books by Nils M Holm:

LISP From Nothing (https://t3x.org/lfn/)

LISP System Implementation (https://www.t3x.org/lsi/)

Scheme 9 from Empty Space (https://t3x.org/s9book/)

They're more leaning towards the LISP implementation side, and far less on the learning C side, for which there are far better options.

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

#35
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.

That's one of the things that initially drew me to Lisp. If I had to embed a scripting language in something else, it may well be that the simplest thing is to write and embed a simple Lisp interpreter.

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

#36

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

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

At least some of the things on that list have long been bugbears and known as sources for either incorrect/erroneous explanations and code (most of Schildt's output for instance). So it may be an attempt at gatekeeping but on the face of it seems a reasonable one.

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

#37

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

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 personally stopped reading in chapter 4 where this is done.

Unfortunately strictly avoiding memory issues is somewhat involved und thus often ignored in C beginner books. It is also hard to see unless you are pretty familiar with C's pitfalls. IMHO this is why this list of bad books is desperately needed.

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

#38
post #2

I like this tutorial, but it's worth noting that you're building your own lisp with the author's bespoke parser generator.

I started going through the book, but from the start I deviated to use Rust and Pest PEG grammar to make the parser and the logic. Saved me many times of debugging, but also showed, that you do not have to stick to the library or parser that the book uses.

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

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

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

#40

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…

Kudos to you for providing an explanation where the dot info people couldn't be bothered.
Post reply on HN