Logs: freenode/#haskell
| 2021-04-18 08:31:58 | × | hinsley quits (4b891f5f@gateway/web/cgi-irc/kiwiirc.com/ip.75.137.31.95) (Ping timeout: 252 seconds) |
| 2021-04-18 08:32:04 | <gentauro> | if a package is unsafe, you can't mark it as safe. You can mark it as trustworthy |
| 2021-04-18 08:32:31 | <c_wraith> | that only gets you unsafe things from base |
| 2021-04-18 08:32:37 | <c_wraith> | what about other unsafe things? |
| 2021-04-18 08:33:55 | <gentauro> | c_wraith: https://gitlab.com/uniprocess/haskell-template/-/blob/master/pkg/uniprocess/package.yaml#L37-47 |
| 2021-04-18 08:34:11 | <gentauro> | this is how I trust packages that I want to use |
| 2021-04-18 08:34:44 | <c_wraith> | If you're trusting array, you've already got no safety |
| 2021-04-18 08:35:21 | × | nineonine quits (~nineonine@2604:3d08:7785:9600:68a6:8c79:2caf:5ce4) (Ping timeout: 258 seconds) |
| 2021-04-18 08:35:30 | → | mikoto-chan joins (~anass@gateway/tor-sasl/mikoto-chan) |
| 2021-04-18 08:35:47 | <gentauro> | c_wraith: how come? |
| 2021-04-18 08:36:00 | × | jao quits (~jao@pdpc/supporter/professional/jao) (Ping timeout: 265 seconds) |
| 2021-04-18 08:36:27 | × | T-Junk quits (~T-Junk@178.239.168.171) (Remote host closed the connection) |
| 2021-04-18 08:36:43 | <gentauro> | you understand that you are allowed to use FFI and code is still Safe right? http://blog.stermon.com/articles/2019/02/04/haskell-usage-of-malloc-free-is-safe.html |
| 2021-04-18 08:36:50 | <gentauro> | it's the way you expose your logic |
| 2021-04-18 08:37:34 | <gentauro> | in my snippet, I use a lot of FFI, but, since all my logic exposes IO in the signatures it's fine as the consumer will understand that something happens under the hood |
| 2021-04-18 08:38:35 | <gentauro> | what tends to happen with a lot of libraries is that `peeps` hide `IO`. Search (CTRL+F Main.hs) http://blog.stermon.com/articles/2019/02/09/haskell-bitonic-sorter-concurrent.html |
| 2021-04-18 08:39:23 | <gentauro> | you can see that I `remove` IO in `trust = unsafePerformIO . sort`. If I do this, I need to tell people using my logic that "I'm doing some `nasty` stuff under the hood, so be aware" |
| 2021-04-18 08:41:50 | × | lambdaman quits (~lambdaman@s66-183-152-156.bc.hsia.telus.net) (Ping timeout: 252 seconds) |
| 2021-04-18 08:45:35 | <gentauro> | tdammers: Hey, they really want to remove Safe Haskell :( https://old.reddit.com/r/haskell/comments/msa3oq/safe_haskell/guy6upc/ |
| 2021-04-18 08:46:24 | <gentauro> | tdammers: what is well-typed stand on this? :) |
| 2021-04-18 08:50:54 | → | JackSparrow joins (~JackSparr@139.28.218.148) |
| 2021-04-18 08:52:47 | → | Varis joins (~Tadas@unaffiliated/varis) |
| 2021-04-18 08:53:02 | × | jamestmartin quits (james@jtmar.me) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in) |
| 2021-04-18 08:53:19 | → | jamestmartin joins (james@jtmar.me) |
| 2021-04-18 08:56:51 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 2021-04-18 09:01:01 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-04-18 09:01:30 | → | hypercube joins (hypercube@gateway/vpn/protonvpn/hypercube) |
| 2021-04-18 09:01:37 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 265 seconds) |
| 2021-04-18 09:02:21 | → | rdivyanshu joins (uid322626@gateway/web/irccloud.com/x-ogmvxpqranhkqdsz) |
| 2021-04-18 09:03:19 | × | darjeeling_ quits (~darjeelin@115.215.40.116) (Ping timeout: 252 seconds) |
| 2021-04-18 09:03:21 | → | jumper149 joins (~jumper149@80.240.31.34) |
| 2021-04-18 09:03:43 | <Cale> | gentauro: By the way, it's not necessarily safe to compile (or load in ghci) Haskell code that is marked as safe using safe Haskell. One thing it can do is run an arbitrary preprocessor program that, for instance can be an included shell script. |
| 2021-04-18 09:03:46 | → | darjeeling_ joins (~darjeelin@115.215.40.116) |
| 2021-04-18 09:05:32 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds) |
| 2021-04-18 09:08:28 | <Cale> | So, Safe Haskell preventing Template Haskell from being used might be seen as a bit strange, given that you could run a shell script that compiles a separate Haskell program that does a source to source translation, and runs that program to transform the code. |
| 2021-04-18 09:09:06 | <nshepperd2> | how? ghc pragmas? |
| 2021-04-18 09:09:22 | <Cale> | {-# OPTIONS_GHC -F -pgmF foo.sh #-} |
| 2021-04-18 09:09:27 | <Cale> | yeah |
| 2021-04-18 09:09:47 | <nshepperd2> | seems like it should be relatively straightforward to turn those off |
| 2021-04-18 09:10:00 | <nshepperd2> | compare to, like, implementing all of SafeHaskell |
| 2021-04-18 09:12:06 | → | lambdaman joins (~lambdaman@s66-183-152-156.bc.hsia.telus.net) |
| 2021-04-18 09:12:12 | × | jess quits (jess@freenode/staff/jess) (Quit: back soon) |
| 2021-04-18 09:14:00 | <Cale> | Well, maybe... there are a bunch of potentially sneaky flags to look for though |
| 2021-04-18 09:14:19 | → | fendor joins (~fendor@178.165.130.27.wireless.dyn.drei.com) |
| 2021-04-18 09:14:34 | <nshepperd2> | i assume lambdabot doesn't let you do this |
| 2021-04-18 09:14:56 | <c_wraith> | lambdabot doesn't let you add pragmas at all |
| 2021-04-18 09:15:33 | × | freegraph quits (~freegraph@103.58.155.176) (Quit: Leaving) |
| 2021-04-18 09:16:03 | <nshepperd2> | perfect |
| 2021-04-18 09:16:32 | × | lambdaman quits (~lambdaman@s66-183-152-156.bc.hsia.telus.net) (Ping timeout: 240 seconds) |
| 2021-04-18 09:16:58 | <gentauro> | nshepperd2: I agree :) |
| 2021-04-18 09:17:23 | <gentauro> | Cale: if your project uses the -XSafe flag, you can't even start `ghci` ;) |
| 2021-04-18 09:17:24 | → | frozenErebus joins (~frozenEre@37.231.244.249) |
| 2021-04-18 09:17:46 | <gentauro> | when I do (ad-hoc) development, I need to comment the -XSafe flag … |
| 2021-04-18 09:18:30 | <Cale> | gentauro: I mean, you can still build a project that uses -XSafe, and ghc will interpret the {-# OPTIONS_GHC ... #-} pragmas in it |
| 2021-04-18 09:18:40 | <gentauro> | my understanding is that compiler flags will always overwrite file flags right? And you can allow/dissallow which pragmas can be used by a project |
| 2021-04-18 09:19:56 | <gentauro> | oh |
| 2021-04-18 09:20:13 | <gentauro> | and since `OPTIONS_GHC` can't be disallowed, |
| 2021-04-18 09:20:25 | <gentauro> | then a Safe file will execute a script? |
| 2021-04-18 09:20:31 | <Cale> | yep |
| 2021-04-18 09:20:35 | <gentauro> | wow, that is some bad desing |
| 2021-04-18 09:22:11 | <Cale> | Safe Haskell doesn't mean it's safe to compile the code, it means a bunch of random stuff which has to do with trying to make sure expression evaluation is referentially transparent... but which might be mistaken for stuff that has to do with making it safe to build the code, especially given TH being forbidden is one of the things it does. |
| 2021-04-18 09:23:48 | → | lambdaman joins (~lambdaman@s66-183-152-156.bc.hsia.telus.net) |
| 2021-04-18 09:24:04 | <nshepperd2> | the reddit post links to https://gitlab.haskell.org/ghc/ghc/-/issues/19590 but removing safe haskell doesn't really seem like it will solve the problem |
| 2021-04-18 09:24:49 | → | ClaudiusMaximus joins (~claude@cpc98210-croy26-2-0-cust137.19-2.cable.virginm.net) |
| 2021-04-18 09:24:49 | × | ClaudiusMaximus quits (~claude@cpc98210-croy26-2-0-cust137.19-2.cable.virginm.net) (Changing host) |
| 2021-04-18 09:24:49 | → | ClaudiusMaximus joins (~claude@unaffiliated/claudiusmaximus) |
| 2021-04-18 09:28:00 | <Cale> | Well, I haven't seen the reddit post, but yeah, the thing Ed's suggesting is a solution to one of the things that makes Safe Haskell annoying for package maintainers at least. |
| 2021-04-18 09:28:11 | × | lambdaman quits (~lambdaman@s66-183-152-156.bc.hsia.telus.net) (Ping timeout: 240 seconds) |
| 2021-04-18 09:28:26 | <Cale> | Removing Safe Haskell would be a more extreme solution to the annoyance, I suppose :P |
| 2021-04-18 09:28:33 | <nshepperd2> | i mean, ed filed the bug because he wants to use safe haskell |
| 2021-04-18 09:29:03 | <nshepperd2> | if he didn't want his code to work in irc bots and such he could just not use the extension at all |
| 2021-04-18 09:29:05 | <Cale> | Well, maybe, or he has users who want to use Safe Haskell at least. |
| 2021-04-18 09:29:11 | ← | thblt parts (~thblt@unaffiliated/thblt) ("ERC (IRC client for Emacs 28.0.50)") |
| 2021-04-18 09:29:37 | <Cale> | (I doubt he personally cares about it all that much, but I don't really know) |
| 2021-04-18 09:29:42 | <nshepperd2> | pointing to that bug as a reason to remove safe haskell seems deeply confused |
| 2021-04-18 09:31:08 | <gentauro> | wouldn't it be a fair approach, for all the `peeps` that don't want to use `Safe Haskell` to just mark all their work is `Unsafe`? |
| 2021-04-18 09:31:08 | × | Sgeo quits (~Sgeo@ool-18b98aa4.dyn.optonline.net) (Read error: Connection reset by peer) |
| 2021-04-18 09:31:09 | × | heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2021-04-18 09:31:22 | <gentauro> | I mean, if they don't care about safety, well that's what `unsafe` is for :) |
| 2021-04-18 09:31:35 | <Cale> | The deeper thing is that it's unclear to everyone what "safe" really ought to mean, including the designers of Safe Haskell. It's already a conglomerate of a few unrelated kinds of safety, and those kinds of safety don't necessarily imply what someone might be thinking of when they see the word "safe". |
| 2021-04-18 09:32:40 | <gentauro> | so my understanding from Taylor Fausak tweet a time ago on Safe Haskell was that only 2% of Haskellers care about Safe (or have heard of it) |
| 2021-04-18 09:33:05 | <Cale> | I don't know that removing it altogether is the right thing to do, but pulling it apart into some things that have more clearly-defined goals might make sense. |
| 2021-04-18 09:34:49 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-18 09:36:02 | <nshepperd2> | most of the machinery there seems to exist to prove the kind of safety where an Int is actually an Int and not a set of instructions for launching the missiles |
| 2021-04-18 09:36:10 | → | ddellacosta joins (~ddellacos@86.106.143.183) |
| 2021-04-18 09:36:35 | <nshepperd2> | it probably does make sense to separate "it's safe to compile this" into a separate feature |
| 2021-04-18 09:37:28 | <maerwald> | haskell can be made safe? |
| 2021-04-18 09:39:14 | <nshepperd2> | sure why not |
| 2021-04-18 09:39:20 | × | idhugo quits (~idhugo@87-49-147-45-mobile.dk.customer.tdc.net) (Ping timeout: 246 seconds) |
| 2021-04-18 09:40:30 | × | ddellacosta quits (~ddellacos@86.106.143.183) (Ping timeout: 252 seconds) |
| 2021-04-18 09:41:22 | <gentauro> | my understanding of Safe Haskell, still has to do with some `runtime` guarantees provided at compile time |
| 2021-04-18 09:41:29 | <Cale> | Also, with the way that it currently is, there are a lot of things which are "unsafe" which one might not care about so much when deciding what goes in the trusted set, but membership in the trusted set is all-or-nothing. |
| 2021-04-18 09:42:11 | <gentauro> | in the sense that: "when you run this, it wouldn't launch the missiles" and not so much "when you build this, it wouldn't launch the missiles" |
| 2021-04-18 09:42:15 | <gentauro> | right? |
| 2021-04-18 09:42:43 | × | drbean_ quits (~drbean@TC210-63-209-220.static.apol.com.tw) (Quit: ZNC 1.8.2+cygwin2 - https://znc.in) |
| 2021-04-18 09:43:03 | gentauro | the last sentence Cale just showed that with `OPTIONS_GHC` pragma, you can run stuff when compiling, but not at runtime |
| 2021-04-18 09:43:49 | <Cale> | So, if you think it's okay to trust package foo because you had a look at foo-1.0 and it just uses Data.Coerce a bit for the sake of performance, well, when foo-1.1 comes out and does an unsafePerformIO, you're already trusting it. |
| 2021-04-18 09:44:31 | <gentauro> | Cale: you can't mark a package at `trustworthy` if they don't expose `unsafePerformIO` ;) |
| 2021-04-18 09:44:42 | <gentauro> | that's what is happening with `Data.Text` |
| 2021-04-18 09:45:04 | <Cale> | hm? |
All times are in UTC.