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/
zebrag has quit [Remote host closed the connection]
zebrag has joined #ocaml
Skyfire has quit [Quit: WeeChat 3.3]
sch1z0_c0d3 has left #ocaml [Leaving]
Skyfire has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nfc_ has quit [Ping timeout: 265 seconds]
rgrinberg has joined #ocaml
wyrd has quit [Remote host closed the connection]
wyrd has joined #ocaml
nfc_ has joined #ocaml
hackinghorn has joined #ocaml
hornhack has quit [Ping timeout: 265 seconds]
waleee has quit [Ping timeout: 245 seconds]
rgrinberg has quit [Ping timeout: 265 seconds]
rgrinberg has joined #ocaml
nfc_ has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Remote host closed the connection]
gopiandcode has joined #ocaml
rgrinberg has joined #ocaml
nfc_ has joined #ocaml
zebrag has quit [Remote host closed the connection]
ks_ has quit [*.net *.split]
riverdc_ has quit [*.net *.split]
theblatte has quit [*.net *.split]
Leonidas has quit [*.net *.split]
Leonidas has joined #ocaml
theblatte has joined #ocaml
riverdc has joined #ocaml
ks_ has joined #ocaml
<d_bot> <dariusf> is anyone else seeing `Uninterpreted extension` errors on extension nodes in ocaml platform? when i restart the lsp server the error goes away, but comes back on next save
<rgrinberg> There's a PR to fix that. Hopefully we'll release 1.9.0 with the fix soon
<d_bot> <dariusf> awesome, thanks
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shawnw has quit [Ping timeout: 245 seconds]
deus` has joined #ocaml
deus` has left #ocaml [#ocaml]
gravicappa has joined #ocaml
mro has joined #ocaml
vb has quit [Ping timeout: 245 seconds]
vb has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
Haudegen has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
vukung has joined #ocaml
Boarders has quit [Ping timeout: 245 seconds]
Boarders has joined #ocaml
hendursa1 has joined #ocaml
hendursaga has quit [Ping timeout: 276 seconds]
wwilly has quit [Quit: Leaving]
spip has quit [Quit: Konversation terminated!]
spip has joined #ocaml
wyrd has quit [Ping timeout: 276 seconds]
wyrd has joined #ocaml
bartholin has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<bartholin> how do I use a third-party library on the command line?
<bartholin> if I do open Cohttp;; I get an error about unbound module
<bartholin> if I do #load "cohttp.cma";; I also get an error because the file cannot be found
<d_bot> <Deus> Maybe you should take a look at ocamlfind
<bartholin> how do I invoke ocamlfind on the REPL?
<d_bot> <ggole> `#use "topfind";; #require "cohttp"`
<d_bot> <ggole> Or whatever the package name is
<d_bot> <Deus> ocamlfind is used to compile your project
<d_bot> <ggole> Note that it is a package name, not a file name
<bartholin> ggole: thanks
<d_bot> <ggole> You'll probably get sick of typing that pretty fast; you can make an init file that does the work for you and use `-init` to select it
mbuf has joined #ocaml
mro has quit [Remote host closed the connection]
hornhack has joined #ocaml
mro has joined #ocaml
hackinghorn has quit [Ping timeout: 260 seconds]
mro has quit [Remote host closed the connection]
Haudegen has quit [Quit: Bin weg.]
rond_ has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 258 seconds]
glassofethanol has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
gravicappa has quit [Ping timeout: 260 seconds]
mro has quit [Ping timeout: 264 seconds]
<bartholin> what is best: lwt or async?
Haudegen has joined #ocaml
mro has joined #ocaml
bobo has joined #ocaml
spip has quit [Ping timeout: 258 seconds]
mro has quit [Ping timeout: 245 seconds]
<d_bot> <dinosaure> multicore 🙂
<bartholin> yeah but there is either cohttp-async or cohttp-lwt, I don't see any cohttp-multicore :(
<d_bot> <dinosaure> depending on your context so, I would like to say `lwt` because it was what the community mostly uses but `async` can be better
<d_bot> <Anurag> Either one of lwt or async is a good choice. I’d say look at other libraries you’d like to use and see if they support lwt or async.
<bartholin> ok
hendursa1 has quit [Ping timeout: 276 seconds]
hendursa1 has joined #ocaml
<bartholin> also how do I prevent the # directives from outputting lots of lines of code
<bartholin> here is what I get when I launch ocaml https://p.teknik.io/Y1n6l
<bartholin> with my small .ocamlinit https://p.teknik.io/iatRr
<d_bot> <dinosaure> all of these lines tell you which dependencies are bring to load `cohttp`
<d_bot> <dinosaure> not sure that an option exists to delete such output
kurfen_ has quit [Ping timeout: 245 seconds]
wwilly has joined #ocaml
<bartholin> I am devilish https://p.teknik.io/4ZvG0
<bartholin> the only problem is that I don't see if there is any error, but whatever
quernd41 has joined #ocaml
quernd4 has quit [Ping timeout: 245 seconds]
quernd41 is now known as quernd4
gravicappa has joined #ocaml
kakadu has joined #ocaml
<bartholin> oh, with my hack, if there is a bug while loading the library, then I don't get stdout back. Yay!
mro has joined #ocaml
mro has quit [Ping timeout: 260 seconds]
hackinghorn has joined #ocaml
mro has joined #ocaml
hornhack has quit [Ping timeout: 258 seconds]
glassofethanol has quit [Read error: Connection reset by peer]
mro has quit [Remote host closed the connection]
glassofethanol has joined #ocaml
xiongxin has joined #ocaml
mro has joined #ocaml
rgrinberg has joined #ocaml
mro has quit [Ping timeout: 265 seconds]
waleee has joined #ocaml
zebrag has joined #ocaml
wyrd has quit [Remote host closed the connection]
vukung has quit [Quit: Lost terminal]
wyrd has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 258 seconds]
<d_bot> <toots> Hey 👋 With OCaml5 coming up with Domains, I'm trying to find a developer-oriented documentation of the features, limitations, how to use etc. Any of y'all know if a good link here? Thks!
<companion_cube> there's slides from talks, I guess
<companion_cube> you could read the monthly discuss thread on multicore OCaml
<d_bot> <toots> Yeah I read those but I'm looking for something a little bit more comprehensive.
<companion_cube> not sure there's more detaield than that
<d_bot> <toots> 👍
<companion_cube> I don't personally know more than that* I'd say
<companion_cube> look at domainslib and its documentation perhaps
<d_bot> <toots> I'll post something in the board then just wanted to check in here first.
<d_bot> <toots> Yeah I've seen that but I want to know about the low-level stuff 🙂
<companion_cube> there might be a paper on the GC architecture
<companion_cube> a lot of it is also changes to the runtime to remove globals and stuff
<companion_cube> but I don't think it'll be very different to use
mro has joined #ocaml
wwilly has quit [Ping timeout: 260 seconds]
<d_bot> <toots> For existing code yes but I want to know how to use the `Domain` module properly, I have scheduling library that could take advantage of it and is currently using `Thread` , `Mutex` and `Condition`. I'd like to know what I can get rid of in favor of `Domain` and `Atomic`
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
<companion_cube> yeah I'd like to know too
<companion_cube> Atomic is definitely not the same, and I don't expect most people to use it?
<companion_cube> (I mean it's cool for basic synchronization but it's not as general as Mutex)
<companion_cube> Domain would just replace Thread I think
mro has joined #ocaml
hyphen has joined #ocaml
wwilly has joined #ocaml
<d_bot> <toots> Yeah. Looks to me `Atomic` could avoid the use of `Mutex` to access/update protected values?
xiongxin has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<companion_cube> nope
<d_bot> <toots> How so?
<companion_cube> I mean, if your protected value is a bool or an integer
<companion_cube> and you only need like a compare-and-swap or something like that, then sure
<companion_cube> but a mutex can protect arbitrary data and critical sections
<companion_cube> if anything, atomics are often used to implement mutex :)
<d_bot> <toots> Yeah I'm thinking more like variable ref protected by a mutex.
<companion_cube> even then, depends on the type
<companion_cube> and on the operations
<companion_cube> Atomic only works for a fixed set of operations
<d_bot> <toots> Care to expand?
<companion_cube> Atomics are directly mapped into CPU instructions
<companion_cube> of which there's a fixed set
<companion_cube> compare and swap, increment and return, set, etc.
<companion_cube> super cheap (esp. on aarch64 apparently)
<d_bot> <toots> Word so super low level.
<companion_cube> but if your reference contains a data structure like a hashmap for example
<companion_cube> the atomics cannot protect a Hashtbl.replace
<d_bot> <toots> Hmm I wonder why it's not restricted by the typing system then.
<d_bot> <toots> Like maybe forcing a certain set of variants to be used with it.
Anarchos has joined #ocaml
<companion_cube> yeah idk
<companion_cube> oh, also, Domainslib adds "tasks", which are indeed going to be a nice change
<companion_cube> proper futures backed by a pool 🎉
<Anarchos> is there a good .h parser in ocaml ? i need an AST of the declarations of C/C++ header files.
<Armael> Anarchos: you can try clangml
<Armael> it's pretty good
<Anarchos> Armael thanks, i need that for a little decompiler i want to write
<companion_cube> @toots: heh, I guess you can have an Atomic of a pointer after all
<companion_cube> since, well, in OCaml all values are exactly 64 bits
<d_bot> <toots> Yeah that's why we need a comprehensive doc heh
<companion_cube> yeah I'm also interested
<companion_cube> if anything, because I could replace my own thread pool with Task :D
<hyphen> there was this blog post on soft vs hard docs in the ocaml ecosystem anyone knows what's the link to it?
<hyphen> hard docs being APIs and such, while soft docs are prose and examples
<d_bot> <toots> I'm fine with hard docs I just need a couple of sentences like do and don't and this is the limitation here. 🙂
<d_bot> <toots> The current `mli` are pretty sparse you know 🙂
<companion_cube> .mli can be sparse indeed
<companion_cube> but they've probably been focused on upstreaming
<companion_cube> before documenting thoroughly
<d_bot> <toots> Totally understand but now that the cat is out of the bag it's time to add docs for us to use 🙂
<companion_cube> it's not out of the bag yet! :p
<companion_cube> release of 5.0 is not there yet
<sadiq> fwiw you can still use Mutexes on OCaml 5.0
<sadiq> so you might be lucky and just Threads -> Domains could be enough
<sadiq> but I suspect there's a lot of thread unsafe stuff out there
mro has quit [Remote host closed the connection]
Anarchos has quit [Quit: Anarchos]
mro has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
glassofethanol has quit [Quit: leaving]
<d_bot> <dj charlie> oh man this new site and these new docs
<d_bot> <dj charlie> absolutely beautiful
<companion_cube> if you use threads, code might not become more unsafe?
<d_bot> <dj charlie> rust programmers need to come home to roost, back to papa ocaml
<companion_cube> you already need to use Mutex and stuff
<companion_cube> lol as if, rust is here to stay
<d_bot> <RegularSpatula> Are you talking about this: https://discuss.ocaml.org/t/ocaml-documentation-open-thread/1841
<d_bot> <RegularSpatula> Yesss every time I see people battling the borrow checker and thinking about lifetimes when they’re writing small apps to parse files or make http requests, I’m thinking, it’s so much simpler in ocaml…
<d_bot> <RegularSpatula> That said, rust was nice for doing scientific/numerical stuff
mro has quit [Remote host closed the connection]
bartholin has quit [Quit: Leaving]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
rak has quit [Quit: Segmentation fault (core recycled)]
rak has joined #ocaml
motherfsck has quit [Ping timeout: 252 seconds]
kakadu has quit [Quit: Konversation terminated!]
<hyphen> d_bot: nice, it's not exactly that but it goes into the same idea
Haudegen has joined #ocaml
wwilly has quit [Quit: Leaving]
motherfsck has joined #ocaml
mbuf has quit [Quit: Leaving]
Tuplanolla has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 258 seconds]
wonko has joined #ocaml
gravicappa has quit [Ping timeout: 245 seconds]
rond_ has quit [Quit: Client closed]
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #ocaml
<d_bot> <monk> i got into rust before i did ocaml and absolutely love the language but i do constantly wish there was like 1/5th the same ecosystem/community rallying around ocaml for all the domains where a borrow checker based language is not necessary
<d_bot> <monk> "not necessary" meaning "those of us who can worry less about resource efficiency and execution speed time".
<d_bot> <monk> i was just in the webdev channel the other day mourning the sparseness of webdev examples whereas rust has an endless stream of them. i really like rocket and hear good things about the more popular actix, but i'm also very cool with side stepping a bunch of macro and borrow checker stuff for setting up a webserver etc.
<d_bot> <monk> i keep thinking rust is bound to became a bigger deal in this area
<d_bot> <monk> but then i think about the amount of institutional buy-in for all the various ecosystems/libraries that offload their numerics into c++/fortran land and second guess it
<d_bot> <monk> it's not that a rust based project should set out to dethrone eg tensor flow but even the idea of a rust project coming out and then building up the gradual buy-in to come even close to the idea
<d_bot> <monk> would it be silly to start using 4.12+domains as a default switch for projects?
<sadiq> there's a real chance that some things will changed during the merge process.
<sadiq> and indeed we've already had a deprecation in domain vs thread local storage.
<sadiq> so essentially it's fine to go with 4.12+domains as long as you're comfortable changing things when you migrate to 5.0
<sadiq> (and also that 4.12+domains has had significantly less testing than trunk 4.12)
<d_bot> <monk> good to know. i just have small toy projects anyway.
<d_bot> <monk> the syntax for effects isn't going to land into 5.0, but will it possibly within the 5.x version of ocaml?
<d_bot> <monk> within a* 5.x version
<d_bot> <monk> seems like a big enough change to justify a major version, but fwik of ocaml's major versioning that feels like a fast jump assuming safe effects get figured out < 3 years or w/e
<d_bot> <octachron> This is the objective. But converging on a precise semantic and type system for effects will take some time.
<d_bot> <monk> that's really cool 🙂
<d_bot> <monk> truly, good luck on that effort
<d_bot> <octachron> And concerning major version number, between effects and modular implicits, those might change faster than usual indeed.
<sadiq> companion_cube, domains will probably uncover more thread unsafety than threads.
<sadiq> (because threads share a runtime lock, so you wouldn't notice issues with things that could only be accessed with the lock)
<d_bot> <infrandomness> Hi, does anyone know of a GUI library in OCaml, or bindings ? I'm looking forward making GUIs with this language
<d_bot> <Deus> Lablgtk
<companion_cube> sadiq: I suppose so, yes
<companion_cube> since preemption only happens at specific points with Threads
<companion_cube> I also have some code that assumes that changing, say, a `int ref` is atomic
<companion_cube> (since there's no allocation)
<smondet[m]> companion_cube: AFAIU that's what the Atomic module in the stdlib is for: right now it uses the assumption that you can modify refs and will be replaced with the preemptible one when domains are merged
<smondet[m]> BTW: see https://github.com/ocaml/ocaml/pull/9570 X. Leroy:
<smondet[m]> > I'm pretty sure the implementation is atomic both in native-code and in bytecode.
wonko has quit [Ping timeout: 260 seconds]
spip has joined #ocaml
bobo has quit [Ping timeout: 258 seconds]
<companion_cube> smondet[m]: I'll have to do my own shims anyway :)
<companion_cube> for pre-4.13 or whatever
<d_bot> <RegularSpatula> Agree 100% with everything you said, including the sci computing stuff (even also used rust for a few years before ocaml)
<d_bot> <RegularSpatula> I keep thinking about how to get ocaml on boarding experience to be closer to rust’s
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
hornhack has joined #ocaml
hackinghorn has quit [Ping timeout: 260 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
hornhack is now known as haunthack
mro has quit [Quit: Leaving...]
greyrat has joined #ocaml
haunthack has quit [Quit: Leaving]
shawnw has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wyrd has quit [Ping timeout: 276 seconds]
Haudegen has quit [Ping timeout: 245 seconds]
Tuplanolla has quit [Quit: Leaving.]
wyrd has joined #ocaml