
SICP distilled (2009) - ColinWright
http://www.programming-musings.org/2009/12/29/sicp-distilled
======
asperous
_The truth is that Lisp is not the right language for any particular problem.
Rather, Lisp encourages one to attack a new problem by implementing new
languages tailored to that problem. Such a language might embody an
alternative computational paradigm [...]_

This is pretty much _the_ reason I choose not to use lisp in my projects. I
choose languages that have common programming idologies built into them
because (a) I am not a language paradigm designer and don't have time for that
and (b) I want other people to be able to quickly look at my code and using
their pre-existing knowledge of the language idologies be able to make sense
of it.

I write code for people to read (in a format machines can parse and run), and
idiots (like myself) are my target platform.

You _could_ use Lisp for everything, just like you could walk anywhere or
build a bike yourself, but why would you when you could just pick out a car
and just accept the limitations and dangers of driving on the roads? At least
with a car you have the years of engineering and research under the hood, and
mechanics that have worked on machines like yours before.

~~~
pavelludiq
You have taken a statement that essentially means "Lisp is a pretty good
_general purpous_ language" and interpreted it as "If I use lisp I have to
create the universe from scratch in order to make an apple pie, and others
will have to rediscover all of physics to exist in my universe".

Common Lisp, Clojure and Racket all have at the very least a descent set of
libraries. And if you use clojure or ABCL, you get all of the jvm libraries
too. With FFI you can use any C library from Common Lisp or Racket too. On top
of that you get to use languages designed for extensibility, which means that
there are actual best practices and examples of how to extend a language
without painting yourself into a corner with an unmaintainable mess. Lispers
have been doing stuff like this for decades, some of it is very well
understood in the various lisp communities.

My favorite example of this power are the various sql DSLs, I can write in
lisp something like (query (:select :* :from 'some-table :where ...)) without
having to concatenate strings and worry about injections. Yes, I have to learn
a new language on top of Common Lisp to use it, but if you know SQL and Lisp,
you already know 90% of it. Now I have all the power of lisp in my queries,
isn't that cool?

------
abecedarius
After I read Abelson & Sussman's article I asked a bookstore to order their
book. It took a month to arrive (this was the 80s) and I'm thankful for that
month, because that period of trying to develop their themes further for
myself made the book a richer experience. Anyone else here encountered a
textbook first in distilled form?

------
ised
1\. LISP is an ideal language for code generation.

For example, producing high quality C code (e.g., arthur whitney or djb's,
imo); this is difficult or tedious when done "by hand" but can be made easier
by using code generation. There is a beautiful conciseness and consistency to
the "model" C code I prefer (e.g. by the above authors). It is well-suited to
being generated by a "custom interpreters" and a "DSL". Next to Flex, LISP is
my personal favorite for constructing such a code generation system.

Python devotees already follow a similar path when they use Cython. But what
do you think the quality of the generated C code is like? Have a look at it.

2\. LISP is also a great prototyping language. The final application may not
be written in LISP. Or at least parts of it might be in other languages.

Selecting from a limited collection of libraries written (perhaps poorly) by
others, as is done with many popular languages, strikes me as a "top-down"
approach, not building from the ground up. The collection of libraries defines
what you can and cannot do. Now, if you just want to do what everyone else is
already doing, this is perfectly acceptable. However if you want to break new
ground, you will likely have to write some functions yourself. And,
personally, I'd rather do this in LISP.

Maybe it's better to learn to use SWIG or a similar codegen tool and wrap any
C library function of your choosing for use in LISP, or Lua, or another
language that lacks "batteries"? It's encouraging to me when I see programmers
express dislike for LISP in online forums. Because I take it as a sign that
this is a worthwhile language to master. I've seen similar expressed distaste
for what I know to be good quality C code. It goes something like this:
Programmer at large in online forum can't understand [insert code/language],
therefore [said code/language] is somehow defective.

------
codex
"The truth is that Lisp is not the right language for any particular problem.
Rather, Lisp encourages one to attack a new problem by implementing new
languages tailored to that problem."

This is why I don't use LISP. It is the case that math is closely related to
language, so those with an overdeveloped math functional unit in the brain
also have an overdeveloped linguistical unit. This leads to treating every
problem as a linguisic problem, because that is what their brain is best
equipped to solve.

While this works for them, it doesn't for me--my brain attacks problems
completely differently, and so language centric toolbox is not what I prefer
to use.

I don't have a problem converting my solutions into any given language. In
fact, I prefer to translate them into a representation closer to the machine
for better performance.

~~~
qzxt
>> "so those with an overdeveloped math functional unit in the brain also have
an overdeveloped linguistical unit. This leads to treating every problem as a
linguisic problem, because that is what their brain is best equipped to
solve."

Seriously, math envy much? Where is it that people formulate these absurd
conjectures about mathematics and people who understand mathematics, because
every time I hear one it sounds more like defensive attempts to disarm one's
feelings of inadequacy by making another group seem inferior or "different" in
some way. Furthermore, mathematical capacity and linguistic capacity have no
strong links that I know of, so I'm going to need a citation before I swallow
that claim, sir.

~~~
codex
"The Math Gene" goes into some of the links between math and language--but
that's not really central to my argument, which is that some people are not
predisposed to attack problems linguistically. I only mention it to explain
why there are so many linguistic connections to computer science.

I don't mean to sound defensive; and, indeed, I'm not sure I'm terribly bad at
math (perfect scores on math achievements, AP Calculus BC, diff eq. modeling
experience) or have terribly low verbal ability (perfect score on verbal SAT).
But I do know that, of the tools I would use to attack a CS problem,
linguistic is low on the list. And once I have a solution, my correctness
proofs are not linguistic, either.

~~~
qzxt
a) OP had nothing to do with linguistics or math; it was simply pointing out
that Lisp's approach to being general purpose was interesting in that you
could take basic rules and restructure them to fit your domain.

b) I have read "The Math Gene" and many claims made vis-a-vis maths and
linguistics are dubious, at best.

c) There is no "linguistic" way to attack anything, unless what you're
attacking is a linguistic problem.

Is your rationale that when given a problem "mathematically overdeveloped" -
by the way, if you were wondering about your perceived defensiveness, saying
someone is "overdeveloped" in something you claim to not have ample ability in
is a dead giveaway - people will first parse it for nouns and gerunds? Because
most people think about the problem and only consider your diction if it is
relevant to the problem itself.

