adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
kvda has joined #ocaml
malina has quit [Ping timeout: 240 seconds]
zolk3ri has quit [Quit: leaving]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
halogenandtoast has joined #ocaml
granttrec has joined #ocaml
neatonk has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
halogena1dtoast has joined #ocaml
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?
wklm has joined #ocaml
<wklm> sorry
<companion_cube> p… python? :o
wklm has quit [Ping timeout: 265 seconds]
wklm_ has joined #ocaml
wklm___ has joined #ocaml
wklm_ has quit [Ping timeout: 256 seconds]
wklm___ has quit [Quit: leaving]
cbot has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Quit: mk9]
ziyourenxiang has quit [Ping timeout: 260 seconds]
mk9 has joined #ocaml
mk9 has quit [Client Quit]
cbot_ has joined #ocaml
cbot has quit [Ping timeout: 265 seconds]
al-damiri has joined #ocaml
Haudegen has quit [Remote host closed the connection]
hdon has joined #ocaml
dedgrant_ has joined #ocaml
dhil has joined #ocaml
jao has quit [Ping timeout: 256 seconds]
letoh has quit [Ping timeout: 240 seconds]
wagle has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
wagle has joined #ocaml
Haudegen has joined #ocaml
letoh has joined #ocaml
mnemem has joined #ocaml
hdon has quit [Ping timeout: 264 seconds]
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.
<coventry2>
<coventry2>
<coventry2> (This is under `eliomc`, not OCaml directly...)
<Drup> coventry2: client or server side ?
<coventry2> Server: `Makefile:223: recipe for target '_deps/frontend.eliom.server' failed`
<Drup> version of eliom ?
<coventry2> 6.3.0
<Drup> R should be defined both on the client and on the server
<coventry2> Yeah, it's defined to the extent that it's fine in `let ... in` syntax, but not for definition at the module toplevel.
<Drup> can you show your piece of code ?
<coventry2> Seems that during minimization I broke whatever was breaking things. Now I can't reproduce...
<coventry2> Thanks for your help.
jaar has quit [Ping timeout: 240 seconds]
l1x has quit [Quit: Connection closed for inactivity]
jnavila has joined #ocaml
letoh has quit [Ping timeout: 245 seconds]
dhil has quit [Ping timeout: 264 seconds]
cryptocat1094 has quit [Quit: later]
BitPuffin has quit [Remote host closed the connection]
coventry` has joined #ocaml
coventry2 has quit [Ping timeout: 260 seconds]
_andre has quit [Quit: leaving]
jao has joined #ocaml
kvda has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
freyr69 has quit [Remote host closed the connection]
jnavila has quit [Ping timeout: 240 seconds]
orbifx has joined #ocaml
<orbifx> how is everyone?
Denommus has joined #ocaml
Denommus has quit [Remote host closed the connection]
<yomimono> orbifx: Not_found
<orbifx> yomimono: hehe
<orbifx> being option? :P
Haudegen has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
pierpal has quit [Client Quit]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 256 seconds]
wilfredh has joined #ocaml
<wilfredh> I can see Str documented in https://caml.inria.fr/pub/docs/manual-ocaml/libref/Str.html, I can run 'open Str;;' without errors, but 'Str.split;;' says: Error: Reference to undefined global `Str'
<wilfredh> I'm clearly doing something stupid: why isn't Str in scope?
<wilfredh> (running everything in the interpreter currently)
<Armael> str is in a separate package now, I think
<Armael> if you're using utop you have to do #require "str";;
<Armael> (and otherwise indicate to your build system to load the "str" library)
<Armael> not sure why it somehow appears as partially loaded by default
<wilfredh> aha, that seems to work :)
<wilfredh> yeah, utop's completion offering Str confused me
<Armael> (btw, Str wouldn't be the recommended library for doing regexps, in particular its API is quite bad)
<Armael> (you should probably use re instead)
<wilfredh> I just want to split strings on "\n", " " and see if lines start with certain prefixes
<wilfredh> so Str.split seemed like a good candidate for the first two
<Armael> maybe use Astring then? I think it does this kind of stuff https://github.com/dbuenzli/astring
<wilfredh> Armael: thanks, I'll have a play with it :)
<Armael> cut/cuts and is_prefix should do what you want :)
<Armael> after a quick glance
ziyourenxiang has joined #ocaml
pierpa has joined #ocaml
pierpal has joined #ocaml
dedgrant has joined #ocaml
JimmyRcom_ has joined #ocaml
dedgrant_ has quit [Ping timeout: 260 seconds]
orbifx has quit [Ping timeout: 240 seconds]
larhat has quit [Quit: Leaving.]
halogena1dtoast has joined #ocaml
granttrec has joined #ocaml
ziyourenxiang has quit [Ping timeout: 256 seconds]
halogena1dtoast has quit [Ping timeout: 264 seconds]
wilfredh has quit [Ping timeout: 268 seconds]
markoong has quit [Ping timeout: 240 seconds]
granttrec has quit [Quit: granttrec]
lyxia has quit [Quit: WeeChat 2.1]
lyxia has joined #ocaml
pioneer42 has joined #ocaml
demonimin has quit [Ping timeout: 260 seconds]