Pure functional works great until it doesn't. For a lot of systems-y and performance-oriented code you need the escape hatches or you'll be in for a lot of pain and annoyance.

As a practical observation, I think it was easier to close this gap by adding substantial functional capabilities to imperative languages than the other way around. Historically, functional language communities were much more precious about the purity of their functional-ness than imperative languages were about their imperative-ness.

"Pure functional works great until it doesn't. "

That's why F# is so great.

Functional is default, but mutable is quite easy to do with a few mutable typedefs.

The containers are immutable, but nobody stops you from using the vanilla mutable containers from .net

It's such a beautiful, pragmatic language.

F# is not a pure functional language. It is a functional-first language that does imperative and OOP better than imperative and OOP languages.

You can program F# just like you would Python, and it will be more readable, concise, performant, and correct.

Unfortunately unless there's an explicit way to state what has side effects like a mut keyword, a lot of fp programming advantages lose value because most devs default to mutable stuff, so the fp benefits don't compound

I think this works quite well with IO in Haskell. Most of my code is pure, but the parts which are really not, say OpenGL code, is all marked as such with IO in their type signatures.

Also, the STM monad is the most carefree way of dealing with concurrency I have found.

F# isn’t purely functional, though, and strikes a nice balance. I just don’t really like the .NET ecosystem, being 100% Linux these days, as it always seems slightly off to me somehow.

Same. I strikes me a great shame that there aren't great F#-like languages that targeted the JVM.

Really? What's wrong with .NET? It's one of the nicest cross-platform platforms out there. What Microsoft has done with it is amazing.

Hehe, purity is one helluva drug!

For some reason, this makes me think of SVG's foreignObject tag that gives a well-defined way to add elements into an SVG document from an arbitrary XML namespace. Display a customer invoice in there, or maybe a Wayland protocol. The sky's the limit!

On the other hand, HTML had so many loose SVG tags scattered around the web that browsers made a special case in the parser to cover them without needing a namespace.

And we all know how that played out.

Posted from an xhtml foreignObject on my SVGphone

> you need the escape hatches

Isn't this a strawman? Even Haskell has unsafePerformIO and Debug.Trace etc. It just also provides enough ergonomics that you don't need them so often, and they "light up" when you see them, which is what we want: to know when we're mutating.