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/
myrkraverk__ has joined #ocaml
myrkraverk_ has quit [Ping timeout: 272 seconds]
malte has quit [Remote host closed the connection]
malte has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
<pgiarrusso> contificate: my impression is that dh` was never talking about J, but only about W
<discocaml> <contificate> just goes to show how error prone W is
<pgiarrusso> What about backtracking mutations from J?
<pgiarrusso> I'm sure it can be done, since it happens in Rocq and Scalac at least (not for J, but still for algorithms using unification)
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
<companion_cube> push type variable bindings onto a undo stack
ygrek has quit [Remote host closed the connection]
<discocaml> <uberpyro181> the substitution is applied to the context before the next unification problem (resp. type variables are updated in place)
<discocaml> <uberpyro181> so once you apply some `[x1 |-> f(x2)]`, `x1` is gone everywhere, forever
<companion_cube> you might write that on paper, but it's not a good implementation
<discocaml> <uberpyro181> if you did have successive substitutions like `[x |-> y][y |-> x]`, i mean this works out to `[y |-> y]`
<discocaml> <uberpyro181> you can't really create cycles this way
<discocaml> <uberpyro181> i agree W is too slow for real implementations and that J is the starting point for anyone looking to implement an HM system
<discocaml> <uberpyro181> W does have uses when it comes to some niche extensions. e.g. if your system lacks principal types and you want to do a tree search over typings, you want purity
<discocaml> <uberpyro181> or if you go beyond syntactic unification / free type constructors and into algebra, the trick doesn't save as much time
<discocaml> <uberpyro181> or if you go beyond syntactic unification / free type constructors and into algebra, the trick doesn't save as much time (because you need to work in terms of canonical forms)
<discocaml> <uberpyro181> for incremental typechecking, i'm not sure how much it matters, given that fully generalized types don't mutate
<discocaml> <uberpyro181> or if you go beyond syntactic unification / free type constructors and into algebra, the trick doesn't save as much time (because you need to work in terms of canonical forms)
<discocaml> <uberpyro181> (you can can mutable references to manage the context efficiently, but union-find doesn't help.)
<discocaml> <uberpyro181> if you did have successive substitutions like `[x |-> y][y |-> x]`, i mean this works out to `[x |-> y, y |-> y]`
myrkraverk__ has quit [Ping timeout: 244 seconds]
myrkraverk has joined #ocaml
Humean has joined #ocaml
agentcasey_ has quit [Remote host closed the connection]
agentcasey has joined #ocaml
hwj has joined #ocaml
Serpent7776 has joined #ocaml
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 252 seconds]
agentcasey has quit [Quit: ZNC 1.10.x-git-38-e8c4cda0 - https://znc.in]
agentcasey has joined #ocaml
kurfen has quit [Ping timeout: 252 seconds]
sroso has quit [Ping timeout: 252 seconds]
casastorta has quit [Quit: ZNC 1.9.1 - https://znc.in]
casastorta has joined #ocaml
agentcasey has quit [Quit: ZNC 1.10.x-git-38-e8c4cda0 - https://znc.in]
agentcasey has joined #ocaml
agentcasey has quit [Quit: ZNC 1.10.x-git-38-e8c4cda0 - https://znc.in]
agentcasey has joined #ocaml
bartholin has joined #ocaml
agentcasey has quit [Ping timeout: 260 seconds]
Humean has quit [Quit: Leaving]
agentcasey has joined #ocaml
Humean has joined #ocaml
bartholin has quit [Quit: Leaving]
Haudegen has joined #ocaml
Humean has quit [Ping timeout: 252 seconds]
dhil has joined #ocaml
m5zs7k has quit [Ping timeout: 276 seconds]
hwj has quit [Ping timeout: 260 seconds]
m5zs7k has joined #ocaml
wbooze is now known as Inline
Haudegen has quit [Quit: Bin weg.]
<companion_cube> You really shouldn't bind y to y
<companion_cube> In all the unification/substitution algorithms I've implemented it leads to an infinite loop
<discocaml> <uberpyro181> i guess implementation-wise there are weird edgecases like that, but i was just trying to make a point
<discocaml> <uberpyro181> i guess it's moot anyway
<discocaml> <uberpyro181> i'll add one thing here because i didn't actually make a point
<discocaml> <uberpyro181> in my own experience, which is experimenting with weird type system extensions, the big pain point with mutable variables is that they can't be used as keys for maps and sets
<discocaml> <uberpyro181> because they can mutate which messes up tree invariants and changes the hash, obviously
<discocaml> <uberpyro181> this is really inconvenient for some type level features, the most extereme cases are like intersection/union types or other sorts of boolean types
<discocaml> <uberpyro181> because the polynomial normal form maps set of variables to their coefficients, but the variables are un-key-able
<discocaml> <uberpyro181> i don't have much experience but i'm guessing annoyances like this also crop up with other advanced type system features
<discocaml> <uberpyro181> the HM type system finds itself in a local optima in like 20 different dimensions simultaneously, between ease of implementation, performance and mutable impelmentation, sizes of types, etc
<discocaml> <uberpyro181> the age old story is that things sort of degrade when you take steps in any direction, and that breaks what works well in traditional circumstances
Haudegen has joined #ocaml
kurfen has joined #ocaml
tremon has joined #ocaml
<discocaml> <contificate> it's just neat, is what it is
<discocaml> <contificate> if OCaml disappeared from reality, can see myself going to SML, y'know
<discocaml> <contificate> but if Haskell disappeared, nobody's going to Miranda
<discocaml> <contificate> my lukewarm take is actually that the type system is not overly important, nobody would use these languages if they lacked pattern matching
Inline has quit [Quit: Leaving]
za3k is now known as jenrm
jenrm is now known as za3k
ygrek has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<dh`> how else would you unpack sums? generate an is_foo and unpack_foo function for each constructor?
<dh`> (is_foo x = match x with Foo _ -> true | _ -> false; unpack_foo x = match x with Foo x' -> x' | _ -> assert false)
<dh`> without sums at all, you might as well use pascal
<discocaml> <gooby_diatonic> Ig use tagged unions manually, checking the tags and such
Haudegen has joined #ocaml
<qu1j0t3> something that Pascal _does_ have
bartholin has joined #ocaml
za3k has quit [Quit: ZNC 1.8.2+deb3.1 - https://znc.in]
za3k has joined #ocaml
za3k has quit [Quit: ZNC 1.8.2+deb3.1 - https://znc.in]
za3k has joined #ocaml
Anarchos has joined #ocaml
euphores has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
avidseeker has joined #ocaml
<avidseeker> I'm trying to install ocaml-lsp-server and I get a compilation error in topkg
<avidseeker> the probem seems to be in Exception: Fl_package_base.No_such_package ("findlib", "").
Humean has joined #ocaml
ced2 has joined #ocaml
Anarchos has joined #ocaml
dhil has quit [Ping timeout: 244 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
berberman has quit [Quit: ZNC 1.8.2 - https://znc.in]
berberman has joined #ocaml
Tuplanolla has joined #ocaml
Serpent7776 has quit [Ping timeout: 260 seconds]
berberman has quit [Read error: Connection reset by peer]
berberman has joined #ocaml
bartholin has quit [Quit: Leaving]
ygrek has quit [Remote host closed the connection]
dh` has quit [Read error: Connection reset by peer]
dh` has joined #ocaml
<discocaml> <diligentclerk> I'm not familiar with Miranda. From the context it seems like you're saying that Miranda's type system/type inference is much less convenient than Haskell's?
<discocaml> <diligentclerk> Oh, I looked up Miranda and I see it appears not to have algebraic data types, interesting.
<discocaml> <Kali> miranda is haskell's predecessor and is essentially just haskell with less advanced type features
<discocaml> <Kali> contificate is saying that if haskell didn't exist then nobody would go to miranda because there's nothing particularly interesting about it when you have sml, ocaml, etc.
<discocaml> <Kali> it does, where are you seeing this
<discocaml> <diligentclerk> Never mind, I misread the Wikipedia page. I noticed this sentence saying:
<discocaml> <diligentclerk> > Miranda's basic data types are char, num and bool. A character string is simply a list of char, while num is silently converted between two underlying forms: arbitrary-precision integers (a.k.a. bignums) by default, and regular floating point values as required.
<discocaml> <diligentclerk>
<discocaml> <diligentclerk> and I just assumed that the language was primarily based on lists of these.
Der_Teufel has joined #ocaml
DerTeufel has quit [Ping timeout: 276 seconds]