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/
waleee has quit [Ping timeout: 244 seconds]
waleee has joined #ocaml
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
waleee has quit [Ping timeout: 268 seconds]
zebrag has quit [Quit: Konversation terminated!]
mbuf has joined #ocaml
gravicappa has joined #ocaml
Serpent7776 has joined #ocaml
mro has joined #ocaml
olle has joined #ocaml
Haudegen has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
neiluj has joined #ocaml
<neiluj> Hello! Having some trouble setting up a dedicated switch for my project: https://tpaste.us/OQem
<neiluj> here is the install rule of the makefile
<neiluj> so basically the pin seems okay, except it's not actually used when pulling the dependencies of the opam file
vizard has joined #ocaml
<d_bot> <mimoo> do you know what's the diff between `roots` and `installed` packages in the opam.export file? created by exporting the switch
gravicappa has quit [Ping timeout: 268 seconds]
yoctocell has joined #ocaml
motherfsck has quit [Ping timeout: 252 seconds]
bartholin has joined #ocaml
motherfsck has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Quit: Leaving]
gravicappa has joined #ocaml
dhil has joined #ocaml
Haudegen has quit [Read error: Connection reset by peer]
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
Haudegen has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Ping timeout: 244 seconds]
foo303 has joined #ocaml
foo303 has quit [Client Quit]
mro has joined #ocaml
mro has quit [Ping timeout: 268 seconds]
mro has joined #ocaml
mro has quit [Ping timeout: 244 seconds]
yoctocell has quit [Remote host closed the connection]
<d_bot> <mimoo> where is _caml_local_roots defined?
<d_bot> <sage> What do folks normally use for writing web servers in ocaml?
<d_bot> <sage> Preferably with websocket support
<companion_cube> not a webdev, but there's dream, ocsigen, opium
<companion_cube> at least
mro has joined #ocaml
mro has quit [Ping timeout: 244 seconds]
yoctocell has joined #ocaml
mro has joined #ocaml
mbuf has quit [Quit: Leaving]
<dmbaturin> companion_cube: Behold! The most flexible TOML formatter (perhaps across many languages) https://bpa.st/OVB3HWDZBO4GSWKEWL7ZFWYNQ4
<rwmjones> is there some catch I should be aware of to comparing structs using Pervasives.compare? as in, two structs which when written down look identical, but compare == 1
* rwmjones is wondering if this is memory corruption, because I can't think what else it can be
mro has quit [Ping timeout: 240 seconds]
<fluxm> I guess the catch is, don't use Pervasives.compare 🤔
<rwmjones> I'm just using it in a unit test, but what would the problem be?
<fluxm> are each of those fields compared separately with compare also equal?
<rwmjones> hmm, good question, let me check that
<companion_cube> you mean pure OCaml records, rwmjones ?
<rwmjones> yup
<companion_cube> without closures or cycles?
<rwmjones> no
<rwmjones> however the catch is that there are lots of strings which are read from a hokey C binding that I wrote (for libxml2)
<rwmjones> so it might be memory corruption of some sort
<companion_cube> Gc.compact() first?
<rwmjones> yeah I tried that already :-)
<companion_cube> :D
<companion_cube> ofc you did
<rwmjones> let me compare each field and see if it's a partcular one
<rwmjones> (this could take a while as there are a lot)
<companion_cube> you can also print addresses with printf
<d_bot> <ggole> What's in the records?
<companion_cube> well, printf + a little bit of Obj 🙃
<rwmjones> aaaaarrrggghh yes I know what it is (and comparing the fields helped - it was the very first one which failed)
<companion_cube> \0 ?
<rwmjones> no, it's easier than that; here's the field
<rwmjones> eprintf "hv: %d\n" (compare actual.s_hypervisor expected.s_hypervisor);
<rwmjones> oops
<rwmjones> and I had read back "unknown" (UnknownHV) as OtherHV "unknown"
<rwmjones> but when they were printed, they're identical
<rwmjones> stupid stupid stupid
<companion_cube> oh damn
<companion_cube> well it can happen to everyone :D
<rwmjones> indeed :-/
<thizanne> that's a funnier one that forgetting a semicolon, though
mro has joined #ocaml
<companion_cube> dmbaturin: didn't realize toml could be indented
<companion_cube> but that's cool
<dmbaturin> companion_cube: My position is that it _should_ be indented, else it's as unreasonable as everything else unindented. :)
<dmbaturin> But most formatters just print everything at the beginning of the line, which makes it hard to read.
mro has quit [Ping timeout: 268 seconds]
<dmbaturin> One more thing I want to add is an option to print strings with newlines as triple-quoted multi-line strings rather than with newlines escaped.
<companion_cube> I'm not sure i like toml much, tbh
<companion_cube> the array thing is a bit insane
<dmbaturin> That array thing is the reason for half the complexity in that code, I tell you!
waleee has joined #ocaml
Tuplanolla has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 244 seconds]
<companion_cube> also I don't partcuarly like it for writing config anyway
<companion_cube> something like ucl (nginx config) is better
<dmbaturin> Are there ready to use libs for UCL though?
<companion_cube> not in OCaml though, idk
<companion_cube> at some point we have to accept the existing stuff
<dmbaturin> I'm not the greatest fan of TOML, I just find it the least awful of the widely supported formats.
<dmbaturin> Ironically it might have been easier to write a lib for UCL than a TOML lib though. :)
<companion_cube> probably yeah
<dmbaturin> Hhm. Multi-line string output poses some interesting problems. I'd need to escape everything _but_ newlines, or alternatively unescape newlines after running it through String.escape
<dinosaure> rfc822-derived configuration file <3
<companion_cube> like… email? :/
<d_bot> <dinosaure> yes (or debian packages)
<companion_cube> :D
<companion_cube> that's not an appealing example
<companion_cube> I never heard anyone praise debian packages
mro has joined #ocaml
<dmbaturin> companion_cube: As a Debian-based system maintainer, I hate them. ;)
<d_bot> <dinosaure> (it's a sarcasm, I spent too much time on it, so I must promote it)
<companion_cube> if your configuration is targeted at other OCaml devs, I think S-exprs are the best compromise
<companion_cube> at that point
mro has quit [Ping timeout: 272 seconds]
<d_bot> <undu> that would apply only to tools in the ocaml ecosystem, rather than tools written in ocaml in general
<companion_cube> sure
<companion_cube> although, how hard can it be compared to learning json? :p
<d_bot> <undu> for most devs learning json is not an issue, however. they already know json (or they think they do)
<dmbaturin> The latter part is the problem. :)
<dmbaturin> Well, JSON is also annoying to write and edit by hand.
<companion_cube> and comments, trailing commas, etc.
<companion_cube> ugh
<d_bot> <let Butanium = raise Not_found;;> is js_of_ocaml slower than a normal linux ocaml install ?
<companion_cube> you mean is the compiled code slower? or the compilation?
<dmbaturin> What do you mean? Is running an executable trans-compiled with js_of_ocaml in node.js slower than running native executables?
zebrag has joined #ocaml
<dmbaturin> I guess the answer may be seriously different for different workloads.
<companion_cube> I think in most cases ocamlopt will make faster code
<companion_cube> and even if you talk about IO heavy workloads, there's luv
<companion_cube> which should be as fast as node.js :p
<dmbaturin> What is luv? (* no pun intended *)
<companion_cube> bindings to libuv :)
<companion_cube> I think aantron is planning to base lwt.unix on it
dhil has joined #ocaml
mro has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
neiluj has quit [Remote host closed the connection]
neiluj has joined #ocaml
henistein has joined #ocaml
henistein has left #ocaml [#ocaml]
mikess has quit [Ping timeout: 272 seconds]
bartholin has quit [Quit: Leaving]
mikess has joined #ocaml
mro has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 268 seconds]
dhil has joined #ocaml
vizard has quit [Ping timeout: 272 seconds]
neiluj has quit [Ping timeout: 264 seconds]
neiluj has joined #ocaml
zebrag has quit [Read error: Connection reset by peer]
zebrag has joined #ocaml
<d_bot> <monk> random but anyone know where `()` came up as the syntax for unit
<d_bot> <monk> i see it in rust, haskell, ocaml etc
<companion_cube> maybe ML? not sure
<d_bot> <monk> that has to be the answer right
<d_bot> <monk> now that i list out the languages i know that do it lol
waleee has quit [Ping timeout: 272 seconds]
waleee has joined #ocaml
dhil has quit [Ping timeout: 244 seconds]
<dh`> it's a null tuple, it seems obvious as soon as you have tuples
<d_bot> <monk> ah
mro has joined #ocaml
mro has quit [Remote host closed the connection]
dhil has joined #ocaml
mro has joined #ocaml
olle has quit [Ping timeout: 272 seconds]
gravicappa has quit [Ping timeout: 272 seconds]
neiluj has quit [Ping timeout: 272 seconds]
hackinghorn has quit [Quit: Leaving]
Haudegen has quit [Quit: Bin weg.]
Stumpfenstiel has joined #ocaml
neiluj has joined #ocaml
cbarrett_ has joined #ocaml
mro has quit [Read error: Connection reset by peer]
mro has joined #ocaml
cbarrett has quit [*.net *.split]
cbarrett_ is now known as cbarrett
neiluj has quit [Ping timeout: 244 seconds]
dhil has quit [Ping timeout: 244 seconds]
olle has joined #ocaml
mro has quit [Quit: Leaving...]
dhil has joined #ocaml
yoctocell has quit [Quit: C-x C-c, Shutting down OS...]
Serpent7776 has quit [Ping timeout: 268 seconds]
oriba has joined #ocaml
pmetzger has joined #ocaml
olle has quit [Ping timeout: 240 seconds]
pmetzger has quit [Remote host closed the connection]
pmetzger has joined #ocaml
mikess has quit [Ping timeout: 272 seconds]
pmetzger has quit [Ping timeout: 272 seconds]
<d_bot> <let Butanium = raise Not_found;;> > you mean is the compiled code
<d_bot> <let Butanium = raise Not_found;;> > slower? or the compilation?
<d_bot> <let Butanium = raise Not_found;;> I mean to run an algorithm. In my case it's for the travelling salesman problem and I create a tree and expand it during my program. I have also a lot of array manipulation. If I want to run it for a lot of cities I'd like to do it in the fastest environment
<d_bot> <let Butanium = raise Not_found;;> Because for now I use a windows interpreter which use js_of_ocaml
Tuplanolla has quit [Quit: Leaving.]
pmetzger has joined #ocaml
dhil has quit [Ping timeout: 252 seconds]
richbridger has joined #ocaml
mikess has joined #ocaml
Stumpfenstiel has quit [Ping timeout: 268 seconds]
dhil has joined #ocaml
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pmetzger has quit [Remote host closed the connection]
pmetzger has joined #ocaml
pmetzger has quit [Ping timeout: 268 seconds]
shawn has joined #ocaml
pmetzger has joined #ocaml
pmetzger has quit [Ping timeout: 268 seconds]