companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Anarchos has quit [Quit: Vision[]: i've been blurred!]
<discocaml> <Ada> every time i do anything in this language it makes me feel so smart
mima has quit [Ping timeout: 246 seconds]
<discocaml> <Kali> haha, yes, it does feel like that sometimes
<discocaml> <Kali> jusensei2: Eio is quite new, so be wary that it might change in future versions; however, it is much faster and generally easier to use
<discocaml> <Kali> Lwt is more stable and production-ready, if you care about that
<discocaml> <darrenldl> eio would be the way to go i reckon
<discocaml> <darrenldl> since you are not doing much computational work on client side either, you dont even need to touch domainslib task pool even
<discocaml> <Ada> eio seems cool, i’m learning ocaml and it’s a huge factor towards me maybe moving production code to ocaml
<discocaml> <Ada> writing a recursive function that doesn’t stack overflow and feeling like i’ve just solved quantum mechanics
John_Ivan has quit [Ping timeout: 244 seconds]
hsw has quit [Quit: Leaving]
chrisz has quit [Ping timeout: 246 seconds]
chrisz has joined #ocaml
<discocaml> <alanquits> Possibly dumb question, but I’m curious. I’m not really into Microsoft tools because they feel bloated, but F# makes a lot of things way easier than OCaml (i.e., .net libraries, etc). Aside from feeling a bit more unixy, why do others prefer OCaml over F#?
<companion_cube> reasonable memory consumption, compiles to native code by default, simple execution model, not the ugly duckling in a large corporate controlled ecosystem like .net
<discocaml> <elliottcable> how do structural/referential equality function on first-class modules?
waleee has quit [Ping timeout: 260 seconds]
<companion_cube> probably badly because they're records of functions
<companion_cube> can't compare functions
<discocaml> <jumpnbrownweasel> there happens to be a current discussion thread on this question:
<discocaml> <Ada> i personally like that ocaml just compiles to fast binaries without buying into any ecosystem, but dotnet core is good enough that’s just a preference really
spip has quit [Quit: Konversation terminated!]
bgs has joined #ocaml
Putonlalla has quit [Ping timeout: 240 seconds]
Putonlalla has joined #ocaml
bgs has quit [Remote host closed the connection]
azimut_ has quit [Ping timeout: 240 seconds]
xd1le has joined #ocaml
richardhuxton has quit [Ping timeout: 260 seconds]
_alix has quit [Ping timeout: 260 seconds]
seeg has quit [Ping timeout: 260 seconds]
jakzale has quit [Ping timeout: 260 seconds]
Ankhers has quit [Ping timeout: 260 seconds]
sleepydog has quit [Ping timeout: 260 seconds]
toastal has quit [Ping timeout: 260 seconds]
pluviaq has quit [Ping timeout: 260 seconds]
philipwhite has quit [Ping timeout: 260 seconds]
patrick has quit [Ping timeout: 260 seconds]
seeg has joined #ocaml
whereiseveryone has quit [Ping timeout: 260 seconds]
b0o has quit [Ping timeout: 260 seconds]
henrytill has quit [Ping timeout: 260 seconds]
ymherklotz has quit [Ping timeout: 260 seconds]
immutable has quit [Ping timeout: 260 seconds]
ggb has quit [Ping timeout: 260 seconds]
Ankhers has joined #ocaml
pluviaq has joined #ocaml
jakzale has joined #ocaml
sleepydog has joined #ocaml
patrick has joined #ocaml
toastal has joined #ocaml
philipwhite has joined #ocaml
henrytill has joined #ocaml
Serpent7776 has joined #ocaml
richardhuxton has joined #ocaml
ggb has joined #ocaml
whereiseveryone has joined #ocaml
ymherklotz has joined #ocaml
b0o has joined #ocaml
immutable has joined #ocaml
_alix has joined #ocaml
bartholin has joined #ocaml
MarvelousWololo has quit [Read error: Connection reset by peer]
Absalom has joined #ocaml
mima has joined #ocaml
<discocaml> <froyo> OCaml also feels a lot more coherent as a language
<discocaml> <froyo> we don't have many of those "this feature is X but surprise it's not actually X it's an object that behaves like X!"
<discocaml> <froyo> with an asterisk and fineprint gotchas
<discocaml> <froyo> my favorite example is polymorphic refs
<discocaml> <froyo> with each instantiation creating a new instance so you're not actually mutating the same ref lmao
<discocaml> <froyo> wonderful language
<discocaml> <froyo> not an object/class keyword anywhere in sight with that one
<discocaml> <froyo> you just have to know or find out
Janni has joined #ocaml
Guest70 has joined #ocaml
Guest70 has quit [Client Quit]
Janni has quit [Quit: leaving]
<discocaml> <Ada> in general i don’t see much of a reason you would use f# if you’re not already using c#
Anarchos has joined #ocaml
spip has joined #ocaml
mbuf has joined #ocaml
cedb has quit [Quit: WeeChat 4.0.2]
perrierjouet has quit [Ping timeout: 250 seconds]
Anarchos has quit [Ping timeout: 245 seconds]
mima has quit [Ping timeout: 245 seconds]
<discocaml> <alanquits> I would agree with that. The bits of f# designed to interop with other .net languages features feel ugly and tacked on. I mean, they were probably done about as well as they could have been given the requirements and I certainly couldn’t do better
kaptch has joined #ocaml
kaptch has quit [Client Quit]
<discocaml> <alanquits> I guess the reasons would be that it’s more batteries included, there’s probably better documentation, etc. To give a concrete example, I was writing some code to process some time series data and had to look around for a nice o amp date time li early and then it was difficult to figure out which to use. With F#, System.DateTime is just there, albeit with an interface that is not functional
<discocaml> <alanquits> I guess the reasons would be that it’s more batteries included, there’s probably better documentation, etc. To give a concrete example, I was writing some code to process some time series data and had to look around for a nice ocaml date time library and then it was difficult to figure out which to use. With F#, System.DateTime is just there, albeit with an interface that is not functional
<discocaml> <Ada> for me thats less of a strict advantage and more of a philosophical difference
<discocaml> <Ada> like the difference between a full fat ruby-on-rails style web framework and a http router that parses json if you ask it nicely
perrierjouet has joined #ocaml
<discocaml> <gantsev.denis> Having a dozen of"standard libraries" doesn't speak in favor of "coherence" though 🙃
dstein64 has quit [Excess Flood]
dstein64 has joined #ocaml
dinosaure has quit [Quit: WeeChat 3.0]
dinosaure has joined #ocaml
<discocaml> <omasanori> If I could, I'd ask *language designers* of OCaml “if you start designing it today, how it will differ from what it is?”
<discocaml> <omasanori> It would be very interesting...
<discocaml> <octachron> - Explicit row variables
<discocaml> <octachron> - No unification type variables by default in the surface language
<discocaml> <octachron> - unclear if abstract module types are worth the complexity
<discocaml> <octachron> (note that this is a list of changes that could be done today or yesterday if there were no backward compatibility requirements)
<discocaml> <._null._> Who uses abstract module types?
<discocaml> <octachron> Nobody knows if they are real users of abstract module types.
<discocaml> <._null._> Did you mean "if there are". Otherwise that's a bit ominous
<discocaml> <._null._> Did you mean "if there are"? Otherwise that's a bit ominous
<discocaml> <octachron> Nobody knows if there are real users of abstract module types.
<discocaml> <octachron> Yep, hm, there is at least https://github.com/janestreet/base/blob/master/src/applicative_intf.ml .
<discocaml> <octachron> Otherwise, https://sherlocode.com/?q=module%20type%20%5C%5BA-z%5C%5D%5C%2B%5C%24 is mostly tests
<discocaml> <lecondorduplateau> let's do away with them to rot the janestreet banking institution
hannes has joined #ocaml
mima has joined #ocaml
<discocaml> <._null._> @JaneStreet do you really need that?
<discocaml> <._null._> How about "different keywords" for let and let?
<discocaml> <._null._> How about "different keywords for let and let" ?
<discocaml> <alanquits> Truth. I think that is why I prefer OCaml to F#. My problem is more that I have kind of an odd job where I get to use whatever language I like and most things I wrote are small tools that I need to distribute to others sometimes, so I occasionally have used F# because I haven’t had the time to gather all of the Ocaml libraries I need and figure out the Windows distribution properly
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]
troydm has joined #ocaml
troydm has quit [Client Quit]
troydm has joined #ocaml
<discocaml> <sim642> GitHub code search finds a bit more of abstract module types: https://github.com/search?type=code&q=language%3Aocaml+%2Fmodule+type+%5BA-z%5D%2B%24%2F
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]
troydm has joined #ocaml
azimut has joined #ocaml
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]
troydm has joined #ocaml
<discocaml> <Kali> abstract module types?
<discocaml> <deepspacejohn> `module type M` (with no `= sig end`)
<discocaml> <deepspacejohn> analogous to an abstract `type t`.
<discocaml> <deepspacejohn> There was a question on the discuss forum recently where using one was present as a solution. Personally, every use case I've seen (including that one) seemed like more trouble compared to other possible solutions.
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]
troydm has joined #ocaml
emacs_pprentice_ has joined #ocaml
wingsorc__ has quit [Ping timeout: 246 seconds]
<discocaml> <octachron> And at same time, they make the module type system complex enough to make module subtyping undecidable. Consequently, their expressivity/complexity ratio feels pretty low (at least to me).
Anarchos has joined #ocaml
wingsorc__ has joined #ocaml
emacs_pprentice_ has quit [Ping timeout: 260 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
John_Ivan has joined #ocaml
wingsorc__ has quit [Remote host closed the connection]
wingsorc__ has joined #ocaml
mbuf has quit [Quit: Leaving]
emacs_pprentice_ has joined #ocaml
bgs has joined #ocaml
wingsorc__ has quit [Read error: Connection reset by peer]
wingsorc__ has joined #ocaml
emacs_pprentice_ has quit [Ping timeout: 260 seconds]
<discocaml> <Kali> oh, i see
nfc_ has quit [Quit: WeeChat 3.4.1]
gareppa has joined #ocaml
emacs_pprentice_ has joined #ocaml
wingsorc__ has quit [Read error: Connection reset by peer]
wingsorc__ has joined #ocaml
emacs_pprentice_ has quit [Ping timeout: 260 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
tom1212 has joined #ocaml
<tom1212> hi! got a function f: 'a -> 'a t, a value v : _#myclass t = f (fun (o:myobj) -> do stuff with o#foo only ...), but I'd like to "coerce" this value v to type _#myotherclass t which has the same method foo
<tom1212> is it possible?
<tom1212> basically I'd like to avoid defining the value v for _#myotherclass as this would duplicate the logic
<tom1212> maybe define v with a type _#myclassfoo that only has foo as method? and then somehow coerce its type to be _#myclass t or _#myotherclass t?
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
<octachron> Classes don't exist in the type system.
<octachron> Without more details, you don't have to do anything.
<octachron> let `f x = x#foo` works for any objects that has a method `foo`.
<discocaml> <froyo> > in general i don’t see much of a reason you would use f# if you’re not already using c#
<discocaml> <froyo> Ada: it's the opposite idea for me; I see no reason to use C# when a more expressive language that can do all C# does exists. But I know F# doesn't do all that C# does. I know C# is an ecosystem fav (e.g. GUI application templates in VS, Unity stuff, ...)
tom1212 has quit [Remote host closed the connection]
<discocaml> <froyo> gantsev.denis, VPhantom: stdlib fragmentation is not a _language_ problem.
<discocaml> <froyo> alanquits: F# does make more sense on windows, as it stands...
<discocaml> <froyo> even if bundling the whole .NET runtime feels icky for utility-style programs
<discocaml> <froyo> or well I guess even that doesn't matter for windows since it's already there globally
<discocaml> <froyo> I'm curios how the startup times are
<discocaml> <vphantom> It's not a language _design_ problem but it very much is an OCaml problem since it is a factor in choosing it vs F# and other options.
<discocaml> <vphantom> Personally I learned to enjoy that diversity, and even landed on just the Stdlib (despite some really frustrating limitations like `Buffer.t` being unreadable) because the language is so expressive that it's not intimidating to "roll your own" whatever module you need if none are just right for you.
<companion_cube> it's a language problem because the language makes it too easy :P
Tuplanolla has joined #ocaml
qwr has quit [Ping timeout: 245 seconds]
qwr has joined #ocaml
emacs_pprentice_ has joined #ocaml
wingsorc__ has quit [Ping timeout: 246 seconds]
tom1212 has joined #ocaml
<discocaml> <vphantom> Granted if the stdlib were a kitchen sink it would be less tempting.
mima has quit [Ping timeout: 246 seconds]
emacs_pprentice_ has quit [Quit: Leaving]
tomwinston has joined #ocaml
gareppa has quit [Quit: WeeChat 3.8]
<tom1212> octachron: thanks! I forgot to mention that the signature of the value v is defined in an interface file
tomwinston has quit [Quit: Client closed]
bear2137 has joined #ocaml
bear2137 has quit [Quit: Client closed]
mima has joined #ocaml
<octachron> tom1212, that doesn't change anything (except that you may have added more constraint yourself)? Do you have a link to your code?
<tom1212> the code is very big, but here is the part of the contents of the ml, mli, and the error:https://bpa.st/GGXQ
<tom1212> I don't know why the type given by merlin replaces .. by _.. which doesn't seem to be valid ocaml syntax?
<octachron> The error is telling you that you don't have a value of type 'a. #c as 'a but a weakly polymorphic value of type #c as '_weak1
Anarchos has joined #ocaml
<tom1212> does this require a locally abstract type? to get rid of the weakly polymorphic value?
<octachron> You can't get rid of the weakly polymorphism, that would be unsound.
<octachron> `Tezos_clic.parameter ...` is a computation, it cannot have a polymorphic value (except for strictly covariant type parameters but that's visibly not the case here)
<tom1212> so it's not possible to make ocaml accept this construction?
<tom1212> thanks for the explanation
<tom1212> it works if I remove the "extension" ..
<octachron> This construction is unsound as written (aka accepting it would mean accepting segfaults too).
<tom1212> ah :)
<octachron> Indeed, if you remove the row type variable hidden in `...`, there is no more type variables or polymorphic values in sight.
<tom1212> it does break some chains of computation (when you compose an 'a t and an 'b t)
<tom1212> which is to be expected
waleee has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
bgs has quit [Remote host closed the connection]
Everything has quit [Ping timeout: 250 seconds]
bear2137 has joined #ocaml
qwr has quit [Ping timeout: 260 seconds]
qwr has joined #ocaml
bartholin has quit [Ping timeout: 258 seconds]
bartholin has joined #ocaml
ced1 has joined #ocaml
ced1 is now known as cedb
tom1212 has quit [Remote host closed the connection]
bear2137 has quit [Quit: Client closed]
Serpent7776 has quit [Ping timeout: 240 seconds]
neuroevolutus has joined #ocaml
qwr has quit [Ping timeout: 250 seconds]
<greenbagels> octachron | Classes don't exist in the type system.
<greenbagels> could you expand on that (as someone who doesn't know the internals of ocaml that well)
<greenbagels> are they converted to other, more fundamental ocaml constructs before type checking?
bartholin has quit [Quit: Leaving]
<greenbagels> (on a semi-related note, i feel like my ocaml knowledge gaining has stalled a bit; ive gotten to the point where i can comfortably write recursive functions / compose functions and accomplish tasks, but things like designing modules, better understanding the runtime behavior of programs, etc elude me)
<greenbagels> maybe i should try more ambitious projects
neuroevolutus has quit [Quit: Client closed]
<discocaml> <alanquits> The startup times for F# are awful. I would never use it for a utility-style program I had to use often. Most of my use-cases for utility-style programs are those that I run occasionally to pre- or post-process numerical models
<discocaml> <froyo> I want to review some PRs and reduce the load on maintainers a bit, I'm not sure if there's a tag for PRs which are low-impact and so easily reviewed by people not intimately familiar with the compiler?
mima has quit [Ping timeout: 260 seconds]