Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.13.0 released: https://ocaml.org/releases/4.13.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
gopiandcode has quit [Quit: WeeChat 3.0]
servytor has quit [Quit: Connection closed for inactivity]
azimut has joined #ocaml
azimut has quit [Ping timeout: 240 seconds]
azimut has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
bobo has joined #ocaml
spip has quit [Ping timeout: 272 seconds]
mbuf has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
zebrag has quit [Quit: Konversation terminated!]
Haudegen has joined #ocaml
gravicappa has joined #ocaml
Serpent7776 has joined #ocaml
jlrnick has joined #ocaml
oisota4 has joined #ocaml
oisota has quit [Ping timeout: 256 seconds]
oisota4 is now known as oisota
dextaa_ has joined #ocaml
olle has joined #ocaml
<d_bot_> <reynir> @VPhantom I updated let-if with if%true: it transforms `if%true cond then something` into `let c = cond in if c then something; c` https://github.com/reynir/let-if
rak has quit [Quit: Segmentation fault (core recycled)]
rak has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
bartholin has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
wingsorc has quit [Ping timeout: 240 seconds]
<d_bot_> <VPhantom> Nice! Hey I already had this repo starred so I guess I saw it before in my crazy adventures. 😉
humasect has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
dextaa_ has quit [Remote host closed the connection]
dextaa_ has joined #ocaml
humasect has quit [Quit: Leaving...]
Haudegen has joined #ocaml
dextaa_ has quit [Remote host closed the connection]
epony has quit [Ping timeout: 240 seconds]
szkl has joined #ocaml
jlrnick has quit [Ping timeout: 240 seconds]
<d_bot_> <VPhantom> I just whipped up a little pattern match on Godbolt: <https://godbolt.org/z/cWh7a6enT> I'm not familiar with much of assembly but is it normal that I don't see the strings `"use"` nor `"documentzz"` in the generated output? I do see the three failure strings but not those pattern strings. I'm trying to understand if the compiler compares strings once per case or if it groups them in a tree but I can't figure much out from the a
<d_bot_> <VPhantom> (This is part of my "trying to know what I'm doing" series. 😛)
<d_bot_> <VPhantom> Note that I extended "document" with "zz" to make sure it was over 8 bytes long, in case the compiler felt frisky and decided to compare strings as integers.
<d_bot_> <VPhantom> I don't even see a reference to Stdlib's `compare` function in there. 🤔
<d_bot_> <reynir> line 105 or so
<d_bot_> <reynir> seems like the compiler does integer comparison with "document" and then "zz"
<olle> Any news in type-land this week?
waleee has joined #ocaml
epony has joined #ocaml
<d_bot_> <VPhantom> Oh wow, nice! So it _does_ compare strings as integers when they're short (which they usually are). That's a really neat trick!
<d_bot_> <VPhantom> Seems to use 63-bit integers too, because dropping to "documen" removed the second check. Thanks for the tip! I totally missed it.
<d_bot_> <reynir> yea, it took me some time staring at the code to spot it
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
olle has quit [Remote host closed the connection]
bartholin has quit [Quit: Leaving]
bobo has quit [Ping timeout: 256 seconds]
spip has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
zebrag has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
epony has quit [Read error: Connection reset by peer]
epony has joined #ocaml
Anarchos has joined #ocaml
Haudegen has joined #ocaml
mbuf has quit [Quit: Leaving]
<d_bot_> <mbacarella> well that's awesome
Tuplanolla has joined #ocaml
<d_bot_> <mbacarella> it's still faster to match on sum types? because each variant is actually mapped to an integer?
<d_bot_> <mbacarella> assertion check. trying to avoid internalizing "actually, matching short strings is fast!"
<d_bot_> <mbacarella> slash faster than matching on sum types
<d_bot_> <mbacarella> er, is matching on short strings faster than matching on polymorphic variants? 🤔
<d_bot_> <mbacarella> or, at least, equivalent?
<d_bot_> <mbacarella> i understand sum types compute to jump tables but polymorphic variants compute to if-then-else-if-then-else
<d_bot_> <VPhantom> Polymorphic variants without arguments are unboxed btw, the same as regular variants.
<d_bot_> <VPhantom> I'm a rookie but I would expect a <7 character string, an int, a variant without arguments and a polymorphic variant without arguments to be handled similarly or identically in the resulting assembly. 🤔
<d_bot_> <mbacarella> to the godbolt!
<d_bot_> <mbacarella> https://godbolt.org/z/ePEaME8WY
<d_bot_> <mbacarella> i think the regular variant clearly wins
bartholin has joined #ocaml
<dh`> oops, from way back in the scroll:
<dh`> <companion_cube> dh`: what is the point of using async IOs if you're going to block on them immediately, though?
<dh`> exercising the async I/O path
<dh`> that is, if you have a separate async I/O path it'll be rarely used and it's quite likely to not actually work
<dh`> if you have only the one I/O path any problems will turn up immediately
<companion_cube> I guess it makes sense
<companion_cube> if you have both, that is, but that sounds bad :D
<dh`> this is more important inside kernels than in language runtimes though
<dh`> most language runtimes don't do anything particularly complicated for generic I/O, so it's just a thin wrapper around the OS
<dh`> (unless trying to do things like fake up async I/O using threads)
<dh`> whereas in the OS the I/O path is nontrivial and it's easy for it to be bust
<sleepydog> the recent io_uring vulnerability comes to mind ...
servytor has joined #ocaml
<servytor> can someone explain to me how https://github.com/inhabitedtype/ocaml-aws is 215k lines of OCaml code, 334k lines of json, but https://github.com/cognitect-labs/aws-api is only 4k of Clojure and 10k of json?
<d_bot_> <VPhantom> @mbacarella I'm surprised, but it does appear that the stock compiler is more aggressive with regular variants. I tried flambda and `-O2` and same difference.
<d_bot_> <Et7f3 (@me on reply)> you can't otherwise how do you know at runtime short/long string one is a pointer and other is not
<d_bot_> <VPhantom> I'm not saying they're handled _interchangeably_, just in a similar way.
<d_bot_> <Et7f3 (@me on reply)> but the ocaml compiler when we match on many string try to find best char to look for difference
bartholin has quit [Quit: Leaving]
bartholin has joined #ocaml
bartholin has quit [Client Quit]
<d_bot_> <Et7f3 (@me on reply)> 😳 the string was "abcdefghi"
tomku has quit [Ping timeout: 256 seconds]
tomku has joined #ocaml
<d_bot_> <VPhantom> We can see the endianness.
Anarchos has quit [Quit: Vision[]: i've been blurred!]
gravicappa has quit [Ping timeout: 272 seconds]
<dh`> (I didn't read the scroll, suppose I should have)
<dh`> oops
<d_bot_> <RegularSpatula> I didn’t really read your message well enough and thought at first that Cognitect had started writing ocaml and got really excited…
<companion_cube> servytor: maybe the clojure code is generated on the fly from the json files?
<sleepydog> servytor: I assume you're asking in good faith. the ocaml version generates a separate module for each product. the clojure project looks to do more at runtime
tomku has quit [Ping timeout: 240 seconds]
tomku has joined #ocaml
Serpent7776 has quit [Quit: leaving]
wyrd has quit [Ping timeout: 240 seconds]
wyrd has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
szkl has quit [Quit: Connection closed for inactivity]
waleee has joined #ocaml
hackinghorn has quit [Ping timeout: 256 seconds]
TheRuralJuror has joined #ocaml
ski_ has joined #ocaml
hannes_ has joined #ocaml
t-j-r has joined #ocaml
infinity0_ has joined #ocaml
infinity0 has quit [Killed (lead.libera.chat (Nickname regained by services))]
infinity0_ is now known as infinity0
Tuplanolla has quit [*.net *.split]
Haudegen has quit [*.net *.split]
zebrag has quit [*.net *.split]
tizoc has quit [*.net *.split]
kakadu has quit [*.net *.split]
ansiwen has quit [*.net *.split]
Absalom has quit [*.net *.split]
cross has quit [*.net *.split]
gjvc has quit [*.net *.split]
ski has quit [*.net *.split]
_tjr_ has quit [*.net *.split]
hannes has quit [*.net *.split]
kaph has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
wingsorc has joined #ocaml
tizoc has joined #ocaml
gjvc has joined #ocaml
Absalom has joined #ocaml
ansiwen has joined #ocaml
kakadu has joined #ocaml
cross has joined #ocaml
tomku has quit [Ping timeout: 252 seconds]
ski_ is now known as ski
Tuplanolla has joined #ocaml
hackinghorn has joined #ocaml
tomku has joined #ocaml
hackingh- has joined #ocaml
hackinghorn has quit [Read error: Connection reset by peer]
hackinghorn has joined #ocaml
zebrag has joined #ocaml