
The Science of Functional Programming [pdf] - adamnemecek
https://github.com/winitzki/sofp/blob/master/sofp-src/sofp.pdf
======
baby
Here's the direct download link:

[https://github.com/winitzki/sofp/raw/master/sofp-
src/sofp.pd...](https://github.com/winitzki/sofp/raw/master/sofp-src/sofp.pdf)

------
lewisjoe
I put together a list of links that helped me get a hang of things on my
journey understanding the theories behind languages and their design -
[https://docs.google.com/document/d/1hFch8y9RVab9A7U6ocUzfmPQ...](https://docs.google.com/document/d/1hFch8y9RVab9A7U6ocUzfmPQVOJSEoki4AF7Z2vE6X8/edit?usp=sharing)

The list isn't ordered or complete yet. I just started the doc today. I'll be
adding stuff as I move along.

------
nafizh
Can anyone please comment on the book as a learning material for practical
functional programming? All of the comments here are going on tangents (which
is ok, but please also comment on the source material).

------
qwerty456127
It hang my PC and I had to use the reset button. The CPU load went 100% and
never fallen back (I waited for about 15 minutes). The PC became so extremely
slow I couldn't even log-in to another Linux console.

I retried on Windows an it (the download button) worked just fine however.

~~~
shmageggy
This page completely hung my Android phone too

------
russellbeattie
This is a real question for anyone who might know: Have mathematicians as a
whole ever thought about moving from the age-old formulas using various Greek
symbols to something more akin to a programming language? What I mean is,
instead of writing π to instead use "pi", or "summation()" rather than using
the capital sigma? Functions like sin(), cos(), etc. already look like that, I
wonder why the derivative sign and others haven't been changed. Superscript
and subscript as well, and prime marks. It all seems superfluous.

I guess what I'm asking is there an alternative to traditional mathematical
notation that's commonly used?

~~~
agumonkey
MIT SICM book does try this.

Iirc sussman (and maybe Steele), weren't happy about the syntax. Thus re-
expressing Lagrangian mechanics in a scheme.

~~~
russellbeattie
Nice, thanks.

------
amelius
Perhaps pedantic, but mathematics is not science, and neither is functional
programming.

See:
[https://undsci.berkeley.edu/article/mathematics](https://undsci.berkeley.edu/article/mathematics)

> Mathematics is such a useful tool that science could make few advances
> without it. However, math and standard sciences, like biology, physics, and
> chemistry, are distinct in at least one way: how ideas are tested and
> accepted based on evidence. Math doesn't rely on testing ideas against
> evidence from the natural world in the same way that other sciences do.
> Mathematical ideas are often accepted based on deductive proofs, while ideas
> in other sciences are generally accepted based on the accumulation of many
> different observations supporting the idea.

~~~
BlueGh0st
Extremely pedantic. In fact, contradicted by your own reference.

>The answer depends on one's philosophical views on the nature of mathematics
— and in this area, philosophers and mathematicians have not reached a
consensus

>...

>Now it's up to you. How is math similar to and different from science?

~~~
goatlover
Science is an investigation of the empirical, and as such relies on induction,
whereas math is deductive and non-empirical. Even if Platonism is true, we
don't gain knowledge of math via the senses (mathematical truths are not out
there in the world but rather some non-material realm).

------
boznz
The web page kills a chromebook.. wtf

~~~
blunte
It choked my Mac too. Apparently there's an embedded PDF viewer or PDF->HTML
viewer in the Github page, and clearly it is not designed for a 450+ page PDF
file.

------
mlevental
i haven't read this book but in undergrad I skimmed his linear algebra and it
was great. it's still the clearest introduction to wedge and exterior products
I've ever seen.

------
Tade0
_It requires a certain amount of mathematical experience and is not suitable
for people who are unfamiliar with school-level algebra, or unwilling to learn
difficult concepts through prolonged mental concentration and effort._

Why do materials on functional programming always have to be at least somewhat
condescending towards the reader?

Or maybe: why such sentences seems to appear only in them?

~~~
classified
To understand how and why a C compiler works you don't need all that much
algebra. If you thoroughly understand assembly, you're basically good to go.

To understand how and why an FP language compiler works you need to grok the
lambda calculus (as a bare minimum). I'd call that algebra. To even understand
what problems are being solved by closures, I really had to “ _learn difficult
concepts through prolonged mental concentration and effort_ ”. Giving newbies
a heads-up that competent use of such a tool requires nontrivial knowledge is
only fair.

~~~
jfoutz
eh, i dunno. i think anybody with a decent grip on any language can whip up a
scheme compiler way faster than a C compiler. [1] is a very readable guide to
scheme and its implementation. Will it be the fastest gun in the west? no. Is
it a simple workable foundation that, like, anybody who can put together 100
lines of working code, in any language, can build? for sure. Compilation isn't
magic.

Lambda calculus won't hurt. Implementing scheme (which imho is pretty darn
close to the lambda calculus) really just requires understanding some
operational semantics and you're good to go.

[1] ([http://agl.cs.unm.edu/~williams/cs491/three-
imp.pdf](http://agl.cs.unm.edu/~williams/cs491/three-imp.pdf))

~~~
classified
Quite. But pretty darn close is still not close enough to support partial
application via curried functions out of the box.

~~~
jfoutz
Absolutely.

I'd argue, if somebody has written their own interpreter and compiler,
leveraging the interpreter at compile time first for constant expression
evaluation and then something more sophisticated for partial function
evaluation is a lot more intuitive. You can kinda climb a hill of difficulty
rather than be teleported to the top and wish them luck.

(To be totally fair i keep trying to open the pdf, but the browser tab locks
up. So maybe my observations are meaningless)

_edit_

There is no royal road. but some roads are perhaps longer, but a little easer
to travel.

