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/
Tuplanolla has quit [Quit: Leaving.]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
berberman has joined #ocaml
berberman_ has quit [Ping timeout: 255 seconds]
wagle has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
wagle has joined #ocaml
waleee has quit [Ping timeout: 246 seconds]
dwt_ has quit [Ping timeout: 265 seconds]
dwt_ has joined #ocaml
favonia has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 240 seconds]
favonia has joined #ocaml
mbuf has joined #ocaml
zebrag has quit [Remote host closed the connection]
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 240 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
Nahra` has quit [Remote host closed the connection]
Nahra` has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
gravicappa has joined #ocaml
favonia has quit [Ping timeout: 240 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 240 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 240 seconds]
favonia has joined #ocaml
mro has joined #ocaml
berberman has quit [Ping timeout: 246 seconds]
berberman has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
Haudegen has joined #ocaml
favonia has joined #ocaml
botenkhamen|2 has joined #ocaml
favonia has quit [Ping timeout: 240 seconds]
favonia has joined #ocaml
botenkhamen|2 has left #ocaml [No boundaries on the net!]
favonia has quit [Ping timeout: 246 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 240 seconds]
favonia has joined #ocaml
TakinOver has joined #ocaml
favonia has quit [Ping timeout: 245 seconds]
favonia has joined #ocaml
hackinghorn has quit [Ping timeout: 255 seconds]
Tuplanolla has joined #ocaml
<d_bot> <sarna> hey, I'd like to rewrite one of my python scripts with ocaml. is there any high-level utility library for unix-y stuff? besides the one in jane street's core
favonia has quit [Ping timeout: 256 seconds]
<hannes> sarna: I use bos (https://erratique.ch/software/bos) for basic OS interaction (manipulating files), and can recommend that.
favonia has joined #ocaml
<dh`> why would you need anything other than https://ocaml.org/releases/4.12/api/Unix.html?
<d_bot> <sarna> thanks hannes!
<d_bot> <sarna> dunno, I've been recommended jane street's libraries a couple years back and I've never used the default stdlib
<d_bot> <sarna> is it better now? I haven't used ocaml much in the meantime
<Armael> it's better, but bos still has a good number of convenience functions
<Armael> I also like it's insistance in wrapping everything with result types instead of relying on exceptions, for increased robustness
<Armael> and nowadays thanks to let-operators working within a result monad is not that annoying
<Armael> insistence*
<hannes> one thing is that system calls could be interrupted by EINTR, which in bos leads to a retry -- in stdlib Unix module you need to do that manually.
<d_bot> <sarna> Armael: so would you still use core_kernel by default these days? or is it unnecessary
<Armael> I couldn't say, I've never used core_kernel :)
<hannes> Armael: since you worked with gasche on the Unix.environment being lazy in opam, I was curious whether you have an opinion on https://github.com/ocaml/opam/pull/4731 (or whether you [tried to] use opam-2.1 with depext integrated)?
<d_bot> <sarna> I have to admit I haven't found a good equivalent for jane street's CLI module, and it's in core :(
<Armael> hannes: ah yes. it was some time ago so I don't have it in cache right now, what I can say for sure is that we didn't try using depext
<hannes> sarna: if you mean arguments (optional/required), man page, --help etc., I recommend to look at cmdliner https://erratique.ch/software/cmdliner :)
<Armael> if I understand correctly, your PR generalizes the approach we were implementing in #4111 to also work for the depext (integrated) plugin?
<hannes> Armael: yes, so after your (very nice) work there was still a stray "let default_env = Unix.environment ()" deep in OpamSystem (a module used e.g. for depext) -- this certainly captures the initial environment (and similar to your use, I use opam-client as a library, and would first like to remove some environment variables)
<Armael> arg, I see
<hannes> ..but then it looks like david considers this as "a new feature" :/
<Armael> your PR sounds good then, indeed we really don't want any environment capture at module initialization time, because that's really annoying if you use opam as a library
<d_bot> <sarna> hannes: looks great! and it supports subcommands, nice. thanks :)
<Armael> ah, I see :/
<hannes> Armael: if you could post that as a comment on that PR, I'd be a very happy hannes
<Armael> :) will do
<hannes> (there's as well an alternative commit which just does a delay "let default_env () = Unix.evironment ()"..
<Armael> btw, is your change observable if you use opam2.1+depext the "normal way" (by using opam as a binary, not a library) ?
<hannes> Armael: I did not do the measurement, since opam depext calls out to processes maybe 2 or 3 times, my intuition is "no" -- but I also think we're some steps before "performance measurements" (instead at "is this a feature or a bugfix? may it go to 2.1?")
<Armael> ye, I see
mro has quit [Remote host closed the connection]
<d_bot> <Cyclomatic Complexity> helloooo
<d_bot> <Cyclomatic Complexity> more lambda calculus questions
<hannes> and imho semantic-wise my PR is very nicely in the spirit of your earlier work, and would make opam 2.1 usable as a library (with modified environments)
hackinghorn has joined #ocaml
<d_bot> <Cyclomatic Complexity> naive small-step cbv interpreter for lambda calculus is inefficient (as explained in those slides from leroy https://xavierleroy.org/mpri/2-4/semantics.pdf ) because you have to check if each subterm is normal before reducing any redex, which is O(size) of your term
<d_bot> <Cyclomatic Complexity> "fix" mentioned in the paper is a big-step interpreter, which is bad for my purposes
<d_bot> <Cyclomatic Complexity> easy way is to small-step-ify the big-step interpreter through CPS, but the problem is that naive CPS makes the continuation an OCaml function, which can't be inspected
<d_bot> <Cyclomatic Complexity> i imagine there is a simple data-structure / fancy zipper representing that CPS in order to get an "efficient" (assuming efficient substitutions) small-step interpreter
<d_bot> <Alistair> Or manually make a representation, defun isnโ€™t too hard
<d_bot> <Cyclomatic Complexity> isn't it though? a generic zipper on an ast could grow very big
<d_bot> <Alistair> Defunctionalization is essentially manually making a call-stack where each continuation item represents a stack frame (but stored on the heap instead of the stack).
<d_bot> <Cyclomatic Complexity> I'll check this, thanks ๐Ÿ™‚
<d_bot> <Alistair> This is a great paper if you're looking for resources: https://homepages.inf.ed.ac.uk/wadler/papers/papers-we-love/reynolds-definitional-interpreters-1998.pdf
bartholin has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 255 seconds]
olle has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 240 seconds]
favonia has joined #ocaml
mro has joined #ocaml
favonia has quit [Ping timeout: 245 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 245 seconds]
favonia has joined #ocaml
adrien__ is now known as adrien
mro_ has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
mro has joined #ocaml
mro_ has quit [Ping timeout: 256 seconds]
Haudegen has quit [Quit: Bin weg.]
favonia has quit [Ping timeout: 250 seconds]
favonia has joined #ocaml
sagax has quit [Ping timeout: 258 seconds]
mbuf has quit [Quit: Leaving]
favonia has quit [Ping timeout: 240 seconds]
favonia has joined #ocaml
waleee has joined #ocaml
Guest8616 has quit [Quit: Konversation terminated!]
spip has joined #ocaml
spip is now known as Guest1511
favonia has quit [Ping timeout: 240 seconds]
favonia has joined #ocaml
Haudegen has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
adinf has joined #ocaml
<d_bot> <stab> Anybody have any information on mirroring opam repositories for offline dev? cant find much information on it. Just basically looking to do something where i can add all of the dependencies i have for library and then mirror them over to an offline environment. Ideally id be able to mirror compiler versions installed through opam as well
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<d_bot> <anmonteiro> Maybe @hannes
<d_bot> <anmonteiro> I remember he did that for the Morocco retreats
<d_bot> <undu> `opam admin cache` creates the offline cache, not sure if that's what you want, as it caches all versions for all packages afaik
<d_bot> <sarna> what do you do if an argument name clashes with a built-in identifier? I'm having problems with an argument named `to` atm haha
<d_bot> <sarna> I renamed it to `to'` and it works, but is there any better convention?
<Armael> I'd name it to_
<Armael> but to' also works I guess
<Armael> (but for me to' would be if I alreadyhave
<Armael> if I already had something named to)*
waleee has quit [Ping timeout: 252 seconds]
<d_bot> <sarna> thanks!
favonia has quit [Ping timeout: 256 seconds]
<d_bot> <stab> hmm let me see. I assume that still means users will have to manually pull over compiler versions. To be clear about the usecase here im trying to setup some sort of opam mirror for multiple users to pull down the correct deps and ocaml compiler version if they have opam installed
<d_bot> <undu> yes, the command downloads all the tarballs and stores them according to their hashes, like the official opam cache
favonia has joined #ocaml
<d_bot> <undu> to use it archive-mirrors can point to the directory containing the cache. This can be set in the archive-mirrors fields of the `repo` file in the checked-out repository or somewhere in the user config files (but I don't know exactly where)
<Armael> IIRC the workflow from marrakesh, as a user you'd just add an opam repository with the mirror and opam would use that. if you additionally remove the "default" opam repository then I guess you'd only be able to install packages present in the mirror repo
<Armael> (you can also specify priorities between opam repositories so you probably don't strictly need to remove the default repository, depending on your usecase)
<d_bot> <undu> yeah, that's how it's done for xapi-project as well, add xs opam as repo and remove the default one, the packages are stilled downloaded from the original tarballs, usually in github
<d_bot> <undu> the archive mirror is needed to change where it gets downloaded from
<Armael> ah, I see
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
<d_bot> <stab> Thanks makes sense, ill see what i can do
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
<d_bot> <andreypopp> gen_js_api: how hard it would be to teach gen_js_api to generate TypeScript defintions?
favonia has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
dhil has joined #ocaml
mro has joined #ocaml
bartholin has quit [Quit: Leaving]
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
mro has quit [Remote host closed the connection]
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
gravicappa has quit [Ping timeout: 258 seconds]
favonia has quit [Ping timeout: 240 seconds]
neiluj has joined #ocaml
favonia has joined #ocaml
<neiluj> hello! can this small function that computes the string representation of an integer in binary be improved, please? https://bpa.st/IVZA
<neiluj> It could be done imperatively with Bytes.blit, but wondering if there's a way to do it in a more functional way
<companion_cube> I can suggest less functional ways
<companion_cube> like, Buffer.t :)
<neiluj> oh that seems like the perfect structure for the task!
<neiluj> thanks :)
gravicappa has joined #ocaml
mro has joined #ocaml
<neiluj> damn, so much abstraction
<neiluj> thanks, that's beautiful
<companion_cube> meh, not sure it was worth it tbh
<neiluj> why not
<neiluj> brb
neiluj has quit [Quit: Leaving]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
mro has quit [Remote host closed the connection]
adinf has quit [Ping timeout: 256 seconds]
berberman has quit [Ping timeout: 255 seconds]
motherfs1 has quit [Quit: quit]
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
adinf has joined #ocaml
neiluj has joined #ocaml
Haudegen has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
favonia has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
<neiluj> Any recommendations for a database backend? It'd be used as an on-disk key-value store for binary data.
<neiluj> Irmin has a user-friendly api
<neiluj> but it might be overkill
<companion_cube> what are you building, remind me?
<companion_cube> for on disk files, I'd suggest sqlite anyway
rwmjones is now known as rwmjones|afk
sagax has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
neiluj has quit [Ping timeout: 255 seconds]
Guest25 has joined #ocaml
waleee has joined #ocaml
favonia has quit [Ping timeout: 240 seconds]
neiluj has joined #ocaml
<neiluj> A distributed hash table
favonia has joined #ocaml
<companion_cube> ah right
<companion_cube> do you happen to use bencode, or is it a different protocol?
<neiluj> something different, data-encoding: https://gitlab.com/nomadic-labs/data-encoding
<companion_cube> no but as a format
<neiluj> for the protocol messages?
<companion_cube> for whatever
<neiluj> hmm, no bencode at least
<neiluj> oh, json
<neiluj> or binary
<neiluj> could use bson too
<companion_cube> I see
<neiluj> besides it's userfriendliness, the concept of branches from Irmin could be useful for a dht
<companion_cube> hum
<companion_cube> branches don't distribute well, do they? if it's like git :D
<neiluj> hmm, really? they could correspond to several tables
<neiluj> nevermind, sqlite is enough
<neiluj> thanks :)
favonia has quit [Ping timeout: 255 seconds]
Guest25 has quit [Quit: Ping timeout (120 seconds)]
Guest25 has joined #ocaml
Guest25 has quit [Client Quit]
favonia has joined #ocaml
adinf has quit [Ping timeout: 255 seconds]
gravicappa has quit [Ping timeout: 265 seconds]
Stumpfenstiel has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
adinf has joined #ocaml
olle has quit [Ping timeout: 256 seconds]
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 255 seconds]
gravicappa has joined #ocaml
neiluj has quit [Quit: Leaving]
favonia has joined #ocaml
gravicappa has quit [Ping timeout: 255 seconds]
cedric has joined #ocaml
favonia has quit [Ping timeout: 252 seconds]
adinf has quit [Ping timeout: 245 seconds]
favonia has joined #ocaml
zebrag has joined #ocaml
favonia has quit [Ping timeout: 240 seconds]
sagax has quit [Ping timeout: 245 seconds]
favonia has joined #ocaml
dhil has quit [Ping timeout: 252 seconds]
favonia has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
Stumpfenstiel has quit [Ping timeout: 268 seconds]
cedric has quit [Quit: Konversation terminated!]
berberman has joined #ocaml
Haudegen has quit [Ping timeout: 265 seconds]
favonia has quit [Ping timeout: 255 seconds]
favonia has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
adinf has joined #ocaml
favonia has quit [Ping timeout: 245 seconds]
favonia has joined #ocaml