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 :)
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.
<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>
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.
<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?