Newest at the top
2024-11-01 15:39:05 +0100 | <EvanR> | you can say that values in haskell change over time |
2024-11-01 15:38:29 +0100 | <EvanR> | but like, I can write to any object in haskell too |
2024-11-01 15:38:22 +0100 | <mauke> | I know 'const volatile foo' is explicitly permmitted |
2024-11-01 15:38:14 +0100 | <EvanR> | sure |
2024-11-01 15:38:12 +0100 | <mauke> | hold on, I need to check my standards |
2024-11-01 15:38:08 +0100 | <merijn> | EvanR: C programmers regularly break everything :p |
2024-11-01 15:37:49 +0100 | <EvanR> | unless you break everything, which you can do in haskell also |
2024-11-01 15:37:33 +0100 | <EvanR> | in C, that's a const double, it's not changing |
2024-11-01 15:37:31 +0100 | <merijn> | mauke: because modifying pi is UB |
2024-11-01 15:37:18 +0100 | <merijn> | mauke: tbf, it's actually sound |
2024-11-01 15:37:18 +0100 | <mauke> | const means read-only, not constant |
2024-11-01 15:37:10 +0100 | <merijn> | EvanR: Because const means nothing |
2024-11-01 15:37:03 +0100 | <EvanR> | how does const double pi change over time |
2024-11-01 15:36:30 +0100 | <mauke> | but that's unsound, since the value of pi can change over time |
2024-11-01 15:36:18 +0100 | <mauke> | is documented as letting you refer to const double pi = 3.14; |
2024-11-01 15:36:01 +0100 | <mauke> | huh. foreign import capi "pi.h value pi" c_pi :: CDouble |
2024-11-01 15:34:52 +0100 | <merijn> | It's been a long time xD |
2024-11-01 15:34:49 +0100 | <merijn> | or something |
2024-11-01 15:34:44 +0100 | <merijn> | mauke: There was a case where the import of a variable was ambiguous compared to a function returning a pointer |
2024-11-01 15:33:18 +0100 | <merijn> | can't check right now, since I have no GHC install on this machine |
2024-11-01 15:33:09 +0100 | <merijn> | (IFF you declare the header at the import) but that might be a lie |
2024-11-01 15:32:42 +0100 | <merijn> | mauke: CPP macros is capi only (but you can use both at the same time). The type checking I *thought* it also did for ccall |
2024-11-01 15:32:37 +0100 | <mauke> | importing addresses of variables is in the base FFI |
2024-11-01 15:32:13 +0100 | <merijn> | I'd prefer ccall where possible, but capi is a huge win. I think capi also lets you reference Ptr to variables directly (as opposed to only functions) |
2024-11-01 15:32:11 +0100 | <mauke> | I thought capi was what you were talking about when you mentioned CPP macros and checking against headers |
2024-11-01 15:31:20 +0100 | Square2 | (~Square4@user/square) (Ping timeout: 255 seconds) |
2024-11-01 15:31:19 +0100 | k_hachig_ | (~k_hachig@2607:fea8:351d:ef0:901a:fefb:e87f:78b3) (Ping timeout: 260 seconds) |
2024-11-01 15:31:16 +0100 | <merijn> | mauke: capi is nice for some things, though. Since it lets you foreign import CPP macros as values: https://github.com/merijn/Belewitte/blob/ed95965077ee0a55c9a206b75445ddf93723916b/benchmark-analys… |
2024-11-01 15:30:54 +0100 | <merijn> | capi is very different, since it generates stubs instead of calling directly from Haskell |
2024-11-01 15:30:37 +0100 | <merijn> | I thought it did |
2024-11-01 15:30:05 +0100 | <mauke> | I know capi does weird things |
2024-11-01 15:29:50 +0100 | <mauke> | for ccall? are you sure? |
2024-11-01 15:29:33 +0100 | <merijn> | (modulo marshalling as defined in the FFI part of the standard) |
2024-11-01 15:29:22 +0100 | Sgeo | (~Sgeo@user/sgeo) Sgeo |
2024-11-01 15:29:10 +0100 | <merijn> | mauke: https://github.com/merijn/Belewitte/blob/ed95965077ee0a55c9a206b75445ddf93723916b/benchmark-analys… |
2024-11-01 15:29:07 +0100 | <merijn> | mauke: It's been awhile, but iirc if you mention the header file on the foreign import it will check that the Haskell type you declare for it corresponds to the C type |
2024-11-01 15:28:11 +0100 | vgtw | (~vgtw@user/vgtw) vgtw |
2024-11-01 15:28:10 +0100 | <mauke> | er, yes |
2024-11-01 15:27:48 +0100 | <merijn> | mauke: "can" for the type checking, you mean? |
2024-11-01 15:27:29 +0100 | <mauke> | tomsmeding: the cp $(cabal list-bin yourexename) wherever method gives me a non-stripped executable |
2024-11-01 15:26:44 +0100 | k_hachig_ | (~k_hachig@2607:fea8:351d:ef0:901a:fefb:e87f:78b3) k_hachig |
2024-11-01 15:25:55 +0100 | <mauke> | define "can" |
2024-11-01 15:25:03 +0100 | <merijn> | Not to mention GHC being able to use CPP macros as values |
2024-11-01 15:24:45 +0100 | <merijn> | Which can be helpful for your sanity |
2024-11-01 15:24:36 +0100 | <merijn> | mauke: GHC can automatically check whether your declared types match the headers |
2024-11-01 15:24:06 +0100 | <merijn> | \o/ |
2024-11-01 15:23:23 +0100 | <mauke> | oh hello, executable stripping works if I turn it on in ~/.cabal/config |
2024-11-01 15:22:46 +0100 | <mauke> | technically I could probably just delete the header files because I'm pretty sure ghc doesn't care anyway |
2024-11-01 15:22:44 +0100 | tired | (~tired@user/tired) tired |
2024-11-01 15:21:46 +0100 | <mauke> | I don't have generated files, so for me it's all "sdist" in a sense |