News for hackers. Stuff that matters.
Re:Typing Is Hard by KMag on Wednesday February 17, 2021 @03:57AM (#26164244)
I guess then you'd need another mechanism for dealing with re-defining APIs in incompatible ways within the REPL. It's a pretty common use case for REPLs to play around with APIs and temporarily break them.

The best alternative is to keep a map of all of the definitions with broken type checks, and refuse to generate new machine code/bytecode as long as that map is non-empty, and keep using the older definitions until again get back to a sound state of the world.

Re:Typing Is Hard by codebje on Wednesday February 17, 2021 @06:42AM (#26165315)
GHC's REPL supports turning type errors into crashes when the ill-typed expression is used, which lets you test one part of code while another part is broken.

I think you can even extend that to compiled code, for an authentic "it crashed in production" experience.