Every now and then, I see a thread about how functional programming languages are The Way, wondering why they aren't more popular.

A big problem is that people talk about functional programming as The Way for Everything. FP has its place. All tools have their roles. 🧵 1/
The elegance of functional programming makes it an appealing "silver bullet" candidate.

But here are the domains where FP really shines:
1. Programming education
2. Prototyping language features and analyses
3. Domains where you're mostly specifying transformations

2/
I fell in love with Scheme and SML in undergrad. I taught myself Haskell and extended it for my senior thesis. In grad school I worked in Haskell, then OCaml, then Scala.

But by the end of grad school, I was mostly using Python.

Here's what happened.

3/
In the beginning, I wondered why everyone didn't use functional programming. When I interned at Google in 2007 I asked them weekly why we were still using C. My mentor would tell me, we don't even have the 50% memory overhead to use Java.

It's a matter of time, I thought.

4/
When I started grad school, I was building most of my stuff in Haskell. I loved the elegance of pure functional programming.

Then I decided to implement Earley parsing. After a weekend mucking with monads for a 4D l mutable array, I was over not having mutable state.

5/
Then I switched to OCaml. See my pros-and-cons here:
jxyzabc.blogspot.com/2009/03/haskel…

But to scale OCaml for my data processing needs, I had to:
1. Stop using closures.
2. Use references everywhere.
3. Make foreign function calls out to C++.

In conclusion, I was writing C++.

6/
At this point, I still very much believed in strong, statically typed functional languages, so I decided to try Scala.

I was very into Scala for a while and even got featured on their blog for evangelizing Scala, with this post:
jxyzabc.blogspot.com/2012/11/should…

7/
But I again hit a snag. I was prototyping new features for Jeeves, the programming language I created during my PhD. I was embedding it as a DSL in Scala and every experiment was a few hours of wrestling with the Scala typechecker.

One day, I gave up:
jxyzabc.blogspot.com/2013/12/im-usi…

8/
I'm still a big proponent of strong static types and functional languages. I recommend them as thinking tools without reservation. For building systems, however, it's important to match the tool to the task!

(And FP evangelists would benefit from acknowledge this!)

end 🧵/

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with ⚡️ Jean Yang ⚡️

⚡️ Jean Yang ⚡️ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @jeanqasaur

14 Jul
Why aren't there more startups based on programming languages and software analysis?

There's definitely a need for SOMETHING, as developers have so much pain.

I was recently on a panel where someone asked this question. I didn't have time to answer then, so here's a thread. 1/
There's often a gap between the creators of "principled" programming tools and the needs of working developers.

There are two common technical assumptions: 1) code correctness is a top priority and 2) it's possible to understand the whole system.

Often, neither hold. 2/
In programming languages and formal methods there's the dream of "soundness:" if there's a bug, the tool will find it.

People don't want to know all of their problems. They want a prioritized list of problems that matter. This technical goal is often at odds with user needs. 3/
Read 7 tweets
13 May
Taylor Swift as notable #AAPI computer scientists. 🧵

Andrew Yao, 2000 Turing Award Winner. Known for proving Yao's Principle. See also: Yao's Millionaire's problem.

#AAPIMonth
Raj Reddy, winner of the 1994 Turing Award for pioneering work in artificial intelligence. Mentor to @kaifulee.

#AAPIMonth
@kaifulee Jeannette Wing, who co-developed the Liskov Substitution Principle. Leader in formal methods research. Head of @SCSatCMU 2004-2007 and 2010-2012.

#AAPIMonth
Read 6 tweets
6 May
Earlier today, @the_prion asked me what the hardest part about starting @AkitaSoftware was.

My answer: figuring out how to build a team that balances user-focused product thinking with the deep technical expertise required to power it (in our case).

Thread. 🧵
@the_prion @AkitaSoftware At Akita, we're making it easier to detect the API regressions that matter. We want to do this as non-invasively as possible, with the highest information content possible.

This means keeping code changes/perf overhead as minimal as possible, while keeping false positives low.
@the_prion @AkitaSoftware Keeping code changes and perf overhead as low as possible is not easy, and constantly requires balancing software architecture decisions with user-facing tradeoffs.

Keeping false positives low is also a really hard trace analysis problem that also has many user-facing tradeoffs.
Read 5 tweets
6 May
A professor friend told me that some female students in her dept asked her how she dealt with being in a male-dominated field. She told them she was an internalized misogynist and didn't have any female friends, but then I taught her to be friends with women again.

Thread. 👇
It's a very human phenomenon to distance yourself from the traits that other people don't respect in you! Think about all the high school movies where the nerd ditches their nerd friends to be cool. 🥸

For any woman who needs to hear it: befriend and champion other women.
Related: I was recently talking to a group of younger female CS alums from my university and they said it was rare for them to have such a technical conversation with a woman.

I was taken aback, but realized that I also felt that way before I found other technical woman friends.
Read 4 tweets
4 May
When we talk about "developer experience," we really need to separate dev tools into two categories: ones that simplify things away and ones that help developers engage with complexity. DX needs are different for simplification tools vs complexity-embracing tools!

Thread. 👇
In the "simplification" category of dev tools are all kinds of automation tools: APIs like Stripe and Twilio; SaaS products like Netlify; domain-specific languages like GraphQL.

You want these tools to be as one-click as possible and shield the developer from most details.
The most classic example of a dev tool in the "complexity-embracing" category is a debugger: it shows you your stack trace; it shows you a call graph. It lets you get where you need to go by giving you tools to explore a complex system.

Observability tools are in this category.
Read 6 tweets
22 Jan
Something I've been thinking about: "bonus skills," the skills that don't necessarily get advertised, but are often the most transferable across life stages.

Here's a thread of the bonus skills I learned at different stages of my education and career. Curious to hear yours.
In undergrad, I learned how to:
📚 Skim hundreds of pages in one hour and have something intelligent to say.
🙇🏻‍♀️ Be okay with not being the smartest or the most interesting person in the room.
🤝 Be okay relying on other people when working under high pressure.
In grad school, I learned how to:
⏲ Be okay working like crazy right up until the minute of a deadline.
⏳ Be able to wait months and sometimes years for results.
🧘🏻‍♀️ Decouple my identity from work outcomes.
💖 Lean on my friends for support and sanity.
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(