Logs: liberachat/#haskell
| 2025-12-19 09:54:37 | <merijn> | Because C++ doesn't have any ABI defined at all |
| 2025-12-19 09:54:37 | <haskellbridge> | <Liamzee> the worst part right now is that Cabal can't do this on its own, not without a custom Setup.hs |
| 2025-12-19 09:54:46 | <merijn> | Liamzee: What? |
| 2025-12-19 09:54:53 | <merijn> | What do you need a custom setup.hs for? |
| 2025-12-19 09:55:00 | <haskellbridge> | <Morj> I mean «modern» c++ with smart pointers and stuff. If we're talking c++ with manual memory management, that's terrible, but that's also terrible to use from c++ |
| 2025-12-19 09:55:04 | <haskellbridge> | <Liamzee> ? I had to generate a static build artifact from Cargo |
| 2025-12-19 09:55:06 | <haskellbridge> | <Liamzee> then copy paste |
| 2025-12-19 09:55:27 | <haskellbridge> | <Morj> "ABI" - yes, but you do the same thing and export unmangled functions with C abi in c++ |
| 2025-12-19 09:55:27 | <merijn> | Liamzee: Oh, cabal not being able to call cargo, yeah that's true |
| 2025-12-19 09:55:50 | <haskellbridge> | <Liamzee> I read that Rust has cbindgen |
| 2025-12-19 09:56:06 | <haskellbridge> | <Liamzee> I promised someone and I'll probably break the promise, to go give them FFI parquet support |
| 2025-12-19 09:56:10 | × | raym quits (~ray@user/raym) (Ping timeout: 245 seconds) |
| 2025-12-19 09:56:36 | <haskellbridge> | <Liamzee> so I took a look at Apache Arrow, and noped the hell out, am now considering whether I can do parquet-rs instead |
| 2025-12-19 09:58:07 | <merijn> | Liamzee: FWIW cabal is pretty well-behaved when you call it from, e.g. a Makefile |
| 2025-12-19 09:58:37 | <merijn> | I basically had a C++ + haskell project where I just had a makefile calling cabal to deal with building the haskell bits |
| 2025-12-19 09:58:54 | → | haritz joins (~hrtz@140.228.70.141) |
| 2025-12-19 09:58:54 | × | haritz quits (~hrtz@140.228.70.141) (Changing host) |
| 2025-12-19 09:58:54 | → | haritz joins (~hrtz@user/haritz) |
| 2025-12-19 09:59:58 | <merijn> | Liamzee: Anyway, I would generally *prefer* ccall over capi unless I specifically needed capi, for for example accessing CPP macros |
| 2025-12-19 10:01:43 | <haskellbridge> | <Liamzee> i mean if i'm just doing things with Rust artifacts |
| 2025-12-19 10:01:51 | <haskellbridge> | <Liamzee> I can probably live with ccall, right? |
| 2025-12-19 10:02:32 | <haskellbridge> | <Liamzee> still, so exciting, Haskell being a driver for Rust has been a dream of mine for years. I just thought it was black magic that required being at Serokell or Well-Typed to pull off |
| 2025-12-19 10:03:11 | → | raym joins (~ray@user/raym) |
| 2025-12-19 10:03:28 | <merijn> | Liamzee: The main difference is "ccall" directly generates code calling stuff according to C ABI. CAPI has GHC generating and compiling a C wrapper (using a C compiler) then calling that wrapper.Which is how it can access, e.g. CPP values, because the CPP is substituted in the generated C wrapper |
| 2025-12-19 10:03:39 | <merijn> | But that C wrapper is extra indirection |
| 2025-12-19 10:04:32 | <haskellbridge> | <Morj> What serokell or well-typed are writing is even more magic, where they want to automatically interoperate between haskell and rust types, and not have to write foreign imports and exports |
| 2025-12-19 10:04:38 | <haskellbridge> | <Liamzee> yup, i see the problem now, apparently GHCRTS and Rust will fight over ownership? |
| 2025-12-19 10:05:06 | <merijn> | Liamzee: You'll just have to manually and explicitly manage ownership |
| 2025-12-19 10:05:48 | <haskellbridge> | <Liamzee> But the problem is that I can't do it all from the Haskell side, no? I'd have to go into the rust, manually edit stuff so it doesn't take ownership. Ugh. |
| 2025-12-19 10:06:46 | <merijn> | Liamzee: I mean, in the haskell FFI you can manually do 'malloc' to get a pointer that doesn't get freed by Haskell in which case Rust can take ownership |
| 2025-12-19 10:08:39 | <haskellbridge> | <Morj> Rust also doesn't have a stable abi, so the functions you export from rust are only going to have C compatible arguments, which are all Copy, so the ownership semantics happen a layer deeper |
| 2025-12-19 10:09:31 | <haskellbridge> | <Liamzee> I mean in the Parquet case, this is looking as though it'd likely be a disaster, maybe I would have to go through the 2 million line Apache Arrow instead :( |
| 2025-12-19 10:09:47 | <haskellbridge> | <Liamzee> precisely, you DON'T want to copy |
| 2025-12-19 10:10:23 | <haskellbridge> | <Morj> Like, if you have two functions: one accepting a Box<T>, and another &T - they both will be exported as accepting _const T, and_const T is safe to copy |
| 2025-12-19 10:10:45 | <haskellbridge> | <Morj> Oops, my matrix client might have eaten the asterisks as the formatting |
| 2025-12-19 10:11:03 | <haskellbridge> | <Morj> *const T in both mentions |
| 2025-12-19 10:20:43 | × | Googulator71 quits (~Googulato@2a01-036d-0106-48e4-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-12-19 10:20:46 | → | Googulator50 joins (~Googulato@2a01-036d-0106-48e4-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) |
| 2025-12-19 10:20:48 | <merijn> | I can't imagine Rust not supporting a non-copying pointer in unsafe |
| 2025-12-19 10:21:09 | × | Lycurgus quits (~juan@user/Lycurgus) (Quit: alsoknownas.renjuan.org ( juan@acm.org )) |
| 2025-12-19 10:22:42 | <merijn> | Something like this SO answer? https://stackoverflow.com/questions/54849928/how-can-one-force-rust-to-take-ownership-of-memory-allocated-other-than-by-its-s/54858033#54858033 |
| 2025-12-19 10:25:08 | <merijn> | Similarly relevant? https://www.reddit.com/r/rust/comments/17r7hf6/comment/k8h4hpw/ |
| 2025-12-19 10:30:55 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 250 seconds) |
| 2025-12-19 10:36:33 | × | tema quits (~tema@93.175.2.131) (Ping timeout: 272 seconds) |
| 2025-12-19 10:47:30 | × | marinelli quits (~weechat@gateway/tor-sasl/marinelli) (Quit: marinelli) |
| 2025-12-19 10:50:44 | → | Googulator23 joins (~Googulato@2a01-036d-0106-48e4-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) |
| 2025-12-19 10:50:49 | × | Googulator50 quits (~Googulato@2a01-036d-0106-48e4-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-12-19 10:53:31 | × | tromp quits (~textual@2001:1c00:3487:1b00:9c43:d0f8:e383:616c) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 2025-12-19 10:55:15 | × | trickard quits (~trickard@cpe-81-98-47-163.wireline.com.au) (Read error: Connection reset by peer) |
| 2025-12-19 10:55:28 | → | trickard_ joins (~trickard@cpe-81-98-47-163.wireline.com.au) |
| 2025-12-19 10:55:42 | → | tromp joins (~textual@2001:1c00:3487:1b00:9c43:d0f8:e383:616c) |
| 2025-12-19 11:01:52 | × | CiaoSen quits (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 244 seconds) |
| 2025-12-19 11:03:56 | → | mari-estel joins (~mari-este@user/mari-estel) |
| 2025-12-19 11:04:47 | → | marinelli joins (~weechat@gateway/tor-sasl/marinelli) |
| 2025-12-19 11:06:53 | trickard_ | is now known as trickard |
| 2025-12-19 11:07:39 | × | lucabtz quits (~lucabtz@user/lucabtz) (Ping timeout: 244 seconds) |
| 2025-12-19 11:18:19 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2025-12-19 11:20:49 | → | Googulator24 joins (~Googulato@80-95-87-105.pool.digikabel.hu) |
| 2025-12-19 11:20:50 | × | Googulator23 quits (~Googulato@2a01-036d-0106-48e4-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-12-19 11:21:35 | × | trickard quits (~trickard@cpe-81-98-47-163.wireline.com.au) (Read error: Connection reset by peer) |
| 2025-12-19 11:21:49 | → | trickard_ joins (~trickard@cpe-81-98-47-163.wireline.com.au) |
| 2025-12-19 11:23:15 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
| 2025-12-19 11:31:23 | → | lambda_gibbon joins (~lambda_gi@208.83.175.39) |
| 2025-12-19 11:35:33 | × | lambda_gibbon quits (~lambda_gi@208.83.175.39) (Ping timeout: 244 seconds) |
| 2025-12-19 11:36:24 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2025-12-19 11:41:37 | → | lucabtz joins (~lucabtz@user/lucabtz) |
| 2025-12-19 11:42:55 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
| 2025-12-19 11:45:36 | → | CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) |
| 2025-12-19 11:46:42 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2025-12-19 11:51:34 | → | acidjnk joins (~acidjnk@p200300d6e71719757debcd23ed4a65e1.dip0.t-ipconnect.de) |
| 2025-12-19 12:05:51 | → | Googulator54 joins (~Googulato@2a01-036d-0106-48e4-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) |
| 2025-12-19 12:05:54 | × | Googulator24 quits (~Googulato@80-95-87-105.pool.digikabel.hu) (Quit: Client closed) |
| 2025-12-19 12:07:22 | × | mari-estel quits (~mari-este@user/mari-estel) () |
| 2025-12-19 12:12:18 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 2025-12-19 12:14:34 | → | kmein joins (~weechat@user/kmein) |
| 2025-12-19 12:21:14 | × | tromp quits (~textual@2001:1c00:3487:1b00:9c43:d0f8:e383:616c) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 2025-12-19 12:26:11 | × | trickard_ quits (~trickard@cpe-81-98-47-163.wireline.com.au) (Read error: Connection reset by peer) |
| 2025-12-19 12:26:25 | → | trickard_ joins (~trickard@cpe-81-98-47-163.wireline.com.au) |
| 2025-12-19 12:28:32 | → | fp joins (~Thunderbi@2001:708:20:1406::1370) |
| 2025-12-19 12:35:54 | → | Googulator87 joins (~Googulato@2a01-036d-0106-48e4-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) |
| 2025-12-19 12:35:56 | × | Googulator54 quits (~Googulato@2a01-036d-0106-48e4-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-12-19 13:02:51 | → | internatetional joins (~nate@2404:c0:2029:708e:1:0:dce8:227d) |
| 2025-12-19 13:05:15 | × | chromoblob quits (~chromoblo@user/chromob1ot1c) (Ping timeout: 240 seconds) |
| 2025-12-19 13:05:30 | → | chromoblob joins (~chromoblo@user/chromob1ot1c) |
| 2025-12-19 13:10:52 | trickard_ | is now known as trickard |
| 2025-12-19 13:13:05 | → | xff0x joins (~xff0x@2405:6580:b080:900:2d2a:a485:c072:ffd2) |
| 2025-12-19 13:15:20 | × | trickard quits (~trickard@cpe-81-98-47-163.wireline.com.au) (Read error: Connection reset by peer) |
| 2025-12-19 13:15:34 | → | trickard_ joins (~trickard@cpe-81-98-47-163.wireline.com.au) |
| 2025-12-19 13:16:21 | <haskellbridge> | <Morj> Clueless me running nix profile upgrade on a friday, and being hit with https://github.com/NixOS/nixpkgs/issues/467614 |
| 2025-12-19 13:22:54 | × | hsw quits (~hsw@112-104-86-252.adsl.dynamic.seed.net.tw) (Read error: Connection reset by peer) |
| 2025-12-19 13:23:13 | → | hsw joins (~hsw@112-104-86-252.adsl.dynamic.seed.net.tw) |
| 2025-12-19 13:23:52 | × | confusedalex quits (~confuseda@user/confusedalex) (Remote host closed the connection) |
| 2025-12-19 13:24:20 | × | Igloo quits (~ian@81.2.99.210) (Quit: BIAW) |
| 2025-12-19 13:25:34 | → | somemathguy joins (~somemathg@user/somemathguy) |
| 2025-12-19 13:30:23 | → | deptype joins (~deptype@2406:b400:3a:2dd5:52e4:b3c5:3fcb:69bd) |
| 2025-12-19 13:33:07 | × | fp quits (~Thunderbi@2001:708:20:1406::1370) (Ping timeout: 265 seconds) |
| 2025-12-19 13:33:58 | × | chromoblob quits (~chromoblo@user/chromob1ot1c) (Read error: Connection reset by peer) |
| 2025-12-19 13:34:22 | → | chromoblob joins (~chromoblo@user/chromob1ot1c) |
| 2025-12-19 13:35:00 | → | fp joins (~Thunderbi@2001:708:150:10::7e06) |
| 2025-12-19 13:35:32 | × | Googulator87 quits (~Googulato@2a01-036d-0106-48e4-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed) |
All times are in UTC.