companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
<dh`> me?
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
<discocaml> <yawaramin> or anyone else
<dh`> I was wondering if you meant my complaint, because I wouldn't expect that to be something that's either easily fixed or likely to interest upstream
<discocaml> <yawaramin> i did mean your complaint
<discocaml> <leviroth> I can't reproduce this.
tri has joined #ocaml
tri has quit [Ping timeout: 268 seconds]
Tuplanolla has quit [Quit: Leaving.]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 265 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
JuanDaugherty is now known as ColinRobinson
tri has joined #ocaml
tri has quit [Ping timeout: 252 seconds]
wbooze has joined #ocaml
alfiee has joined #ocaml
Inline has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
tri has joined #ocaml
tri has quit [Client Quit]
<discocaml> <purringhutao> @drupyog
<discocaml> <purringhutao>
<discocaml> <purringhutao> I'm actively working on a new release, see discussion at https://github.com/ocaml/opam-source-archives/pull/42. However, I'm a little confused by some aspects of how OCaml interacts with foreign code, which is why I've been asking some questions in this server for the past few days. (However, I feel that nobody here has given me good answers to my questions.)
<discocaml> <Alan> I have this mostly working on Linux, but I'm not sure about some stuff, and Homebrew doesn't seem to work
<discocaml> <Alan> I'm planning to split two versions, LLVM.18-static and LLVM.18-shared.
<discocaml> <Alan> If you know anyone who is an expert on how OCaml interacts with foreign libraries, who has the time for me to ask some questions, I would appreciate it
ColinRobinson has quit [Quit: praxis.meansofproduction.biz (juan@acm.org)]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
Haudegen has quit [Quit: Bin weg.]
<dh`> here's how to reproduce my complaint:
<dh`> module A = struct type t = int end
<dh`> module B = struct type t = A.t end
<dh`> module C = struct open A open B let x: t = 3 end
<dh`> and use ocamlopt -W +44 test.ml
<dh`> er, -w not -W
<discocaml> <Alan> Hmm, adding a -L flag completely changed how the stublibs was compiled...
<discocaml> <Alan>
<discocaml> <Alan> ```
<discocaml> <Alan> $ ldd dllllvm-good.so
<discocaml> <Alan> linux-vdso.so.1 (0x00007fff456b4000)
<discocaml> <Alan> libLLVM-18.so.18.1 => /lib/x86_64-linux-gnu/libLLVM-18.so.18.1 (0x00007f2ee63c6000)
<discocaml> <Alan> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2ee619d000)
<discocaml> <Alan> libffi.so.8 => /lib/x86_64-linux-gnu/libffi.so.8 (0x00007f2ee6190000)
<discocaml> <Alan> libedit.so.2 => /lib/x86_64-linux-gnu/libedit.so.2 (0x00007f2ee6156000)
<discocaml> <Alan> libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2ee606f000)
<discocaml> <Alan> libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2ee6051000)
<discocaml> <Alan> libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f2ee5f82000)
<discocaml> <Alan> libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f2ee5f50000)
<discocaml> <Alan> libxml2.so.2 => /lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f2ee5d6e000)
alfiee has joined #ocaml
<discocaml> <Alan> libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2ee5b01000)
<discocaml> <Alan> libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2ee5add000)
<discocaml> <Alan> /lib64/ld-linux-x86-64.so.2 (0x00007f2eeda36000)
<discocaml> <Alan> libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f2ee5ac3000)
<discocaml> <Alan> libicuuc.so.70 => /lib/x86_64-linux-gnu/libicuuc.so.70 (0x00007f2ee58c8000)
<discocaml> <Alan> liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f2ee589d000)
<discocaml> <Alan> libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f2ee5890000)
<discocaml> <Alan> libicudata.so.70 => /lib/x86_64-linux-gnu/libicudata.so.70 (0x00007f2ee3c72000)
<discocaml> <Alan> $ ldd dllllvm-bad.so
<discocaml> <Alan> linux-vdso.so.1 (0x00007fffc6da2000)
<discocaml> <Alan> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1bb83ff000)
<discocaml> <Alan> /lib64/ld-linux-x86-64.so.2 (0x00007f1bb8669000)
<discocaml> <Alan> ```
<discocaml> <yawaramin> dh`: seems worth filing an issue to me. if it's closed as not doable at least it should be documented
alfiee has quit [Ping timeout: 244 seconds]
<discocaml> <Kali> please avoid pasting code blocks in #general , the irc bridge has to send each newline separately
<discocaml> <Alan> Sorry
<discocaml> <Alan> I wonder if I should move this out of general?
<discocaml> <yawaramin> seems like #advanced-help would be better
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
euphores has quit [Quit: Leaving.]
<dh`> yawaramin: ok, I'll look into it tomorrow
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
euphores has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
nirvdrum74 has quit [Ping timeout: 246 seconds]
pi3ce has quit [Read error: Connection reset by peer]
nirvdrum74 has joined #ocaml
pi3ce has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 246 seconds]
Serpent7776 has joined #ocaml
Serpent7776 has quit [Ping timeout: 276 seconds]
olle has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
wickedshell has quit [Ping timeout: 272 seconds]
alfiee has joined #ocaml
<discocaml> <drupyog> @purringhutao I'm not very good at this part of OCaml, sorry
<discocaml> <drupyog> I can do more tests on linux, if need be
alfiee has quit [Ping timeout: 246 seconds]
bartholin has joined #ocaml
Inline has quit [Remote host closed the connection]
wbooze has quit [Remote host closed the connection]
wbooze has joined #ocaml
Inline has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 246 seconds]
Fardale1 has quit [Quit: WeeChat 3.8]
Tuplanolla has joined #ocaml
Fardale has joined #ocaml
<discocaml> <ilias1911> Hey there! I've been trying to add float16 support for ctypes here https://github.com/yallop/ocaml-ctypes/pull/788 but I'm not too satisfied with my solution, which involves generating some OCaml file at build time depending on the OCaml version. The key issue is with a match on a value describing the bigarray kinds: the `Float16` tag is only present post 5.2. I'm wondering if anyone here would have good suggestions on how to approach the pr
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
<discocaml> <amancuso7868> Dear community, would it be alright to post the link to a website I launched yesterday? There are no adverts, no tracking, nothing of the kind. Just highly specialized jobs: so far OCaml, Haskell, Ada. It's a personal project, not-for-profit.
Haudegen has joined #ocaml
wickedshell has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
Serpent7776 has joined #ocaml
dawids has joined #ocaml
dawids has quit [Remote host closed the connection]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
<discocaml> <lukstafi> It's alright by me to share it in `#general` where it will have a bigger reach; I presume it should be alright by everyone to share it in `#share`, which is meant to share such links regardless of whether the poster and the author are same/related; it might even be alright for `#working-on` if you'd like to get feedback.
<discocaml> <lukstafi> How does it compare to https://ocaml.org/jobs ?
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
olle has quit [Ping timeout: 268 seconds]
mercxry has quit [Quit: bye]
mercxry has joined #ocaml
<discocaml> <wayneyam> So my understanding now is that, a monad of type `'a t` is something that *should* give me a `'a` to work with, unlike something with type `'a` which is definitely a `'a`, and because of the possibility of uncertainty we can now incorporate side effects into the program
<discocaml> <froyo> damn, latest job posting is from last year
<discocaml> <froyo> `'a t -> 'a` is not a monadic operation. what you can do is supply a function to either `bind` or `map`
<discocaml> <wayneyam> at least it fits into Option/Either (it could fail) and IO monad and your monad
<discocaml> <froyo> once you've put `'a` in the `t`, those should be the only way to interact with it within this interface.
<discocaml> <wayneyam> I know, because you can't make something certain out of something uncertain
<discocaml> <wayneyam> at least that's my own way of seeing it
<discocaml> <froyo> you could of course do more than encode uncertainty in a general interface like this (look at the reader monad for a fun example (also a bit unintuitive to implement in ocaml)), but i think it's fair to approach it from that pov.
<discocaml> <froyo> you could say once a value is wrapped in this added context (being optional, nondeterministic, carrying more info around, ...), it's not possible to bring it back to the pure world.
<discocaml> <froyo> if you're familiar with js and such, this is their "coloring" problem
<discocaml> <wayneyam> yeah it seems like the main thing with monads are they add *something* that can't be removed?
<discocaml> <wayneyam> bind is the way you uncover what's inside but the context has to be re-added
<discocaml> <froyo> "add context" is one third of what makes a monad a monad, the other two are "define the operations" (so bind & unit) and "ensure their laws hold" (left & right identity, and associativity)
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
<discocaml> <amancuso7868> I can certainly draw inspiration from it!
<discocaml> <gooby_diatonic> One intuitive way to see monads is as encoding effects as well
<discocaml> <gooby_diatonic> Then `'a m` is a value of type `'a` with effect `m`
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
<discocaml> <gooby_diatonic> And the unescapability represents the fact you can't arbitrarily remove an effect
Leonidas has quit [Ping timeout: 260 seconds]
Leonidas has joined #ocaml
Serpent7776 has quit [Ping timeout: 244 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
<discocaml> <froyo> emphasising Monad isn't synonym of IO (what's commonly thought of when you say "effects") is worth it though
<discocaml> <froyo> it's one way to understand a utility of monads, and Octachron's example uses it to go from concrete example to an abstract understanding. I get that. It's just one example
<discocaml> <froyo> i get you're talking about the general notion of "effect" but if your statement is understood the same way as, say, "mappable encodes lists", you kinda do the understanding a disservice
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 272 seconds]
Serpent7776 has joined #ocaml
<dh`> monads aren't uncertainty, they're sequencing
<dh`> M t means "a sequence of operations that produces an t"
<dh`> if the operations involve uncertainty, then there's uncertainty in the result, like with the probability monad or with the interpretation of option/Maybe as a monad
<dh`> monads are also not a great model for effects, because while some effects require sequencing for coherence (e.g. updates to a single mutable variable), others don't (e.g. nontermination)
<dh`> and the general case of updates to mutable variables is a partial order, not a total order
<dh`> (and while you can stuff threads into IO and haskell does, it's not natural and ultimately boils down to telling lies about the sequential behavior of the IO world state)
deadmarshal_ has quit [Remote host closed the connection]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
deadmarshal_ has joined #ocaml
rgrinberg has joined #ocaml
Anarchos has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<discocaml> <Alan> Monads basically give a "denotational semantics" of a computation that produces a value. When monads are exposed in the programming language, they're basically computations represented as values.
<discocaml> <Alan>
<discocaml> <Alan> You can think of a monad as the *computational interpretation* of some parametric data type. `'a option` means a computation that can produce `'a` or fail. `'r -> 'a` means a computation that reads from an environment `'r` and produces `'a`. `'s -> 's * 'a` means a stateful computation that produces `'a`.
alfiee has joined #ocaml
<discocaml> <Alan> You can basically give monadic data types a dual interpretation: a value interpretation or a computational interpretation.
<discocaml> <Alan>
<discocaml> <Alan> Option: Value interpretation is a possibly absent value, computational interpretation is a failing computation.
<discocaml> <Alan> Either/Result: Value interpretation is a sum type, computational interpretation is an exception-throwing computation.
<discocaml> <Alan> Function: Value interpretation is a function, computational interpretation is a computation that "read" from some external environment.
alfiee has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
tri has joined #ocaml
Inline has quit [Quit: Leaving]
wbooze has quit [Quit: Leaving]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Exa has joined #ocaml
rgrinberg has joined #ocaml
Inline has joined #ocaml
wbooze has joined #ocaml
<dh`> the computation model is often the best way to think about it
<dh`> but it has the same caveat as effects: monads are sequential, computations aren't necessarily
<dh`> (exhibit A: "pure" haskell code that can throw exceptions)
burley has joined #ocaml
alfiee has joined #ocaml
burley has quit [Remote host closed the connection]
burley has joined #ocaml
tri has quit [Remote host closed the connection]
alfiee has quit [Ping timeout: 260 seconds]
burley has quit [Remote host closed the connection]
burley has joined #ocaml
burley has quit [Client Quit]
burley has joined #ocaml
burley has quit [Client Quit]
burley has joined #ocaml
tri has joined #ocaml
tri has quit [Remote host closed the connection]
tri has joined #ocaml
alfiee has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tri has quit [Ping timeout: 268 seconds]
alfiee has quit [Ping timeout: 268 seconds]
tri has joined #ocaml
rgrinberg has joined #ocaml
tri has quit [Ping timeout: 260 seconds]
tri has joined #ocaml
tri has quit [Ping timeout: 268 seconds]
sixfourtwelve has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tri has joined #ocaml
rgrinberg has joined #ocaml
tri has quit [Ping timeout: 276 seconds]
burley has quit [Remote host closed the connection]
sixfourtwelve has quit [Quit: leaving]
Serpent7776 has quit [Ping timeout: 252 seconds]
wbooze has quit [Ping timeout: 265 seconds]
Inline has quit [Ping timeout: 265 seconds]
tri has joined #ocaml
burley has joined #ocaml
tri has quit [Ping timeout: 246 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
tri has joined #ocaml