companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
<d_bot> <mbacarella> how is something like `let%bind foo = bar` represented it the AST?
<companion_cube> something like (ext "bind" (let foo = bar)) I think
Tuplanolla has quit [Quit: Leaving.]
azimut has quit [Remote host closed the connection]
<d_bot> <mbacarella> i thought so too but can't find the helpers that actually build that
azimut has joined #ocaml
<d_bot> <mbacarella> ho hum maybe i can just do `[%bind [%expr let foo = bar]]`
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
<d_bot> <mbacarella> wait that probably didn't sense.
<d_bot> <mbacarella>
<d_bot> <mbacarella> I'm trying to build an AST of `let%map_open foo0 = bar0 and ... fooN = barN` but can't find the right `Ast_helpers`. but apparently `let%ext foo0 = bar0...` is the same as `[%ext let foo0 = bar0 ...]` so I can use build a normal let AST and wrap it in the extension point using ppx_metaquot `[%expr [%map_open [%e Exp.let_ ["foo0", "bar0"]]]`
<d_bot> <mbacarella> whew
raskol has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
bobo_ has joined #ocaml
spip has quit [Ping timeout: 244 seconds]
raskol has quit [Ping timeout: 244 seconds]
<d_bot> <froyo> someone should start adding ocaml entries to those pages
raskol has joined #ocaml
jpds has quit [Ping timeout: 268 seconds]
jpds has joined #ocaml
meinside has quit [Quit: Connection closed for inactivity]
motherfsck has quit [Ping timeout: 244 seconds]
chrisz has quit [Ping timeout: 276 seconds]
chrisz has joined #ocaml
azimut has quit [Ping timeout: 268 seconds]
motherfsck has joined #ocaml
rgrinberg has joined #ocaml
zebrag has joined #ocaml
raskol has quit [Ping timeout: 256 seconds]
jpds has quit [Remote host closed the connection]
jpds has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
motherfsck has quit [Ping timeout: 240 seconds]
motherfsck has joined #ocaml
rgrinberg has joined #ocaml
motherfsck has quit [Ping timeout: 244 seconds]
meinside has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zebrag has quit [Quit: Konversation terminated!]
motherfsck has joined #ocaml
kurfen_ has joined #ocaml
kurfen has quit [Ping timeout: 255 seconds]
mbuf has joined #ocaml
Haudegen has joined #ocaml
mro has joined #ocaml
immutable_ has quit [Ping timeout: 255 seconds]
jakzale has quit [Read error: Connection reset by peer]
b0o has quit [Read error: Connection reset by peer]
sleepydog has quit [Read error: Connection reset by peer]
philipwhite_ has quit [Read error: Connection reset by peer]
sm2n has quit [Read error: Connection reset by peer]
seeg has quit [Read error: Connection reset by peer]
philipwhite has joined #ocaml
jakzale has joined #ocaml
immutable has joined #ocaml
b0o has joined #ocaml
sleepydog has joined #ocaml
seeg has joined #ocaml
sm2n has joined #ocaml
conjunctive_ has quit [Read error: Connection reset by peer]
conjunctive_ has joined #ocaml
neiluj has joined #ocaml
<neiluj> Hello! Anyone has experience with Rust-OCaml bindings?
<neiluj> I use some C-OCaml bindings but the custom block thing induce some costs for each calls of C stubs
bcw has joined #ocaml
bcw has quit [Client Quit]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
Tuplanolla has joined #ocaml
<d_bot> <gantsev.denis> Disclaimer: i am not expert, but how fast you need to go, and why you believe rust bindings would incure a different cost?
<d_bot> <gantsev.denis> Last time i checked, ocaml ffi est *very* efficient, some numbers over 1 million calls from a language to C:
<d_bot> <gantsev.denis> ```
<d_bot> <gantsev.denis> ocamlopt:
<d_bot> <gantsev.denis> 1634
<d_bot> <gantsev.denis> 1634
<d_bot> <gantsev.denis>
<d_bot> <gantsev.denis> rust:
<d_bot> <gantsev.denis> 1193
<d_bot> <gantsev.denis> 1196
<d_bot> <gantsev.denis>
<d_bot> <gantsev.denis> ```
<d_bot> <gantsev.denis> source: https://github.com/dyu/ffi-overhead
meinside has left #ocaml [#ocaml]
neiluj has quit [Remote host closed the connection]
neiluj has joined #ocaml
<neiluj> thanks! Indeed there's not much of a difference
<Armael> what are you using custom blocks for? there might be a faster option
<neiluj> to hold a C array
<Armael> there is a different way of passing C pointers to the OCaml world which doesn't require allocating a block, by disguising them as OCaml integers
<Armael> (nb: this only works for pointers that are at least 2-aligned)
<Armael> (it's the third code snippet from the link above)
<d_bot> <gantsev.denis> BigArrays are contiguous C like arrays, available in stdlib
neiluj has quit [Ping timeout: 260 seconds]
bartholin has joined #ocaml
mro has quit [Remote host closed the connection]
Anarchos has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
waleee has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
bartholin has quit [Remote host closed the connection]
bartholin has joined #ocaml
Anarchos has joined #ocaml
bobo_ has quit [Ping timeout: 244 seconds]
bobo_ has joined #ocaml
neiluj has joined #ocaml
<neiluj> thank you both! Passing C pointers as C values is the way to go!
herrschreinerei has joined #ocaml
<herrschreinerei> hello guys. I am looking for some tyxml examples.
<herrschreinerei> The example folder is a bit poor.
Haudegen has quit [Quit: Bin weg.]
mro has joined #ocaml
mro has quit [Client Quit]
Anarchos has quit [Ping timeout: 276 seconds]
waleee has quit [Ping timeout: 244 seconds]
azimut has joined #ocaml
ente has quit [Read error: Connection reset by peer]
ente has joined #ocaml
bastienleonard has joined #ocaml
Anarchos has joined #ocaml
neiluj has quit [Ping timeout: 255 seconds]
neiluj has joined #ocaml
spip has joined #ocaml
bobo_ has quit [Ping timeout: 255 seconds]
neiluj has quit [Client Quit]
<companion_cube> Armael: is that still valid with 5.0 and no naked pointers?
<Armael> companion_cube: yes; the snippet I'm refering to was actually added *because* of NNP
<Armael> (you don't pass the actual pointer, you tag it to make it look like an ocaml integer, hence the 2-alignement requirement)
<companion_cube> oh shit, ok, my bad
<companion_cube> (sounds vaguely like UB but well, probably works on the classic architectures :))
<Armael> it is UB but so are e.g. the macros provided by the runtime for manipulating ocaml values
<companion_cube> heh, yeah :)
<Armael> (my understanding is that when you write C stubs you're not writing standard C but "gcc C with the right compilation options")
<Armael> (I only realized that recently!)
<companion_cube> :/
<companion_cube> just like when you compile linux
<Armael> indeed
<Armael> (again, AFAIU at least)
salkin has joined #ocaml
Haudegen has joined #ocaml
bobo_ has joined #ocaml
spip has quit [Read error: Connection reset by peer]
mro has joined #ocaml
<companion_cube> yeah I think this one is pretty well known
<companion_cube> can't write malloc() or a kernel in standard C!
<companion_cube> :D
<Anarchos> hello
rgrinberg has joined #ocaml
raskol has joined #ocaml
mro has quit [Quit: Leaving...]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
raskol has quit [Ping timeout: 256 seconds]
Corbin has quit [Quit: Corbin]
adanwan has joined #ocaml
Anarchos has joined #ocaml
raskol has joined #ocaml
adanwan_ has quit [Ping timeout: 268 seconds]
Haudegen has quit [Quit: Bin weg.]
raskol has quit [Ping timeout: 276 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
<d_bot> <Stalker> hello im new here
<d_bot> <Stalker> excuse me everyone, how could i get help for a simple stack implementation in caml pls ?
<d_bot> <VPhantom> Sounds like a shoe-in for #beginners 😉
Anarchos has quit [Ping timeout: 276 seconds]
noonien6 has quit [Ping timeout: 246 seconds]
bartholin has quit [Quit: Leaving]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
motherfsck has quit [Quit: quit]
Serpent7776 has joined #ocaml
motherfsck has joined #ocaml
mbuf has quit [Quit: Leaving]
<d_bot> <froyo> they teach people to fail instead of return options 😭
noonien6 has joined #ocaml
<d_bot> <froyo> his pop is a drop, really.. pop would be uncons
<d_bot> <Stalker> ok thanks
<d_bot> <Stalker> isnt it easier to use open Stack ?
<d_bot> <Stalker> the stack module
<companion_cube> ideally, don't `open` it, just use `Stack.create()`, `Stack.push`, etc
<d_bot> <Stalker> yeah i tried otherwise it can conflicts with other types
<companion_cube> `open` is to be used in small doses imho
<d_bot> <froyo> this is a pedagogical video, first of all
<d_bot> <froyo> and second of all because stdlib's stack is a mutable data structure, which comes with its own complexities
Haudegen has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
noze has joined #ocaml
<noze> is there a way to install a package via opam without performing an update of currently installed packages?
<noze> right now I tried to install batteries, but because a bunch of libraries have upstream changes, opam tries to rebuild everything including coq, taking >10 minutes instead of <1min -.-
<sim642> Are you sure those others aren't transitively needed for what you're trying to install?
salkin has quit [Quit: salkin]
<noze> as far as I can tell, they don't need to be upgraded for batteries to be installable
<noze> It relies on dune and ocamlfind (amongst others). Those are installed, but not at their latest version. The version installed is greater than the one required though. Yet opam seems to see this as an occasion to upgrade dune and ocamlfind, which in turn requires recompiling everything that uses these two, i.e. most of what I have installed.
noze` has joined #ocaml
xgqt has quit [Quit: WeeChat 3.4.1]
xgqt has joined #ocaml
<d_bot> <froyo> ah yes, the dread of upgrading dune
zebrag has joined #ocaml
Sankalp has joined #ocaml
noze has quit [Read error: Connection reset by peer]
ns12 has quit [Quit: bye]
ns12 has joined #ocaml
hexology- is now known as hexology
<octachron> opam install --skip-updates
mro has joined #ocaml
hexology has quit [Quit: brb]
hexology has joined #ocaml
<noze`> octachron: that doesn't seem to make a difference
xgqt has quit [Remote host closed the connection]
xgqt has joined #ocaml
waleee has joined #ocaml
Everything has joined #ocaml
enjolras has joined #ocaml
Anarchos has joined #ocaml
Everything has quit [Quit: leaving]
mro has quit [Quit: Leaving...]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Serpent7776 has quit [Quit: leaving]
motherfsck has quit [Quit: quit]
motherfsck has joined #ocaml
rgrinberg has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
bastienleonard has quit [Ping timeout: 240 seconds]