<div dir="auto">I think safe Haskell is largely meant for exactly stuff like lambda bot.  </div><div dir="auto"><br></div><div dir="auto">One gotcha that I’ve seen come up when people use it ... safe Haskell modules disable all rewrite rules (trustworthy doesn’t). And I’ve seen folks mark a module in their benchmarks as safe... and I suppose  they didn’t understand the implications of that. </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 17, 2021 at 10:59 AM Richard Eisenberg <<a href="mailto:rae@richarde.dev">rae@richarde.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Hi Bertram,<br>
<br>
Thanks for speaking up here. I feel like I'm missing something I should know, but how does Safe help you? Looking at the lambdabot docs, users cannot import their own modules, and you describe the libraries as curated. So, presumably, that's enough to keep unsafeCoerce and unsafePerformIO from being in scope. Along similar lines, I don't see a way in lambdabot to enable extensions, so Template Haskell is not an issue for you (I believe).<br>
<br>
Maybe the role of Safe is in helping you curate your libraries? That is, you can use the Safety of a module in determining whether or not it should be imported. That is indeed helpful. Is that it, though? Does enabling -XSafe when compiling user-supplied code catch some scenarios that would be uncaught otherwise?<br>
<br>
Thanks for educating me about this -- it's important to know how the feature is being used if we are going to maintain it.<br>
<br>
Richard<br>
<br>
> On Apr 17, 2021, at 9:03 AM, Bertram Felgenhauer via Haskell-Cafe <<a href="mailto:haskell-cafe@haskell.org" target="_blank">haskell-cafe@haskell.org</a>> wrote:<br>
> <br>
> Richard Eisenberg wrote:<br>
>> Hi café,<br>
>> <br>
>> Do you use Safe Haskell? Do you know someone who does? If you do, which<br>
>> of Safe Haskell's guarantees do you rely on?<br>
> <br>
> Yes. lambdabot's evaluation mechanism is essentially designed around<br>
> Safe Haskell: expressions being evaluated are wrapped in `show`, so<br>
> there's nothing triggering IO actions from outside.<br>
> <br>
> Safe Haskell (barring bugs or evil libraries) ensures that there's no<br>
> unsafePerformIO nor unsafeCoerce to break the type system, so there's<br>
> no way to perform arbitrary IO actions inside pure code.<br>
> <br>
> The libraries are curated, so evil libraries have not been an issue.<br>
> <br>
> As for bugs, there have been holes in Typeable in the past, but<br>
> currently I believe they're closed, except for the use of MD5 as a<br>
> hash function (but that may require ~2^64 hash operations to exploit<br>
> because it's hashing UTF-16 data, rendering the existing differential<br>
> path collision attacks useless... as far as I know, nobody has done<br>
> this yet).<br>
> <br>
> Preventing the use of Template Haskell is another aspect that<br>
> lambdabot relies on.<br>
> <br>
> Nowadays, lambdabot (as deployed on Freenode) also uses a sandbox for<br>
> evaluation, but I'm thinking of that as a second line of defense<br>
> rather than the primary mechanism for keeping things safe.<br>
> <br>
> So I'd be sad to see SafeHaskell go away.<br>
> <br>
> Cheers,<br>
> <br>
> Bertram<br>
> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> To (un)subscribe, modify options or view archives go to:<br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
> Only members subscribed via the mailman list are allowed to post.<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div></div>