<discocaml>
<xavierm02_> "However, in order for Eio to be widely accepted in the OCaml community, we no longer use of objects and instead use a pair of a value and a function for looking up interfaces."
<discocaml>
<xavierm02_> Does someone know the details of why?
<Anarchos>
what is the relation between OCaml and System F ?
Tuplanolla has joined #ocaml
<discocaml>
<xavierm02_> Anarchos: OCaml has some of the polymorphism of System F. And there's a paper "F-ing modules" on the relation between ML modules and System Fomega
<Anarchos>
i was struck of the similarities when discovering system F .
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
<discocaml>
<reynir1396> @xavierm02_ I don't think there's much more to it than certain people not liking OCaml objects tbh
Serpent7776 has joined #ocaml
<Anarchos>
i like objects but could never find a use case !
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
<discocaml>
<dinosaure> First of all, you need to be aware that the OCaml team doesn't necessarily concentrate all its efforts on the object part of OCaml - mainly because there aren't many of them and time has to be well managed. OCaml's objects, while interesting, are also quite far away from what can be found in the Java or C++ world (and for good reason): this inevitably implies a re-learning when you come from these worlds. Finally, few people in the community
<adrien>
dinosaure: your message was cut after "community"
<adrien>
historically at least, you'd avoir objects when wanting your code to be widely adopted, but you could also make a higher-level API using objects
<adrien>
it's difficult to make a good non-object API based on an object one while you can make a good object one based on a non-object API
<adrien>
(partly due to these weird type errors you can get with objects)
<discocaml>
<gooby_clown> The Eio switch from objects was, as far as I'm aware, a (selfish) push by Jane Street despite the fact they were arguably more straightforward as a solution than what is in use currently
<discocaml>
<dinosaure> arf, discord :/ on my web client I have my full message
Serpent7776 has quit [Ping timeout: 252 seconds]
Serpent7776 has joined #ocaml
<discocaml>
<ada2k> the funny thing, a lot of eio is now fairly simple redirects to method calls
<discocaml>
<ada2k> which i can understand and have done because first class functions are useful, but i don’t think the motivation was to make it slightly easier to use iterators in specific situations
<discocaml>
<ada2k> afaik the motivation was just to hide the object system, even when it’s being used in one of the few entirely ideal use cases for OOP, and much of the push was from JST due to just a silly culture around not using objects
<discocaml>
<ada2k> i think jane street also avoids objects because they don’t play well with many of their compiler forks and optimisation projects. but, as much as i’d like faster objects, specialisation is more important for io calls than fast dispatch
<discocaml>
<ada2k> i’ll continue to lightly rip off Eio’s original object design in my own code 😄
<companion_cube>
I also use objects for io streams tbh
f[x] has joined #ocaml
cr1901 has joined #ocaml
cr1901_ has quit [Read error: Connection reset by peer]
<discocaml>
<gooby_clown> OCaml has an O for a reason, those who dogmatically avoid OOP should write Caml instead
<discocaml>
<otini_> I am in favor of dropping the O 😂 (and keeping objects, I’m fine with them. Caml is just a nicer name)
<discocaml>
<gooby_clown> You might have a point there
f[x] has quit [Remote host closed the connection]
lane has joined #ocaml
jmcantrell_ has joined #ocaml
JSharp_ has joined #ocaml
raskol has joined #ocaml
pi3ce has quit [Ping timeout: 252 seconds]
pippijn_ has joined #ocaml
Fardale1 has joined #ocaml
pi3ce has joined #ocaml
jmcantrell has quit [Ping timeout: 265 seconds]
lane_ has quit [Ping timeout: 265 seconds]
JSharp has quit [Ping timeout: 265 seconds]
bartholin has quit [Ping timeout: 265 seconds]
pippijn has quit [Ping timeout: 265 seconds]
Fardale has quit [Ping timeout: 265 seconds]
deavmi has quit [Ping timeout: 265 seconds]
jmcantrell_ is now known as jmcantrell
JSharp_ is now known as JSharp
pi3ce has quit [Client Quit]
pi3ce has joined #ocaml
bartholin has joined #ocaml
raskol has quit [Ping timeout: 245 seconds]
deavmi has joined #ocaml
<discocaml>
<deepspacejohn> maybe it could just be Irish, O'Caml.
f[x] has joined #ocaml
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
raskol has joined #ocaml
<reynir>
O no
f[x] has quit [Remote host closed the connection]
<discocaml>
<qrpnxz> @otini_ but then people may come to believe OCaml is subjective 😔
<discocaml>
<emiletrotignon> The irony being that they are not really interested in eio anyways.
<Anarchos>
emiletrotignon what is eio ?
<discocaml>
<contificate> Yeah, and if objects are dropped entirely, the language would be lighter, so "Caml Light", and then any new special feature could make it "Caml Special Light" and so on
<discocaml>
<emiletrotignon> its an async library for ocaml that uses effects. Others are lwt or async (from janestreet). Lwt and async are pre-effects library so they have a monadic interface.
<dh`>
...why would you use a monadic interface for something inherently nonmonadic
<discocaml>
<contificate> well, monadic style is a generalisation of CPS, and so it's quite suitable for these kinds of things - if you naturally induce functional sequence points in your program, as in the case with an async/concurrency monad, the `k` you are forced to talk about can be rescheduled by some other event loop
* Anarchos
never could grasp what monadic is
<discocaml>
<contificate> there are all kinds of poor explanations of monads and monadic style online
<discocaml>
<contificate> but my general advice is to get somewhat familiar with basic programming in continuation passing style, and then you can derive many monads by factoring out certain casing logic
<discocaml>
<contificate> like what is monadic bind for option types except some logic to case on dispatch of `k`, dependent on whether you have something or not
<discocaml>
<contificate> the relation to CPS is obvious to most, but you can see it in the types, compare the type of `let f x k = k x;;` with `Option.bind;;`
<discocaml>
<contificate> effects let you reify (delimited) continuations at runtime, in the form of referring to some fiber within the new segmented stack runtime, and so scalable concurrency across domains can use effects and not use monadic style
<dh`>
...are you seriously arguing that asynchronous, non-sequential operations are naturally sequential?
<discocaml>
<contificate> have you read what I've said or not
<discocaml>
<contificate> if you actively write a style of code that enforces functional sequentialisation, via continuations (as in CPS and monadic style)
<discocaml>
<contificate> then what you can do when you'd otherwise block is not block, but package up `k` in your event loop, wait for the result to become avaialble as you switch and do something else, and then reinvoke `k` with the asynchronously computed value
<discocaml>
<contificate> this is kind of how it works in most languages, actually - except managed runtimes tend to have ways to do this kind of packaging up of the execution context and continuation implicitly
<discocaml>
<contificate> since we didn't have that kind of thing in OCaml, prior to version 5, people would use monads to achieve it in a fairly convenient manner
<discocaml>
<emiletrotignon> i think the thing is that want to write them in a sequential way most of the time, and have the asynchronicity be done for you automatically.
raskol has quit [Ping timeout: 265 seconds]
<discocaml>
<emiletrotignon> I think they provide extra functions, but you get very nice syntax with the monadic ones.
<discocaml>
<gooby_clown> A whole program optimising compiler for the said language can be appropriately called Camlton
raskol has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
raskol has quit [Ping timeout: 265 seconds]
TCZ has joined #ocaml
TCZ has quit []
masterbuilder has joined #ocaml
bartholin has quit [Quit: Leaving]
Anarchos has quit [Quit: Vision[]: i've been blurred!]