News for hackers. Stuff that matters.
Re:I_suck_and_my_tests_are_order_dependent by bradrn on Thursday February 16, 2023 @09:38PM (#34830008)
> To me unsafe generally means “memory safety or type safety is disabled”.

And that is exactly what it means. Unsafe functions in Haskell do run in production. They just subvert type safety (and I believe memory safety too, in the case of accursedUnutterablePerformIO).

Re:I_suck_and_my_tests_are_order_dependent by Athas on Thursday February 16, 2023 @11:55PM (#34830955)
Even plain unsafePerformIO is memory-unsafe, as it will let you construct a polymorphic IORef, through which you can implement unsafeCoerce.
Re:I_suck_and_my_tests_are_order_dependent by bradrn on Friday February 17, 2023 @01:40AM (#34831572)
Hmm… is that memory-unsafe? I thought that came under the heading of ‘subverting the type system’. Then again, I suppose they’re more or less the same thing in a strongly-typed and pure language like Haskell.
Re:I_suck_and_my_tests_are_order_dependent by Athas on Friday February 17, 2023 @02:54AM (#34832043)
Yes, it is very memory unsafe. Subverting the type system often the main source of memory unsafety in most languages. It typically means you can treat an arbitrary integer as a pointer to any other object.