companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.12 released: https://ocaml.org/releases/4.12.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
zebrag has joined #ocaml
waleee has quit [Ping timeout: 272 seconds]
wilfred has quit [Quit: Connection closed for inactivity]
mbuf has joined #ocaml
riverdc has joined #ocaml
Izem has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
gravicappa has joined #ocaml
vicfred has joined #ocaml
vicfred has quit [Quit: Leaving]
<riverdc> anyone know how to tell dune (which is using ocamlfind) to search additional directories for libraries, like gcc's -I / -L
<riverdc> nevermind, solved
wilfred has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
bartholin has joined #ocaml
Izem has quit [Quit: Izem]
mro has joined #ocaml
favonia has quit [Ping timeout: 272 seconds]
rks`_ is now known as rks`
glassofethanol has joined #ocaml
mro has quit [Remote host closed the connection]
olle has joined #ocaml
wilfred has quit [Quit: Connection closed for inactivity]
Kakadu has joined #ocaml
berberman_ has quit [Ping timeout: 252 seconds]
berberman has joined #ocaml
neiluj has joined #ocaml
<neiluj> Hello! Trying to implement a cat program. I hesitate between using Stdio.In_channel high level functions, or just low-level open and write system calls.
<neiluj> Is Stdio comparable to fopen,fread and such, like in C?
<neiluj> The idea is to read the file by chunks, write them in a buffer
mro has joined #ocaml
mro has quit [Ping timeout: 240 seconds]
andreypopp has joined #ocaml
andreypopp_ has quit [Read error: Connection reset by peer]
favonia has joined #ocaml
<d_bot> <darrenldl> should be comparable
<d_bot> <darrenldl> (and easier to use)
<neiluj> working with in_channel is indeed, thanks :)
<neiluj> *easier
andreypopp_ has joined #ocaml
<Armael> https://icfp21.sigplan.org/home/ocaml-2021 it looks like the list of accepted presentations for the ocaml workshop is online :)
andreypopp has quit [Ping timeout: 272 seconds]
Guest72 has joined #ocaml
Guest72 is now known as rond_
PinealGlandOptic has quit [Quit: leaving]
Melantha has joined #ocaml
Putonlalla has joined #ocaml
andreypopp_ has quit [Read error: Connection reset by peer]
andreypopp has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 265 seconds]
<d_bot> <Ulugbek> @companion_cube I was wondering whether you have compared `Iter` to janestreet's `Base.Sequence` (`Iter` repo compares it to stdlib and gen, but no Base.Sequence)
mbuf has quit [Quit: BRB]
rond_ has quit [Ping timeout: 246 seconds]
<d_bot> <mbacarella> Just a quick reminder. The OCaml Cafe is in two days.
waleee has joined #ocaml
olle has quit [Ping timeout: 252 seconds]
favonia has quit [Quit: Leaving]
Guest72 has joined #ocaml
Izem has joined #ocaml
Izem has left #ocaml [Good Bye]
glassofethanol has quit [Quit: leaving]
<companion_cube> @ulugbek yes, a long time ago
<companion_cube> https://simon.cedeela.fr/assets/talks/sequence.pdf an old talk about Iter in 2014 btw (when it was called "sequence")
<companion_cube> neiluj: the stdlib also has in_channel
<companion_cube> Stdio is just the janestreet version
troydm has quit [Ping timeout: 245 seconds]
mbuf has joined #ocaml
mbuf has quit [Quit: Leaving]
Guest72 has quit [Ping timeout: 246 seconds]
neiluj has quit [Remote host closed the connection]
neiluj has joined #ocaml
<neiluj> companion_cube, right
Tuplanolla has joined #ocaml
<d_bot> <tjammer> Doing a phd in CS sounds like a lot of fun
<companion_cube> it can be!
<d_bot> <tjammer> I got into coding late, when I was already doing physics. With a better CS teacher in school, I might have a CS degree now 😄
neiluj has quit [Ping timeout: 245 seconds]
Anarchos has joined #ocaml
<Anarchos> pour compiler dune j'ai besoin de lwt, pour installer lwt par opam j'ai besoin de dune....
<Anarchos> je tourne en rond dans le désert...
<companion_cube> dune doesn't need lwt.
<daimrod> my understanding is that it can't find the Cstubs module, but it's provided by ctypes (https://github.com/ocamllabs/ocaml-ctypes/tree/master/src/cstubs)
<Anarchos> companion_cube otherlibs/dune-rpc-lwt ...
<companion_cube> everything is vendored
<companion_cube> you should not need lwt
<daimrod> ok found it, sorry for the noise. The proper dependency name is ctypes.stubs, but I was trying variations around ctypes.cstubs. I found it by looking at the .opam file: https://github.com/ocamllabs/ocaml-ctypes/blob/master/ctypes-foreign.opam#L44
<Anarchos> companion_cube i had to pin dune to my lcoal folder. i don't know how dune-rpc-lwt comes into play there
<companion_cube> you probably should try to ask the dune people
<companion_cube> or read the build instructions for building dune from source
mro has joined #ocaml
mro has quit [Ping timeout: 265 seconds]
neiluj has joined #ocaml
jsoo has joined #ocaml
<Anarchos> companion_cube is there a #dune channel ?
<d_bot> <NULL> There is on Discord
<jsoo> hello ocamlers, i had a question about the ctypes library. I'm trying to define a bitwise enum like this: http://paste.debian.net/1206378/
<Anarchos> NULL thanks, but i am not sure to be able to use Discord on my OS
<jsoo> I would love to read the value of a constant as this _almost_ works
<d_bot> <NULL> Anarchos you can always use the webapp version (if your OS supports graphical web browsers)
xorpse has joined #ocaml
<Anarchos> null yes i can access to a browser based on webkit
<d_bot> <monk> i wonder if i can wrap around opal the useful error checking you see in the other parser libs, eg c-cube's CCParse
<d_bot> <monk> i presume that's just a bunch of monad juggling
<d_bot> <monk> don't really need it now but it would be extremely useful later for minor debugging
<d_bot> <monk> i really like how you approached error handling in it, @companion_cube
<d_bot> <monk> `<?>` is especially a nice touch
<d_bot> <monk> i used a similar combinator in Nom
<d_bot> <monk> to provide error info throughout the parse tree etc
<companion_cube> @monk there's a PR with significant changes to it btw
<companion_cube> if you're interested
<companion_cube> trying to make it closer to scanf in some ways (like simple parsers, with a lot of string splits)
<d_bot> <monk> 👀
<companion_cube> <?> is inspired from parsec btw
<d_bot> <monk> yeah realizing parsec really is the standard
<companion_cube> it's just what I knew from some years ago
<d_bot> <monk> i'm weird and got into parser combinators through Nom which didn't make any explicit refs to it directly (though I knew it existed)
<companion_cube> (had "real world haskell" as my intro to FP 😂)
<d_bot> <monk> lol
<d_bot> <monk> now i work with a C-based parser combinator library which is...... interesting!
<Corbin> Why does this program blow the stack when called with, say, 1_000_000 and 1_000_000 as arguments? I know that, as a matter of coding, it will take a long time (perhaps even a fraction of a second!) but it shouldn't overflow the stack right? https://bpa.st/7T2Q
<Corbin> If I ask it for 100_000 and 100_000, it returns 200_000 instantly. I was rather hoping that this design would be iterative.
<Corbin> I did ask for a backtrace, and it is dozens of: Called from Add.compose in file "add.ml", line 2, characters 22-27
xorpse has quit [Quit: ZZZzzz…]
<companion_cube> compose is not tail call in `f`, I imagine
xorpse has joined #ocaml
<Corbin> Yeesh. Yeah, and how could it be? That's frustrating. I was really hoping that flambda would be able to fuse basic compositions like that, but I guess not.
<companion_cube> hmm flambda isn
<companion_cube> isn't optimizing the same way GHC does
<Corbin> Well, that's demoralizing. Would pointing the code help? Like, changing (compose apply succ) to (fun xy -> succ (apply xy))? Would my earlier plan of Malfunction or directly generating bytecode make sense, or would it have the same obstacles?
_whitelogger has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
<Corbin> Ooh, unboxing closures might be important. I'm rereading https://ocaml.org/manual/flambda.html now.
xorpse has quit [Quit: ZZZzzz…]
<companion_cube> yeah, this makes a difference
<Corbin> Oho, "manual control of inlining and specialisation" sounds good too. I've had to work with a toolkit that required that (RPython); it's not so bad.
<companion_cube> I put a lot of [@inline] in my code, not sure to what extend it helps
<companion_cube> I mean it does, but how much I'm not sure
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
oriba has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<Corbin> companion_cube: Oh, stupid question: In Haskell there's an extensional difference between `f x y = ...` and `f x = \y -> ...` which the inliner can see, even though they have the same type. Do I need to play the same sort of game here, perhaps?
<companion_cube> most likely
<companion_cube> ah wait
<companion_cube> there's a difference between `f x = (partial application)`
<companion_cube> and `f x y = (…) y`
<companion_cube> but `let f x y = …` and `let f x = fun y -> …` are the same (one is sugar for the other)
gravicappa has quit [Ping timeout: 276 seconds]
<Corbin> Aha, and partial applications can't be fully specialized. Makes sense.
<companion_cube> there's also [@unroll] which can be super useful
mro has quit [Ping timeout: 240 seconds]
mro has joined #ocaml
<neiluj> Is it worth learning Haskell once you're comfortable with OCaml?
<neiluj> I've been following the make your own lisp in Haskell, the syntax is a bit lighter.
xorpse has joined #ocaml
troydm has joined #ocaml
mro has quit [Quit: Leaving...]
xorpse has quit [Quit: ZZZzzz…]
<d_bot> <Shon F> I just had a project that went from building fine to failing with `Fatal error: exception End_of_file` when I try to `dune build` and I have no idea what I've done.
<d_bot> <Shon F> Anyone hit this?
<d_bot> <Shon F> Here's the full error:
<d_bot> <Shon F> ``` ocamlopt lib/abt.cmxs (exit 2)
<d_bot> <Shon F> (cd _build/default && /home/sf/.opam/4.12.0/bin/ocamlopt.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -shared -linkall -I lib -o lib/abt.cmxs lib/abt.cmxa)
<d_bot> <Shon F> Fatal error: exception End_of_file
<d_bot> <Shon F> ```
<neiluj> looks like you're trying reading past the end of a file, no?
<d_bot> <Shon F> This is maddening. I've tried a fresh reinstallation of my opam switch..
<d_bot> <Shon F> This is happening during compilation.
<d_bot> <Shon F> That is indeed the exception, but not because of code I'm executing. I'm just trying to build the project.
<neiluj> Arf..
<d_bot> <Shon F> oh wow...
<d_bot> <Shon F> Your question helped, neiluj.
<neiluj> did you solved it?
<d_bot> <Shon F> I removed a single commented out out line at the bottom of a module, and the failure went away.
<d_bot> <Shon F> So maybe a bug in ocamlopt?
<d_bot> <Shon F> Bah, now I have to try to debug the toolchain instead of working on my toy.
<d_bot> <Shon F> Yes, solved. Thanks!
<neiluj> congrats :) but it's really weird tho indeed
<d_bot> <Shon F> Omg, yeah, this is totally bizarre. I'm just tried to reproduce by adding a minimal example, and it seems the addition of a separate file in my project makes the problem go away...
<d_bot> <Shon F> Seems to be a heizenbug.
<neiluj> 🐞
<d_bot> <Shon F> So, from looking at a few issues, it seems to me this is what a segfault looks like from some the tooling?
nd__ has quit [Ping timeout: 272 seconds]
<neiluj> Maybe open an issue at https://github.com/ocaml/ocaml/issues?
bartholin has quit [Quit: Leaving]
zebrag has joined #ocaml
<d_bot> <Et7f3> Does this happen with trunk ocaml ?
nd__ has joined #ocaml
nd__ has quit [Ping timeout: 272 seconds]
neiluj has quit [Remote host closed the connection]
neiluj has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
<d_bot> <Shon F> I'll check it happens on trunk.
<d_bot> <Shon F> bah, anyone know off hand how to fix:
<d_bot> <Shon F> ```
<d_bot> <Shon F> [ERROR] Could not resolve set of base packages:
<d_bot> <Shon F> The following dependencies couldn't be met:
<d_bot> <Shon F> - ocaml-variants → ocaml-beta
<d_bot> <Shon F> unmet availability conditions: enable-ocaml-beta-repository
<d_bot> <Shon F> ```
<d_bot> <Shon F> When trying to install ocaml trunk? I've hit two dead ends on google already.
<d_bot> <Shon F> Tried https://github.com/ocaml/ocaml-beta-repository, which is also not working.
<d_bot> <Shon F> I'll see about revisiting these toolchain errors later in the week. I'm afraid my times all sunk for now.
<d_bot> <Shon F> In case anyone is terribly curious, here's the commit where the error seems to be reproducible: https://github.com/shonfeder/um-abt/commit/b04754396a7cfe60dbbc72c7bc38253b8f52a161
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
neiluj has quit [Quit: Leaving]