Live data from Hacker News

15-150: Principles of Functional Programming

brandonspark.github.io

71–80 of 146 posts

Re: 15-150: Principles of Functional Programming

#71
post #64

It seems that the fundamental problem with the functional paradigm (in its pure form) is that the real world - including the architecture of the computer that is used to run the programs on - is full of side effects, i.e. is essentially "imperative," and with this impedance between them the idea creates more problems than it solves.

on the contrary, i think FP (Haskell at least) gives you more & better tools to represent and wrangle side effects

Re: 15-150: Principles of Functional Programming

#72
post #64

It seems that the fundamental problem with the functional paradigm (in its pure form) is that the real world - including the architecture of the computer that is used to run the programs on - is full of side effects, i.e. is essentially "imperative," and with this impedance between them the idea creates more problems than it solves.

[deleted]

Re: 15-150: Principles of Functional Programming

#73
post #15

on the choice of language to teach the course why sml i think there are a lot of nicer choice OCaml , its basically sml only more popular and used more in real life Haskell , again more popular , and used more in real life Idris , newer and said to be more progressive F# , a more practical choice and similar to sml a lisp , well if you want to focus on the functional part and less on the types part

because SML is awesome, isn't going to change and is simple. you can learn the syntax in an afternoon, and really focus on learning FP semantics.

Re: 15-150: Principles of Functional Programming

#74

Slightly off-topic but what's a good forum to seek help on FP practices outside of the courses like this online? Every winter break I get back into trying to learn more FP (in Haskell) and in the past several years I have been practicing algo problems (codeforces, advent of code, leetcode). I always get stuck on more advanced graph algorithms where you traverse a and modify a graph, not a tree structure - it gets par…

Many graph algorithms are designed for imperative programming. It's safe to say that functional graph programming is still in its infancy. Alga[0], a system for algebraic graphs only came out in 2017. And efficient algorithms for graphs may yet to be discovered (even something as simple as reversing a list that's both efficient and elegant only came out in 1986!)

That said, as a beginner in functional programming, it would probably be good enough if you just focus on directly translating imperative graph algorithms to functional programming. You simply solve the problem by programming at a slightly lower level of abstraction.

[0]: https://dl.acm.org/authorize?N46678 or preprint at https://github.com/snowleopard/alga-paper/releases/download/...

Re: 15-150: Principles of Functional Programming

#75

Earlier quoted context omitted.

There's a few things which go into this (hi, I'm the instructor!). One such reason is historical. Standard ML is a research language, and a significant amount of work on it was done by professors at Carnegie Mellon, who developed the curriculum for this course. Even setting that aside though, I fully agree with the choice to teach it in SML. For transparency, I work professionally in OCaml, so I am not unfamiliar wit…

As a professional who uses F# every day, I appreciate this answer, even though it concerns me. Separating concepts from practical details is worthwhile, but can be taken too far. I think the FP community probably focuses a bit too much on theory. I would encourage you to consider teaching a more practical language, like F#, in the future.

i think someone with a good grounding in sml could get proficient ocaml or f# in under a month. sml is absolutely the right language to teach a course like this in.

Re: 15-150: Principles of Functional Programming

#76
post #64

It seems that the fundamental problem with the functional paradigm (in its pure form) is that the real world - including the architecture of the computer that is used to run the programs on - is full of side effects, i.e. is essentially "imperative," and with this impedance between them the idea creates more problems than it solves.

on the contrary, i think FP (Haskell at least) gives you more & better tools to represent and wrangle side effects

Exactly. These languages come up with more and more strategies and abstractions (from monads to modern effect systems) to help you manage your side effects well. It then raises the level of abstraction in your programs to become simpler and more concise.

Re: 15-150: Principles of Functional Programming

#77
post #65

Great resource! Forgive my ignorance but why do so many modern functional programming courses use Standard ML instead of a Lisp dialect? Is it because of its built-in type-checking, or is it just how it's always been taught?

Why would they use a Lisp dialect instead of Standard ML? It looks ugly, it looks different from math, and different concepts have the same syntax. Standard ML looks nice, it looks like math, and different concepts have different syntax.

No, SML is actually quite verbose ang generally ugly, compared to say OCaml or F#, or even Scheme or Closure. This is why it is dead.

Re: 15-150: Principles of Functional Programming

#78
post #15

on the choice of language to teach the course why sml i think there are a lot of nicer choice OCaml , its basically sml only more popular and used more in real life Haskell , again more popular , and used more in real life Idris , newer and said to be more progressive F# , a more practical choice and similar to sml a lisp , well if you want to focus on the functional part and less on the types part

because SML is awesome, isn't going to change and is simple. you can learn the syntax in an afternoon, and really focus on learning FP semantics.

The problem that is extremely verbose though. OCaml is much more concise.

Re: 15-150: Principles of Functional Programming

#80
post #51

150 was one of my favorite courses at CMU; each homework really made me feel like I unlocked a new level of reasoning with code.

That's how I felt when I discovered FP after more than two decades writing procedural and OO code. It felt like I'd found a secret room where all the reasoning was kept.
Post reply on HN