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/
Tuplanolla has quit [Ping timeout: 248 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
trillion1exabyte has quit [Ping timeout: 248 seconds]
trillion_exabyte has joined #ocaml
czy has joined #ocaml
czy has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 30.0.50)]
czy has joined #ocaml
czy` has joined #ocaml
czy has left #ocaml [C-x C-c]
spip has quit [Quit: Konversation terminated!]
troydm has quit [Ping timeout: 260 seconds]
<Ankhers> Is Real World OCaml still the suggested way of learning the language?
azimut has joined #ocaml
waleee has quit [Ping timeout: 246 seconds]
user___ has joined #ocaml
user___ has quit [Client Quit]
azimut has quit [Ping timeout: 255 seconds]
azimut has joined #ocaml
chrisz has quit [Ping timeout: 260 seconds]
chrisz has joined #ocaml
tjnhxmzhmqgytuwt is now known as Guest809
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
czy` has quit [Remote host closed the connection]
tjnhxmzhmqgytuwt has joined #ocaml
troydm has joined #ocaml
trillion_exabyte has quit [Ping timeout: 248 seconds]
trillion_exabyte has joined #ocaml
motherfsck has quit [Ping timeout: 248 seconds]
trillion_exabyte has quit [Ping timeout: 248 seconds]
trillion_exabyte has joined #ocaml
dh` has joined #ocaml
<dh`> what should I be using for editing ocaml in emacs28?
<dh`> it defaults to some lisp mode with completely wrong ideas about indentation
azimut has quit [Ping timeout: 255 seconds]
azimut has joined #ocaml
ansiwen_ has quit [Quit: ZNC 1.7.1 - https://znc.in]
azimut has quit [Ping timeout: 255 seconds]
ansiwen has joined #ocaml
azimut has joined #ocaml
motherfsck has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
azimut has joined #ocaml
<discocaml> <dj charlie> anyone recommend a package for any programming language to manipulate typescript source? ideally ocaml, haven't found anything
jao has quit [Ping timeout: 268 seconds]
xgqt has quit [Ping timeout: 252 seconds]
xgqt has joined #ocaml
motherfsck has quit [Ping timeout: 248 seconds]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
trev has joined #ocaml
bartholin has joined #ocaml
Serpent7776 has joined #ocaml
motherfsck has joined #ocaml
mro has joined #ocaml
mal``` has quit [Quit: Leaving]
mal`` has joined #ocaml
hackinghorn has quit [Ping timeout: 246 seconds]
fds has quit [Ping timeout: 255 seconds]
fds has joined #ocaml
hackinghorn has joined #ocaml
keyboard has joined #ocaml
Haudegen has joined #ocaml
motherfsck has quit [Ping timeout: 248 seconds]
<octachron> dh`, tuareg + merlin (or ocaml-lsp)?
bartholin has quit [Quit: Leaving]
bgs has joined #ocaml
olle has joined #ocaml
olle has quit [Remote host closed the connection]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
Anarchos has joined #ocaml
uics has joined #ocaml
spip has joined #ocaml
uics has quit [Remote host closed the connection]
uics has joined #ocaml
uics has quit [Remote host closed the connection]
troydm has quit [Ping timeout: 268 seconds]
<dh`> octachron: idk, I'm used to an older emacs that does innocuous things by default
<dh`> I just need something that doesn't insist on moving all text to column 0 every time you turn around
uics has joined #ocaml
<hannes> dh`: I use ocp-indent for indentation of OCaml code in Emacs
olle has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
keyboard has quit [Ping timeout: 248 seconds]
keyboard has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<discocaml> <psychokitty> does OCaml's GC have a notion of pinning? I know there's C macros that seem to achieve this in effect, but I've only seen it used ephemerally, never C code book keeping OCaml blocks
<olle> Didn't someone ask that on the forum?
<olle> Or similar
<olle> I have another question about OCaml ast - does it have mutable record fields?
<Anarchos> olle mutable record fields : yes
<discocaml> <NULL> Are they ?
<Anarchos> you must declare them with the keyword 'mutable'
<Anarchos> {mutable x: int}
<discocaml> <NULL> I understood the question as whether the OCaml AST (Parsetree) had mutable fields in its representation of terms, given the context
<olle> discocaml: yes correct, sorry if I wasn't clear
<discocaml> <NULL> (NULL, that name is the bot's)
<olle> oh right
<olle> sorry
<discocaml> <NULL> As far as I can see, there are no `mutable` in https://github.com/ocaml/ocaml/blob/trunk/parsing/parsetree.mli (except the parsed mutable keyword)
Haudegen has quit [Quit: Bin weg.]
uics has quit [Remote host closed the connection]
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
uics has joined #ocaml
uics has left #ocaml [#ocaml]
uics has joined #ocaml
tristanC_ has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
troydm has joined #ocaml
keyboard has quit [Ping timeout: 260 seconds]
keyboard has joined #ocaml
uics has quit [Remote host closed the connection]
<companion_cube> the typedtree has mutability in it
<companion_cube> for typechecking
<octachron> Well, the type systems itself contains type digraphs with cycles, those are hard to implement efficiently without mutability.
<companion_cube> (cycles because of objects/poly variants?)
reynir has joined #ocaml
<discocaml> <Marc de Falco> Sorry for the stupid question, but can OCaml threads be preempted while doing only computations (memory access, no I/O or system calls)? I'm assuming that they can't but I'd like to be sure.
<discocaml> <octachron> They can be preempted outside of allocations since 4.13 .
<discocaml> <Marc de Falco> For example, can they be preempted while executing `a := !a + 1` between getting the value of `!a` and storing the new value?
<discocaml> <octachron> This is memory unsafe and with modern CPU architecture, you don't even need preemption to have problems.
<companion_cube> yeah, if you need to have `a` shared between threads, use `Atomic.t`
<discocaml> <Marc> Yes, of course. It's what I'm seeking to have issues here for teaching purpose 😄 But using `Thread` it's seems to me that issues are not going to happen with the current implementation.
<companion_cube> ah yes, with threads it's kind of ok
<companion_cube> (bad taste, but ok)
jao has joined #ocaml
<discocaml> <octachron> With the domain/runtime lock, you will probably be safe if the threads belong to the same domain.
<olle> companion_cube: oh ok
<olle> I asking because my own inference code is a giant ball of mud ><
<olle> Having to both infer the type and return the new ast node
<olle> So maybe changing types to mut cells could help. Have to think about it.
Haudegen has joined #ocaml
kakadu has quit [Ping timeout: 248 seconds]
kakadu has joined #ocaml
Anarchos has joined #ocaml
<discocaml> <peval> you can also do it with a map that associates expressions with their type
<companion_cube> it'd become a very large map
<companion_cube> (ignoring the issue of cyclic types)
<discocaml> <peval> typed racket just gets unique identifiers for every ast node from the hygienic macro expansion and uses a map for types like that, or at least it did origionally
mro has quit [Remote host closed the connection]
count3rmeasure has joined #ocaml
<olle> peval I have a hashtable, buut
<olle> I use it for variables in scope and such
<companion_cube> for scoping, a hashtable is very useful indeed
waleee has joined #ocaml
<olle> Yep
<discocaml> <peval> the "slow" way can be pretty nice though https://bpa.st/WFF4C
<olle> o.o
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<discocaml> <peval> another nice but slow thing there is using "inlining" for let polymorphism
<olle> ?
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<discocaml> <peval> variables bound with let get copied and inferred at every use site instead of dealing with ranks
Anarchos has quit [Quit: Vision[]: i've been blurred!]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
motherfsck has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
<olle> ranks?
* olle poor brain
<companion_cube> @peval: hmm, your infer should return the new env as well
<companion_cube> if you do unification
wingsorc has quit [Quit: Leaving]
* olle praise mutability
<olle> \o/
olle has quit [Remote host closed the connection]
wingsorc has joined #ocaml
mro has quit [Remote host closed the connection]
Haudegen has quit [Quit: Bin weg.]
<discocaml> <peval> the equality constraints are in the store that unify mutates
<companion_cube> ah so you do have some mutation, ok
kakadu has quit [Remote host closed the connection]
salkin has joined #ocaml
keyboard has quit [Ping timeout: 248 seconds]
tjnhxmzhmqgytuwt has quit [Ping timeout: 248 seconds]
bartholin has joined #ocaml
salkin has quit [Ping timeout: 248 seconds]
mro has joined #ocaml
count3rmeasure has quit [Read error: Connection reset by peer]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
olle has joined #ocaml
keyboard has joined #ocaml
mro has quit [Ping timeout: 248 seconds]
<discocaml> <Alistair> Is there a way to open a module but hide a specific module in that opened module?
Tuplanolla has joined #ocaml
mro has joined #ocaml
<discocaml> <octachron> You can shadow the module that you want to hide with another one (possibly empty).
<discocaml> <Alistair> It's more of a case that I have a module in `foo.ml` in my library and I'm opening a module `Bar` with a module `Foo` but I'd like to refer to my original `Foo` without creating an alias
trev has quit [Remote host closed the connection]
gwizon has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
<discocaml> <octachron> As far I can see, you will need an alias one way or another to reintroduce `Foo` after opening `Bar`.
<discocaml> <octachron> (you could constraint `Bar` with a signature that exclude `Foo` but that's far more work)
<discocaml> <Alistair> Yeah, decided to just not open `Bar` in the end
<discocaml> <geoff> Could alias bar down to one letter `B.`, not *too* painful
<discocaml> <Alistair> Yeah, I've done that
Anarchos has joined #ocaml
<discocaml> <leviroth> In case you hadn’t considered it, you could alias Foo, open Bar, and then alias Foo back to its original definition. That way you don’t have to actually use the alias after the initial setup.
<discocaml> <deepspacejohn> I've gotten used to using one-letter modules almost everywhere instead of `open`. The extra 2 characters is worth it for not having to worry about shadowing or figuring out where a value came from.
<Anarchos> why do opam tar the default repo when i install a package ?
uics has joined #ocaml
waleee has joined #ocaml
<discocaml> <Alistair> I had considered this
Anarchos has quit [Ping timeout: 248 seconds]
Anarchos has joined #ocaml
Stumpfenstiel has joined #ocaml
Haudegen has joined #ocaml
bgs has quit [Remote host closed the connection]
mro has quit [Remote host closed the connection]
xgqt has quit [Remote host closed the connection]
xgqt has joined #ocaml
mro has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
uics has quit [Remote host closed the connection]
uics has joined #ocaml
Serpent7776 has quit [Ping timeout: 252 seconds]
bartholin has quit [Quit: Leaving]
waleee has joined #ocaml
mro has quit [Quit: Leaving...]
Stumpfenstiel has quit [Ping timeout: 248 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Haudegen has quit [Ping timeout: 255 seconds]
kurfen has quit [Ping timeout: 252 seconds]