Functional Ingsoc

Vaibhav Sagar (@vbhvsgr)

War is peace

Non-functional programming

  • It’s great to be able to write ‘intuitive’ code without interference from the language!

  • Convenient when you’re writing your program, not so much when you have to run it.

Functional programming

  • If there’s any way for my mistake to be caught at compile time, I will find it and use it.

  • The compiler will declare all-out war on your program but when the dust settles, you have the peace of mind that it will do what you expect.

Freedom is slavery

Non-functional programming

  • It’s so great that your functions are unrestricted in what they can do and you can just focus on writing your code!

  • Easy to write the first time, nearly impossible to change afterwards because you are bound by past decisions.

Functional programming

  • Let’s limit the scope of what each function can do so that we can easily make changes later, as we inevitably will.

  • Not as easy to write the first time, but much easier to change afterwards

Ignorance is strength

Non-functional programming

  • How good is not having to worry about purity and compositionality?

  • Slow, hard to analyze, full of bugs

Functional programming

  • How good is polymorphism (parametric, arbitrary-rank, levity, linearity, etc.)?

  • Constraints liberate and liberties constrain (thanks Rúnar)

Doublethink

What!?

  • the acceptance of contrary opinions or beliefs at the same time, especially as a result of political indoctrination.

  • I’d describe myself as extremely enthusiastic about FP, but not so long ago…

What’s my point???

Radicalisation

  • My dynamically-typed programs failed over and over and over and over again

  • There was a supportive, friendly FP community in the city I was living in

  • The code I wrote was immediately better and more robust, even before tests

  • It was still painful, and I wonder if there is an easier way.

Empathy

  • There’s definitely a period of adjustment when learning to ‘think functionally’ and it does us no harm to be nicer to those who are trying

  • Maybe there are more palatable ways to sell Haskell, rather than the justifications we use now

Thanks!