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/
perrierjouet has quit [Quit: WeeChat 3.4.1]
epony has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jlrnick has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
epony has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
spip has quit [Ping timeout: 240 seconds]
spip has joined #ocaml
gravicappa has joined #ocaml
kaph has quit [Remote host closed the connection]
kaph has joined #ocaml
mbuf has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has joined #ocaml
xd1le has joined #ocaml
Haudegen has joined #ocaml
kakadu has quit [Remote host closed the connection]
kakadu has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
kaph has quit [Ping timeout: 272 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
hsw has quit [Remote host closed the connection]
hsw has joined #ocaml
hsw has quit [Client Quit]
hsw has joined #ocaml
kaph has joined #ocaml
kaph has quit [Quit: Leaving]
kaph has joined #ocaml
xd1le has quit [Quit: xd1le]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
olle has joined #ocaml
perrierjouet has joined #ocaml
<d_bot> <joris> Hi, anyone aware of a mmap binding for ocaml that is more flexible than Unix.map_file ? for some reason Unix version does not even support using PROT_READ only
mro has quit [Remote host closed the connection]
bartholin has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.4.1]
Everything has left #ocaml [#ocaml]
perrierjouet has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.4.1]
perrierjouet has joined #ocaml
bobo has joined #ocaml
spip has quit [Ping timeout: 272 seconds]
gravicappa has quit [Ping timeout: 256 seconds]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
dextaa_ has joined #ocaml
gravicappa has joined #ocaml
bartholin has quit [Remote host closed the connection]
bartholin has joined #ocaml
bartholin has quit [Remote host closed the connection]
bartholin has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
waleee has joined #ocaml
kaph has joined #ocaml
rgrinberg has joined #ocaml
olle has quit [Remote host closed the connection]
<d_bot> <nave01314> What’s everyone’s favorite OCaml RPC library?
<companion_cube> that's far too vague :)
<d_bot> <nave01314> I am coming from Go and I want to write a paxos implementation using RPCs to send messages. Is there a single library for RPCs people recommend (if so, why not, what are the options/trade offs)?
<companion_cube> ah well, I think not, then
<d_bot> <nave01314> (RPCs are built into the STL of go)
<d_bot> <nave01314> Huh, what are my best options then?
<companion_cube> rolling out your own with protobuf probably?
<companion_cube> Go is optimized for networking, OCaml… not so much
<d_bot> <nave01314> this will be an experience sounds good 🤠
mro has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
<d_bot> <nave01314> What are my concurrency options in Ocaml (or thread-like things, although let me know if this is an XY problem where I am looking for the wrong tool)
<d_bot> <nave01314> Eg, I want to do two things concurrently
<companion_cube> there's Lwt
<companion_cube> it's a hot space actually, OCaml 5, with multicore, is going to happen this year, and it'll change a lot of things
mro has quit [Ping timeout: 272 seconds]
<d_bot> <nave01314> Actually, interesting q, does ocaml support parallelism at all rn?
<companion_cube> no
<companion_cube> you need multiple processes :)
<companion_cube> but that's about to change, after 10y of waiting, literally
<d_bot> <nave01314> How sad would I be if I tried building on it before GA?
<d_bot> <nave01314> Like, is it stable and waiting for rubber stamp or is it actively getting worked on
<companion_cube> hmmm it's still being worked on, but you can try it
<companion_cube> there's a concurrency library for it: https://github.com/ocaml-multicore/eio
<d_bot> <octachron> We are not yet at the rubber stamp point, I am hoping for an alpha version of OCaml 5.0 around the end of April.
<d_bot> <octachron> But http://check.ocamllabs.io/?comp=4.13&comp=5.0&available=4.13&available=5.0&show-diff-only=true&show-latest-only=true&sort-by-revdeps=true shows that a significant part of the ecosystem does not work with the current development version of OCaml 5.
<companion_cube> ha, i need to release containers…
<companion_cube> seems like removing the Format `tag` functions kill a lot of things
<octachron> Yeah, I will probably write that compatibility library that I mentionned.
<dmbaturin> Anyone knows anything about homebrew's OCaml packaging process? Is there a reason it's still at 4.12, or it's just that no one sent them a PR to update it yet and I should do it?
<octachron> I would expect the later
jtm has joined #ocaml
<d_bot> <nave01314> thanks! it looks like this means that 5.0 broke compatibility with 4.13 libraries (so developing on 5.0 is not likely to be a great experience rn)?
<d_bot> <joris> @companion_cube did you get a chance to work on buffer ? worked on something related to your recent interests today. A simple read-only KV db in ocaml, had to write kind of a bigstring based buffer implementation, it is very dumb though
<companion_cube> @joris I have a non-bigstring one in containers now
<companion_cube> soon to be released
<companion_cube> look at src/core/CCByte_buf
<d_bot> <joris> nice ! thanks i'll have a look
<companion_cube> also I fixed CCFormat so it builds on 5.0
<d_bot> <joris> I also realized for this kind of simple code, dropping lwt or not using new abstractions like eio brings a massive perf gain. When you write c-style ocaml, with very basic state machine for the coroutines, it really performs well. Simple kv storage using memory index, read the block, decompress and return the data based on the amazing uring bindings from the eio team, this is able to serve 50k requests per second (i realize the dat
<d_bot> <octachron> @nave01314 right now developping on 5.0 will not be a painless experience indeed. Backward compatibility has been mostly preserved between OCaml 4 and 5. However, since few deprecated functions has been removed, some core libraries need to be updated.
<d_bot> <joris> @companion_cube i'll see if i can make a bigstring version out of that, but not sure it belongs to containers
<companion_cube> maybe not indeed, or a in sub-library
<companion_cube> containers.bigstring or whatever
<companion_cube> you need bigstring for the uring interop>
<companion_cube> ?
<d_bot> <octachron> (There is also a handful of libraries that were using advanced features (ephemerons) that were interacting in complex way with the GC and whose API has been slightly reworked.)
<d_bot> <joris> @companion_cube it's not that it is needed, but it is a big sell of uring yes. As you can register a memory buffer that is shared with kernel, and use it for io. Which lifted the requirement of copying data across kernel/user space
<d_bot> <joris> but uring can also work with strings
<companion_cube> slices, hopefully
<d_bot> <joris> slices ?
<companion_cube> ie it takes `bytes -> int -> int -> …`
<d_bot> <joris> ah yes. Well since the bindings are written by mirage folks as i understand, it is based on cstruct, so you can do Cstruct.of_string yep
<companion_cube> lol that must copy though
<companion_cube> I mean, it makes sense, I'm sure.
<companion_cube> you coudl do a buffer that uses bigstringaf and put that on opam, @joris, I think.
<companion_cube> feel free to use what's in bytes_buf as a basis :p
<d_bot> <joris> yeah i'll still your code and keep the copyright 🙂
<d_bot> <joris> steal*
<d_bot> <joris> hm right you are right of_string is a deep copy it allocates a bigarray and blit. Well then, no string for uring 🙂
rgrinberg has quit [Read error: Connection reset by peer]
<d_bot> <joris> but actually it kind of make sense, uring being async, if a compaction occur you are bound for random crash
<d_bot> <joris> string can move while io is queued
rgrinberg has joined #ocaml
<companion_cube> yeah
<companion_cube> even classic blocking IOs have tricks for that, sadly :(
<companion_cube> OCaml kind of lacks an API to pin a value
<d_bot> <joris> ah yes because syscall release runtime lock
rgrinberg has quit [Client Quit]
mbuf has quit [Quit: Leaving]
<companion_cube> yeah, some do
<companion_cube> apparently stuff like `Unix.read` allocate a C buffer on the stack to do the IO, and then copy from C to the parameter string
<companion_cube> (which might have moved)
rgrinberg has joined #ocaml
<d_bot> <joris> makes sense. Afaik lwt_io uses bigstring though, it probably goes directly (but Lwt_unix is bytes so same issue)
rgrinberg has quit [Client Quit]
mro has joined #ocaml
<companion_cube> (come back to IRC!)
bartholin has quit [Quit: Leaving]
mro has quit [Remote host closed the connection]
vicfred has joined #ocaml
zebrag has joined #ocaml
Tuplanolla has joined #ocaml
cedric has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
ralu has quit [Ping timeout: 252 seconds]
mro has joined #ocaml
ralu has joined #ocaml
pieguy128_ has joined #ocaml
pieguy128 has quit [Ping timeout: 260 seconds]
leah2_ has joined #ocaml
leah2 has quit [Ping timeout: 260 seconds]
mro has quit [Quit: Leaving...]
pieguy128 has joined #ocaml
pieguy128_ has quit [Ping timeout: 252 seconds]
pieguy128 has quit [Max SendQ exceeded]
pieguy128 has joined #ocaml
<sleepydog> companion_cube: wow i didn't know that about Unix.read . so it can only read up to 64k at a time
<companion_cube> should be good enough, no? :)
<sleepydog> should be enough for anyone!
gravicappa has quit [Ping timeout: 272 seconds]
<companion_cube> I wonder what's the limit of linux
<companion_cube> how big a buffer it can fill in one go, in practice
<sleepydog> yea i just read that
<d_bot> <mbacarella> IIRC Linux will fill an arbitrarily large read buffer if it's from a file
<companion_cube> if it's in cache? or will it really wait to have read the whole file?
<d_bot> <mbacarella> I *think* so? I tested this once about ten years ago and the surprising thing happened
<sleepydog> there has to be a limit. it's probably very specific to what your file descriptor actually references (socket, pipe, file, /dev/zero, etc)
<companion_cube> yeah that's what I'm wondering
<companion_cube> like, surely you can't fill 500MB in one syscall? :D
<d_bot> <mbacarella> why not?
<sleepydog> you can make a tcp socket buffer as large as you want.I don't know if you'll be allowed to drain it with one read(), though
<companion_cube> @mbacarella: idk, it seems… preposterous :D
<companion_cube> there's no kernel internal structure that is bounded?
leah2_ is now known as leah2
<d_bot> <mbacarella> I can't immediately test this because I'm afk so I'll withdraw my claim out of fear that I'm misremembering
<companion_cube> :D
<companion_cube> please test later and report
<sleepydog> i wrote a quick C program
<sleepydog> i can read 1GB with 1 read call. haven't tried higher than that
<sleepydog> ah wait, that's 1MB, haha
<companion_cube> :D daaamn
<sleepydog> yea, i can do 1GB. trying to go higher but getting compiler warnings, heh
<sleepydog> ok, for /dev/zero, limit appears to be 2GB
<sleepydog> for a pipe setup by the shell with no extra tweaks, it's 64KB
<d_bot> <mbacarella> I wonder why there's a 2gb limit
QDX45 has joined #ocaml
wyrd has quit [Ping timeout: 240 seconds]
<QDX45> Hey. I'm getting an error while compiling a package with opam. I'm getting an alert that a function is depreciated, and so far as I can tell, that depreciation alert is making the compilation fail.
<QDX45> Is there a way to prevent a depreciation alert from stopping an opam package installation? If it helps, it says 'terminated with error 10'.
<octachron> which package?
<QDX45> Sorry if this isn't the right place for an opam question. Not totally sure how closely related ocaml and opam are.
<QDX45> xapi
<QDX45> The problem is in compiling systemd.1.2, which is a dependency of the xapi package
<QDX45> I don't mean to ask for a lot of support here, since it's a different piece of software. It's just my first time working with ocaml
<QDX45> Just hoping for a pointer in the right direction
wyrd has joined #ocaml
<octachron> xapi-stdext-threads on 4.14 ?
<octachron> The generic answer is that deprecation alerts are normally not compilation error on release build, but some package insists to promote those alerts into errors
<QDX45> Thanks. The generic answer is what I was hoping for. Is there a way for me to override that behavior and prevent the promotion?
<octachron> Or did you mean that it is systemd.1.2 which is failing?
<QDX45> The build hierarchy is fairly deep. The failure occurs while trying to compile systemd.1.2
<octachron> No, if it is the package build system that insists to have paranoiac build default, you can only patch this default in the package/library
<QDX45> Ok. Any pointers where I can look for that, or what the switch would look like?
<octachron> ocaml-systemd builds on all OCaml version except 5.0 ?
<octachron> It will be a a flag "-w ..." settings in the dune file of the project
<QDX45> It's just listed as " "systemd" {>= "1.2"} " in the depends section of the opam file
<QDX45> But that flag sounds like what I"m looking for.
<QDX45> Thanks
<octachron> There is no "systemd" package in the opam repository? And the ocaml-systemd package build fine on the opam CI across all released OCaml versions.
<QDX45> I don't know where it's pulling systemd from. Could be straight from https://github.com/systemd/systemd for all I can tell.
<QDX45> This is the thing I'm trying to build: https://github.com/xapi-project/xen-api
<QDX45> It's just weird. Thanks for your help; you answered my question. Found the -w flag, though it turns out it's not the issue. Probably misread the log.
<octachron> It is using its own opam-repository: xs-opam according to the readme
QDX45 has quit [Remote host closed the connection]
QDX45 has joined #ocaml
xenu has quit [Quit: leaving]
xenu has joined #ocaml
perrierjouet has quit [Ping timeout: 252 seconds]
<QDX45> Gotcha. I looked through there but couldn't find much that helped. I'll look again...didn't really 'click' that that was an alternative repository.
xgqt has quit [Ping timeout: 256 seconds]
xgqt has joined #ocaml
cedric has quit [Quit: Konversation terminated!]
<d_bot> <undu> You can also take a look at .github/workflows/main.yml to see how the CI builds it
<d_bot> <undu> Why are you trying to compile it using opam? Do you want to develop on the code?
rgrinberg has joined #ocaml
<QDX45> I don't know any better way to get it running on an unsupported distro
<QDX45> The main.yml looks helpful, thanks
<QDX45> I'll probably have to alter the code, since the idea is to get it working on alpine linux which uses a different init system than what xapi depends on
<d_bot> <undu> That's going to be a tremendous effort
<d_bot> <undu> It depends deeply on systemd's service files
<d_bot> <undu> And to make it working you will need to get stunnel, vartstored and quite a few C projects up and running as well
xenu has joined #ocaml
<d_bot> <undu> I'm modifying code right now that starts up the TPM Daemon using systemd, it's not meant to depend on other init/daemon systems
<QDX45> I'm not sure how much of systemd it depends on. The key daemons already seem to be running on alpine, which does have a working xen dom0
<d_bot> <undu> The ocaml daemons are all started by service files
<d_bot> <undu> Xenopsd on top of that creates service files dynamically to launch services when VMs are launched
Serpent7776 has quit [Quit: leaving]
<d_bot> <undu> To provide uefi variables and soon TPMs as well
<QDX45> Ok, fair enough. That's definitely a lot
<d_bot> <undu> Xenserver is a while distribution that makes sense as a whole product, running individual components is fine and well, but their integration is crucial
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<QDX45> I did hear from the xen folks that there is upstart and sysv-init compatibility, and openRC might happen too.
<QDX45> But yeah, that sounds like more than I can make happen.
QDX45 has quit [Ping timeout: 240 seconds]
Tuplanolla has quit [Quit: Leaving.]
vicfred has quit [Quit: Leaving]
bobo has quit [Read error: Connection reset by peer]
bobo has joined #ocaml
perrierjouet has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]