halogenandtoast has quit [Read error: Connection reset by peer]
granttrec has quit [Quit: granttrec]
jao has quit [Ping timeout: 260 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
ratschance has quit [Remote host closed the connection]
ratschance has joined #ocaml
pierpa has quit [Quit: Page closed]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
halogena1dtoast is now known as halogenandtoast
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 268 seconds]
hdon has joined #ocaml
kvda has joined #ocaml
kvda has quit [Client Quit]
hdon has quit [Changing host]
hdon has joined #ocaml
kvda has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
seliopou has quit [Ping timeout: 248 seconds]
hdon has quit [Ping timeout: 265 seconds]
hdon has joined #ocaml
jave has quit [Ping timeout: 264 seconds]
shinnya has joined #ocaml
jave has joined #ocaml
hdon has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 264 seconds]
hdon has joined #ocaml
seliopou has joined #ocaml
jbrown has quit [Ping timeout: 260 seconds]
hdon has quit [Ping timeout: 268 seconds]
leah2 has quit [Ping timeout: 240 seconds]
shinnya has joined #ocaml
leah2 has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nullifidian has quit [Remote host closed the connection]
tarptaeya has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
JimmyRcom_ has joined #ocaml
jimmyrcom has quit [Ping timeout: 248 seconds]
kvda has joined #ocaml
JimmyRcom_ has quit [Ping timeout: 260 seconds]
pierpal has quit [Ping timeout: 264 seconds]
mbuf has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
sagotch has joined #ocaml
freyr69 has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mk9 has joined #ocaml
mk9 has quit [Client Quit]
kvda has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Client Quit]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
mk9 has joined #ocaml
argent_smith has joined #ocaml
mk9 has quit [Quit: mk9]
jaar has joined #ocaml
dhil has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jao has joined #ocaml
halogenandtoast has quit [Ping timeout: 255 seconds]
malina has joined #ocaml
mfp has joined #ocaml
malina has quit [Ping timeout: 248 seconds]
jao has quit [Ping timeout: 256 seconds]
mk9 has joined #ocaml
mk9 has quit [Client Quit]
<sspi__>
CMM question: Is there a way to know what kind of int a Cextcall operation turns?
mk9 has joined #ocaml
<def`>
No, there is no such information at that level.
<def`>
(By kind I assume you mean tagged or untagged)
mk9 has quit [Client Quit]
halogena1dtoast has joined #ocaml
zolk3ri has joined #ocaml
<sspi__>
def`: I need to know if it's an int64 - otherwise I probably need to drop int64 support for wasm 32 bit
<sspi__>
maybe I'm trying too hard to use int32, perhaps I can use int64 operations always - need to check if that's possible
reynir is now known as r4r
sagotch has quit [Ping timeout: 240 seconds]
ziyourenxiang has joined #ocaml
frefity has joined #ocaml
<sspi__>
think that will work :)
r4r is now known as reynir
frefity has quit [Quit: Ex-Chat]
pierpal has joined #ocaml
pierpal has quit [Client Quit]
pierpal has joined #ocaml
malina has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
pierpal has joined #ocaml
Haudegen has quit [Read error: Connection reset by peer]
sagotch has joined #ocaml
dhil has quit [Ping timeout: 256 seconds]
mk9 has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
jbrown has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
Haudegen has joined #ocaml
dhil has joined #ocaml
nullifidian has joined #ocaml
JimmyRcom_ has joined #ocaml
JimmyRcom_ has quit [Ping timeout: 260 seconds]
pierpal has quit [Quit: Poof]
jao has joined #ocaml
pierpal has joined #ocaml
<sagotch>
if I have a `type t = A | B | C of t`, is there a difference in perfs between writing all my function as recursive like `let rec fn = function ... | C x -> fn x`, or should I prefer the use of `let rec unbox = function C x -> unbox x | x -> x ;; let fn x = match unbox x with A -> 1 | _ -> raise Not_found`?
mk9 has quit [Quit: mk9]
BitPuffin has joined #ocaml
<reynir>
uh, the 2nd one won't typecheck and they don't seem to be doing the same anyway
<sagotch>
No matter what they do, it was just a placeholder. A typical case is having function handling only one constructor while raising an exception for other, except one that have to be unboxed)
<sagotch>
(Also, it actually typechecks)
<sagotch>
A part of the question is: does a recursive function cost more than a non recursive one?
<companion_cube>
you could check the generated flambda, I suppose
<companion_cube>
but a non-recursive fast path might be more inlinable if C is not the common case
<sagotch>
Yes... I should probably check the generated code, but IRC was a easy solution for a lazy person ^^
<theblatte>
the answer is always to benchmark, but I'd expect the first version of your code to be just as fast thanks to tail-call optimisation
<discord>
<rizo> With flambda the function will be unrolled in some cases. It really depends on the concrete example. I also suggest either benchmarking it or looking at the generated code.
<sagotch>
the problem is that generated code one a simple example would probably not be what will happen in real world, I will try anyway
<reynir>
oh sorry, read it in the wrong order
<discord>
<rizo> sagotch: looking at the code again I think there shouldn't be any significant differences. Allocating the unbox function as a local closure could be more costly, but if it's defined in the module scope it should be fine.
<companion_cube>
kotlin has this neat `inline` tag on functional arguments, wish we had the same
Haudegen has quit [Remote host closed the connection]
<Drup>
I guess something like "let f (g[@inline]) x y z = .... ". It doesn't really work for now, but maybe it could
<companion_cube>
yeah well, if it doesn't work it's kind of pointless :D
<discord>
<rizo> IIRC, In Kotlin inline changes the semantics of the return statement making it a bit confusing.
dhil has quit [Ping timeout: 256 seconds]
<companion_cube>
but we don't have a `return` statment so it's all good ✔
<discord>
<rizo> Drup: but this should work: "let f g ...;; (f [@inlined]) g" – so it's more flexible.
tautologico has joined #ocaml
Haudegen has joined #ocaml
mbuf has quit [Quit: Leaving]
markoong has joined #ocaml
moei has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
moei has joined #ocaml
kini has quit [Remote host closed the connection]
wklm has joined #ocaml
freyr69 has quit [Remote host closed the connection]
jaiorg has joined #ocaml
<jaiorg>
Hi! I'm wondering how one can pattern match with a char as the 'condition'? I'm writing the tokenizer function for a compiler, and thought it would be fun to learn ocaml while at it
<jaiorg>
So trying to match over the current char
<ZirconiumX>
| 'a' ->
halogena1dtoast has quit [Ping timeout: 260 seconds]
<discord>
<rizo> You can also match a range of characters using match c with 'a'..'z' -> something | ....
<ZirconiumX>
jaiorg: you can also do `| 'a' .. 'z' ->` for a range of characters
<ZirconiumX>
Yeah
<jaiorg>
Ok. The line that is not working for me is this: `| 'λ' -> LambdaToken` and the error is pointing to the opening single quote, and the error is "Error: Syntax error: operator expected."
<ZirconiumX>
...OCaml has bad Unicode support
_whitelogger has joined #ocaml
sagotch has quit [Ping timeout: 265 seconds]
wklm_ has joined #ocaml
wklm_ has quit [Client Quit]
cryptocat1094 has joined #ocaml
wklm has quit [Ping timeout: 264 seconds]
jaiorg` has joined #ocaml
jaiorg` has left #ocaml [#ocaml]
jaiorg has quit [Ping timeout: 245 seconds]
argent_smith has quit [Quit: Leaving.]
sagotch has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
coventry2 has joined #ocaml
dedgrant_ has quit [Ping timeout: 268 seconds]
<discord>
<IwanKaramazow> Am I correct that the automaton state of the menhir parser is represtended by a Patricia tree?
tarptaeya has quit [Quit: Konversation terminated!]
hdon has joined #ocaml
sagotch has quit [Ping timeout: 240 seconds]
freyr69 has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
hdon has quit [Changing host]
hdon has joined #ocaml
malina has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 260 seconds]
cschneid has joined #ocaml
mnemem has quit [Ping timeout: 260 seconds]
larhat has joined #ocaml
mnemem has joined #ocaml
malina has joined #ocaml
dhil has joined #ocaml
malina has quit [Ping timeout: 268 seconds]
shinnya has joined #ocaml
cbot has joined #ocaml
cbot_ has quit [Ping timeout: 260 seconds]
jimmyrcom has joined #ocaml
yomimono has quit [Ping timeout: 268 seconds]
mnemem has quit [Quit: WeeChat 2.0.1]
malina has joined #ocaml
nullifidian has quit [Read error: Connection reset by peer]
nullifidian_ has joined #ocaml
neatonk has quit [Ping timeout: 255 seconds]
yomimono has joined #ocaml
neatonk has joined #ocaml
silver has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
zolk3ri has quit [Quit: Lost terminal]
<coventry2>
Why would `let module Html = Eliom_content.Html.R in 1;;` work, but not just `module Html = Eliom_content.Html.R` in the module top level, which gives a syntax error? Meanwhile, `module Html = Eliom_content.Html.D` in the module top level works just fine.