Live data from Hacker News

Hotswapping Haskell

simonmar.github.io

11–20 of 36 posts

Re: Hotswapping Haskell

#11
post #8
post #4

People might find this interesting to compare and constrast to (certainly I noticed parallels with[1]) Netflix's 'serverless' platform, discussed yesterday: https://medium.com/netflix-techblog/developer-experience-les... Edit: As a sibling commenter notes this is most eminently doable with e.g. Common Lisp and BEAM (Erlang/Elixir), but more folks are (publicly) attempting this in other environments now (I've experime…

> Common Lisp and BEAM (Erlang/Elixir) Clojure as well right?

Anything JVM based. Also Smalltalk.

Re: Hotswapping Haskell

#12
post #7
post #6

Earlier quoted context omitted.

I agree. Fun read and cool hack, but it definitely feels like they are stretching to justify the more fun of the two options (spend time on this or spend time fixing the root cause).

Glad you guys both can make a better trade off than the engineers that actually have their hands on the problem. /s You're reading a blog post, you do not know all they have tried, nor the various intricacies they're dealing with.

They explained their justification; if they don't want random people on random forums disagreeing with their justification because it wasn't complete enough, they are free to make it more complete.

Re: Hotswapping Haskell

#13
post #2

I don't want to knock the technical achievement here -- it's a cool hack -- but I'm really surprised that it was deemed to be the best choice for a production system. In the first place, "we can't compile our code on every change because it takes too long" is a really awful situation to be in. Are developers not building and testing their changes before deploying them? Can Facebook not afford a continuous integration…

While I agree a slow build indicates a problem with their build infra, haskell’s purity and type system do rule out issues with mutable State (presumably there isn’t any in the hot-swapped module) and invalid states (the type system prevents invalid states from being constructed, given the way they have a fixed hot-cold API).

The article describes the hot-swapped module as containing frequently changing business logic, which sounds like it’s something they can probably do via an interface with well-constrained or no mutability.

Re: Hotswapping Haskell

#14
post #7
post #6

Earlier quoted context omitted.

I agree. Fun read and cool hack, but it definitely feels like they are stretching to justify the more fun of the two options (spend time on this or spend time fixing the root cause).

Glad you guys both can make a better trade off than the engineers that actually have their hands on the problem. /s You're reading a blog post, you do not know all they have tried, nor the various intricacies they're dealing with.

You're right, I don't know all the intricacies of their system. That's why I said "I'm surprised" rather than "this is a bad design decision". It doesn't mean I can't point out potential pitfalls that I think the blog post glosses over.

Re: Hotswapping Haskell

#16

It's basically this: https://news.ycombinator.com/item?id=8804381 http://nullprogram.com/blog/2014/12/23/ You'd be surprised how many languages can do this. Though it's hard to beat lisp (and Erlang), where it is the default.

really, anyone who bothers reading the dlopen(3) manpage: http://man7.org/linux/man-pages/man3/dlopen.3.html

Loading / unloading code is straightforward. The trick is in getting the code called from existing code.

Re: Hotswapping Haskell

#17
post #2

I don't want to knock the technical achievement here -- it's a cool hack -- but I'm really surprised that it was deemed to be the best choice for a production system. In the first place, "we can't compile our code on every change because it takes too long" is a really awful situation to be in. Are developers not building and testing their changes before deploying them? Can Facebook not afford a continuous integration…

I remember at Standard Chartered they have a Haskell monolith project of a few million LoC and they are relying on incremental building. [1]

I wonder why that wasn't an option for facebook.

[1] From podcast: http://www.haskellcast.com/episode/002-don-stewart-on-real-w...

Re: Hotswapping Haskell

#18
post #9

Hotswapping just like security is one of those things that is hard to bolt on later, unless it is built in deeply into the very core of the language / runtime. Erlang (and Elixir) define hotswapping very well. It is a standard way to upgrade code in production in some places. And even with it being well defined it is still very hard and there are enough corner cases to handle. But when used correctly, it is really ma…

Or you can use it for local development, as you edit code

This is a huge feature for me in my Elixir development. I mostly use Elixir for some server code that manages many connections to external network entities. It would be a huge hassle to bring down my server application every time I want to make a change.

With Elixir (yeah, Erlang), I can normally recompile the module I'm working on and deploy it in the running server. Not only is it a good way to constantly observe Erlang hot-swapping in action on my dev machine, it's a huge time saver.

Re: Hotswapping Haskell

#19

It's basically this: https://news.ycombinator.com/item?id=8804381 http://nullprogram.com/blog/2014/12/23/ You'd be surprised how many languages can do this. Though it's hard to beat lisp (and Erlang), where it is the default.

really, anyone who bothers reading the dlopen(3) manpage: http://man7.org/linux/man-pages/man3/dlopen.3.html Loading / unloading code is straightforward. The trick is in getting the code called from existing code.

Loading is straightforward, unloading depends.
Post reply on HN