Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→
Page 1 .. 347 348 349 350 351 352 353 354 355 356 357 .. 17992
1,799,132 events total
2021-06-08 19:48:38 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-06-08 19:48:41 <geekosaur> Ariakenom, that depends. I think foreign export writes C stubs
2021-06-08 19:49:14 <safinaskar> maybe there exists some hacky solution? for example, some small haskell subset, which allows conversion to rust?
2021-06-08 19:49:48 <safinaskar> i don't need compatibility with existing code. so, it is okey if rust will be no-quite-rust and haskell will be not-quite-haskell
2021-06-08 19:50:40 <monochrom> I wouldn't count on "without using C code" to mean it very literally.
2021-06-08 19:51:53 <monochrom> I would look for what's common between Haskell FFI and Rust FFI.
2021-06-08 19:53:34 c_l_ste joins (~celeste@ip68-12-146-37.ok.ok.cox.net)
2021-06-08 19:56:42 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 250 seconds)
2021-06-08 19:57:37 <edmundnoble_> I have some code, versions 1 and 2. Version 2 uses six times as much space and takes twice as long as version 1, according to criterion, the `-s` option, and top. I figured I'd try to narrow down the cause by using the profiler; but when I use profiling, version 1 and 2 both use almost the exact same amount of space, divided up in the same way
2021-06-08 19:57:41 <edmundnoble_> Does this observation at all narrow down the possible causes? Versions 1 and 2 should have the same performance by my reckoning
2021-06-08 19:59:12 × awth13 quits (~awth13@user/awth13) (Remote host closed the connection)
2021-06-08 19:59:44 × fluffyballoon quits (~fluffybal@2620:72:0:6480::10f7) (Quit: Client closed)
2021-06-08 20:00:07 × ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
2021-06-08 20:02:19 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2021-06-08 20:02:34 fluffyballoon joins (~fluffybal@2620:72:0:6480::10f7)
2021-06-08 20:03:09 <[exa]> safinaskar: rust's types have much more defined memory representation, if you really want to do that, I suggest just passing through a pointer to a rust-style data structure and reading/reserializing it in haskell
2021-06-08 20:03:35 <amirouche> a pipe
2021-06-08 20:03:38 <[exa]> (in short, I'd much rather interpret rust data in haskell than haskell data in rust)
2021-06-08 20:03:59 <[exa]> also yes, unixy solutions are the best, thanks amirouche
2021-06-08 20:05:43 × juhp quits (~juhp@128.106.188.66) (Ping timeout: 264 seconds)
2021-06-08 20:06:04 <safinaskar> okey
2021-06-08 20:06:11 <Ariakenom> ... are either of them defined?
2021-06-08 20:06:29 <safinaskar> i still think that translator from subset of haskell to rust would be valuable project
2021-06-08 20:07:06 <safinaskar> it will allow combine haskell and rust in same project and get access to big rust package repo and get rust speed with haskell guarantees and beaty
2021-06-08 20:07:08 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-06-08 20:07:10 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
2021-06-08 20:07:14 <[exa]> safinaskar: that might be the ML languages. :D
2021-06-08 20:07:41 juhp joins (~juhp@128.106.188.66)
2021-06-08 20:07:43 <[exa]> check out CakeML, you might like that one
2021-06-08 20:07:52 <safinaskar> [exa]: ocaml has even fewer packages than haskell (and of course fewer than rust)
2021-06-08 20:07:56 <tomsmeding> edmundnoble_: and in absolute sense? Is the performance with profiling closer to the non-profiling version 1 or 2?
2021-06-08 20:08:27 × nilof quits (~olofs@90-227-86-119-no542.tbcn.telia.com) (Ping timeout: 252 seconds)
2021-06-08 20:08:28 <safinaskar> [exa]: go open ocaml list of packages: https://opam.ocaml.org/packages/ . the page loads in one second on my computer
2021-06-08 20:08:29 <edmundnoble_> The performance with profiling is not directly comparable to that without profiling
2021-06-08 20:08:36 <edmundnoble_> It's several orders of magnitude slower
2021-06-08 20:08:41 <edmundnoble_> If that's what you mean
2021-06-08 20:08:50 <safinaskar> [exa]: compare this with http://hackage.haskell.org/packages/
2021-06-08 20:08:55 <[exa]> safinaskar: well if you define a language by number of packages, you might as well check out NPM
2021-06-08 20:09:03 <tomsmeding> edmundnoble_: ah right
2021-06-08 20:09:28 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:90fb:e693:9986:91e0) (Remote host closed the connection)
2021-06-08 20:09:52 <tomsmeding> edmundnoble_: I expect that the difference between 1 and 2 is how much gets inlined where, and how much optimisations that triggers
2021-06-08 20:09:55 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:90fb:e693:9986:91e0)
2021-06-08 20:10:00 × emliunix__ quits (~emliunix@198.144.166.57) (Remote host closed the connection)
2021-06-08 20:10:03 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
2021-06-08 20:10:18 emliunix__ joins (~emliunix@198.144.166.57)
2021-06-08 20:10:22 <safinaskar> haskell and rust has enough packages. ocaml - not
2021-06-08 20:10:29 <tomsmeding> profiling adds instrumentation in lots of places, which affects (mostly prevents) inlining -- and that has a strong impact on performance
2021-06-08 20:11:10 <dminuoso> 21:57:33 safinaskar | [19:43:03] is it possible to use haskell and rust in same project without using c code between?
2021-06-08 20:11:14 <dminuoso> This is how .NET was born. :p
2021-06-08 20:12:10 × myShoggoth quits (~myShoggot@97-120-89-117.ptld.qwest.net) (Ping timeout: 258 seconds)
2021-06-08 20:12:29 <edmundnoble_> Mmmkay, so profiling is preventing whatever optimization is responsible for version 1's performance, perhaps, and this optimization improves both space and time usage
2021-06-08 20:12:32 <dminuoso> This type of interoperability only works when the languages/reference implementations are under your control, so you can specify how that interop even means.
2021-06-08 20:12:58 × kmein quits (~weechat@user/kmein) (Quit: ciao kakao)
2021-06-08 20:13:01 × oak- quits (~oakuniver@2001:470:69fc:105::fcd) (Quit: Reconnecting)
2021-06-08 20:13:03 <tomsmeding> edmundnoble_: I'm not sure if that's it, but at least it's consistent with the observations you've written down here :p
2021-06-08 20:13:05 <dminuoso> For languages with very different semantics designed and controlled by different people, C FFI is the only thing you have since that gives you a well defined FFI that everybody else can target
2021-06-08 20:13:13 <[exa]> safinaskar: still, one could easily say that it is the rust-compatible subset of haskell
2021-06-08 20:13:20 oak- joins (~oakuniver@2001:470:69fc:105::fcd)
2021-06-08 20:13:38 kmein joins (~weechat@user/kmein)
2021-06-08 20:14:07 <safinaskar> [exa]: it seems cakeml doesn't have package repo at all. (i opened cakeml.org, then tried to find words "package" and "repo" using ctrl-f)
2021-06-08 20:14:14 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:90fb:e693:9986:91e0) (Ping timeout: 245 seconds)
2021-06-08 20:14:49 <[exa]> that's good
2021-06-08 20:15:00 nilof joins (~olofs@90-227-86-119-no542.tbcn.telia.com)
2021-06-08 20:15:05 <pavonia> In parser combinators, how do you best deal with input like <start><message><end> where you only know at <end> how to parse the message? I would prefer to not have multiple look-ahead passes over the message to find the kind of <end> tag
2021-06-08 20:15:22 <dolio> Well, Rust could publish some kind of stable foreign interface other than the C one, but they don't.
2021-06-08 20:16:00 <[exa]> pavonia: if you can eat message as a bytestring or something and then parse it, I really suggest having 2-level parsing structure
2021-06-08 20:16:30 <dolio> I guess the question is what it would contain in addition to the C one that is worth it.
2021-06-08 20:16:55 <edmundnoble_> You will ultimately have multiple passes, pavonia, unless you parse it backwards I suppose
2021-06-08 20:17:33 <[exa]> that reminds me the cool paper on pika parsers that actually run backwards
2021-06-08 20:17:40 <pavonia> [exa]: By two levels you mean like tokenization and real parsing?
2021-06-08 20:18:36 <[exa]> not necessarily tokenization, but yeah, first take out the message raw, then parse it when you're sure where it should end
2021-06-08 20:19:48 <[exa]> safinaskar: anyway, why avoid C so much? it's going be somewhere in the way no matter what you'll do, unless you plan to rewrite significant portions of both languages' FFIs
2021-06-08 20:20:31 <geekosaur> not to mention the question of whether they both even represent something like "Maybe Int" the same way
2021-06-08 20:20:33 <davean> [exa]: to be fair, Haskell doesn't really care about Cness, it cares about ABI
2021-06-08 20:20:36 <davean> you can just match on that
2021-06-08 20:20:45 <pavonia> Hhm, I would need to somehow fake the starting position of the message string parsing then, I guess
2021-06-08 20:22:01 × AgentM quits (~agentm@pool-162-83-130-212.nycmny.fios.verizon.net) (Quit: Leaving.)
2021-06-08 20:22:45 × mikoto-chan quits (~mikoto-ch@ip-213-49-189-31.dsl.scarlet.be) (Ping timeout: 252 seconds)
2021-06-08 20:23:06 <Ariakenom> geekosaur the answer is no
2021-06-08 20:23:21 <geekosaur> I figured as much
2021-06-08 20:24:20 <[exa]> davean: fair point
2021-06-08 20:24:38 myShoggoth joins (~myShoggot@97-120-89-117.ptld.qwest.net)
2021-06-08 20:24:39 <safinaskar> [exa]: okey, let me describe my real task. i want to write prover. i could implement it either in haskell or in rust. but both methods has disadvantageous. Pure Haskell is bad, because sometimes i need ST monad and so I end up with *very* ugly ST monad code. Pure rust is bad, too, because it is too verbose. So I want somehow combine two langs in
2021-06-08 20:24:40 <safinaskar> same project. I want to pass algebraic data structures directly between langs. If it is not possible, then i would better simply stick to one language
2021-06-08 20:24:48 <davean> [exa]: The docs sure look C-ish! but thats kinda a side detail
2021-06-08 20:24:54 <davean> I bet rust can export C-ish
2021-06-08 20:24:57 <davean> and you can just match that
2021-06-08 20:25:03 <davean> I'm not saying its a "good" approach
2021-06-08 20:25:24 <[exa]> safinaskar: symbolic theorem prover or something more involved?
2021-06-08 20:25:25 <safinaskar> i want write most code in haskell and resort to rust in places where i overwise would use st monad
2021-06-08 20:25:42 <safinaskar> [exa]: i don't understand question
2021-06-08 20:25:54 <[exa]> "prover" is a pretty wide category of things
2021-06-08 20:25:59 × fluffyballoon quits (~fluffybal@2620:72:0:6480::10f7) (Quit: Client closed)
2021-06-08 20:26:03 <Ariakenom> haskell: pointer to heap to maybe data which includes more than just the tag (also an info table). and then another pointer to int data that also has the same fluff
2021-06-08 20:26:07 <safinaskar> [exa]: i want to write proof checker with additional ability for trivial proof search
2021-06-08 20:26:14 <dolio> Is writing a ton of FFI and marshalling code really going to be less ugly than ST?
2021-06-08 20:26:28 <orzo> i'd like to see a low-level bootstrapped prover written in something like forth or assembly
2021-06-08 20:26:31 <Ariakenom> rust: stack allocated with a tag and an int. no pointers
2021-06-08 20:27:16 <orzo> safinaskar: ever consider that?
2021-06-08 20:27:53 <orzo> as a way of making code auditable

All times are in UTC.