<Drup>
(although, I see where he comes from with this, since floating points can be locally unboxed, and thus suffer no penalty, while tagged integers will always have a penalty)
<Drup>
(although int32/64 are also locally unboxed ... but there is no specialized array type)
<Drup>
(yet)
<Armael>
Xavier Leroy was just saying at lunch today that even in the context of C (with 64 bits integers), multiplication/division on floats can be faster than on integers, because the hardware support for floats is really optimised, and also in some cases it's faster on floats because the mantissa is only 53 bits vs the 64 bits of integers...
<Armael>
so apparently even without 63 bit integers it's not so obvious that all operations on integers are faster that on floats
<Fardale>
Drup: by specialized array, you means floatarray or array created by Array.make_float ?
<Drup>
it's the same thing
<Drup>
(at least for now ..)
<Fardale>
Ok thanks
<Fardale>
why both exist ?
<Drup>
because soon™, the float array hack will be droped, and only Array.Floatarray will be optimized
<ggole>
Zero-tagged numbers are probably slightly better than the OCaml 2*n+1 scheme
<ggole>
But only slightly
<kakadu>
Where can I read about `Zero-tagged numbers`?
bartholin has joined #ocaml
<kakadu>
Also, have you seen any survey papers about runtime design? unified represenations, tagger integers, etc.
<Fardale>
the tag on integer is here for the GC ?
silenc3r_ has joined #ocaml
ollehar has joined #ocaml
<freyr69>
How to print binary representation with Printf?
dawid__ has joined #ocaml
silenc3r has quit [Ping timeout: 272 seconds]
KeyJoo has joined #ocaml
<companion_cube>
I don't think you can, there's only hexa
silenc3r_ has quit [Ping timeout: 250 seconds]
kakadu has quit [Ping timeout: 246 seconds]
<dinosaure>
cstruct has something, like pp_hexdump
dawid__ has quit [Remote host closed the connection]
<ggole>
Fardale: that and the various polymorphic operations
<ggole>
hash, =, compare, etc
<Fardale>
Oh thanks
loli has quit [Ping timeout: 258 seconds]
<freyr69>
does hash return pointer?
<ggole>
An int. (What would it return a pointer to?)
loli has joined #ocaml
<freyr69>
I mean what's the algorithm, does it just return a pointer to the object as int?
<freyr69>
How safe is to use React with Lwt? React is not thread-safe, could there be any problems if the event listener lives in a different Lwt thread?
<ggole>
It looks at tag bits and object headers to figure out the shape of the value, and hashes the bits (recursively, if necessary)
<ggole>
(Although there's some kind of depth cutoff, you can hash cyclic objects just fine.)
powerbit has quit [Remote host closed the connection]
kakadu has joined #ocaml
q9929t has quit [Remote host closed the connection]
q9929t has joined #ocaml
status402_ has quit [Quit: status402_]
ygrek has quit [Ping timeout: 272 seconds]
freyr69 has quit [Remote host closed the connection]
ggole has quit [Quit: Leaving]
linse has quit [Quit: linse]
linse has joined #ocaml
FreeBirdLjj has joined #ocaml
nikivi has quit [Quit: ZNC is awesome]
nikivi has joined #ocaml
jbrown has quit [Ping timeout: 252 seconds]
loli has quit [Ping timeout: 244 seconds]
jao has quit [Ping timeout: 245 seconds]
ziyourenxiang has quit [Ping timeout: 246 seconds]
Haudegen has quit [Remote host closed the connection]
loli has joined #ocaml
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
q9929t has quit [Remote host closed the connection]
q9929t has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
ravenousmoose has joined #ocaml
orbifx has quit [Quit: WeeChat 2.3]
sagotch has quit [Quit: Leaving.]
jao has joined #ocaml
jao has quit [Remote host closed the connection]
<cemerick>
Armael: the comment made me curious; swapping floats for ints in my project actually yielded a ~2x speed up
<Armael>
:D
<Armael>
what kind of computation do you do?
jao has joined #ocaml
<Drup>
cemerick: well, now we got extraordinary evidence I guess :D
<companion_cube>
assuming you can use floats, yeah :D
pierpal has joined #ocaml
Haudegen has joined #ocaml
linse has quit [Quit: linse]
loli has quit [Ping timeout: 258 seconds]
ravenousmoose is now known as ravenousmoose[aw
amz3 has joined #ocaml
<amz3>
hello, does ocaml compiler have a wasm or javascript backend or both?
<companion_cube>
there's js_of_ocaml as a js backend
KeyJoo has quit [Quit: KeyJoo]
KeyJoo has joined #ocaml
<amz3>
I want to enquire about the experience regarding wasm and vanilla js targets
<amz3>
both in terms of performance and developer experience
loli has joined #ocaml
ravenousmoose[aw is now known as ravenousmoose
<companion_cube>
I have no idea, sorry
<companion_cube>
webasm is not supported (yet?), and there are two distinct JS backends (jsoo and bucklescript)
<amz3>
ok so there is no ocaml-on-wasm, as of yet.
<amz3>
I experiemented a little with pypyjs which targets wasm and I find the user experience... confusing. In particular, since every network call must be turned into a message inside the javascript message, I am wondering if the overhead doesn't kill the performance boost of wasm
q9929t has quit [Remote host closed the connection]
<cemerick>
Drup: going the other way, interestingly!
Jesin has quit [Quit: Leaving]
<Drup>
cemerick: if you are writing functional code and put your floats into heterogeneous records, it's 100% due to boxing ;)
<cemerick>
Armael: the benchmark in question is loading a corner-stitching spatial index. Basically a decomposition of 2D space to accommodate subject rectangles.
Anarchos has joined #ocaml
ravenousmoose[aw is now known as ravenousmoose
<cemerick>
Drup: the numbers in question (either floats or ints) are the entirety of a Rectangle record type 🤷
Jesin has joined #ocaml
<Anarchos>
how to debug a oUnit2 test ? when it comes to run_test_tt_main, ocamldebug doesn't stop in the breakpoints i put in my tests
<cemerick>
the conversion from floats ⇒ ints required scaling everything by 1000, which I _think_ will be sufficient precision for the higher-level stuff, but that's TBD
linse has joined #ocaml
KeyJoo has quit [Ping timeout: 245 seconds]
dhil has quit [Ping timeout: 240 seconds]
linse has quit [Client Quit]
olle__ has joined #ocaml
<olle__>
doing opam update, 4.07.1 is not listed for some reason, but js_of_ocaml used it, it seems.
<olle__>
Get a bytecode version clash.
linse has joined #ocaml
loli has quit [Ping timeout: 245 seconds]
jnavila has joined #ocaml
loli has joined #ocaml
amz3 has quit [Quit: WeeChat 2.2]
keep_learning has quit [Remote host closed the connection]
kakadu_ has joined #ocaml
gravicappa has quit [Ping timeout: 250 seconds]
raduom has quit [Ping timeout: 244 seconds]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
bartholin has quit [Remote host closed the connection]
loli has quit [Ping timeout: 246 seconds]
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
loli has joined #ocaml
powerbit has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
jbrown has joined #ocaml
dedgrant has joined #ocaml
Serpent7776 has quit [Quit: leaving]
jao has joined #ocaml
Haudegen has quit [Remote host closed the connection]
loli has quit [Ping timeout: 258 seconds]
linse has quit [Quit: linse]
spew has quit [Quit: going home]
Haudegen has joined #ocaml
loli has joined #ocaml
kroot_ has quit [Quit: kroot_]
kroot_ has joined #ocaml
doesntgolf has joined #ocaml
dedgrant has quit [Ping timeout: 240 seconds]
dedgrant has joined #ocaml
jnavila has quit [Remote host closed the connection]