<discocaml>
<eerbium> Can someone list some differences between Scala and OCaml?
reynir has quit [Ping timeout: 246 seconds]
<discocaml>
<bluddy5> Scala is fully object oriented at every level. Functional programming sits on top of OOP.
reynir has joined #ocaml
berberman has joined #ocaml
<discocaml>
<quantumcat.> Which take in this do you mean?
<discocaml>
<quantumcat.>
<discocaml>
<quantumcat.> Seems like some good points going around. Having a community name can make people feel a sense of identity connected to the technology. I can see that being either welcoming or not welcoming, beneficial or otherwise.
<discocaml>
<quantumcat.>
<discocaml>
<quantumcat.> Tbh I think it's more dependent on the people in the community than any other one factor. If you have a good experience with people who are interested in OCaml (like I have), then you'll feel welcomed. If not, you'll probably feel more hesitation to take their recommendations.
<discocaml>
<quantumcat.>
<discocaml>
<quantumcat.> Overall though I think one of the main benefits of a small programmer population for a given technology, is that there can be a sense of community, unlike say the JS or python ecosystem.
<discocaml>
<quantumcat.>
<discocaml>
<quantumcat.> Community doesn't mean "us vs them", it's more like "us and them".
reynir has quit [Ping timeout: 246 seconds]
reynir has joined #ocaml
bartholin has quit [Quit: Leaving]
Everything has joined #ocaml
berberman_ has joined #ocaml
berberman has quit [Ping timeout: 246 seconds]
<discocaml>
<davesnx> I'm against trivalism and fighting over personal preferences
<discocaml>
<davesnx> so, if you want to call yourself Camello, excelent
azimut has joined #ocaml
<discocaml>
<davesnx> if you say all ocaml developers are Camellos 🟥
<discocaml>
<vphantom> I don't care for names but it is nice indeed that a smaller community means more accessibility to the core developers. It would be unthinkable for say Java, but here we have Xavier Leroy and most of the core team hanging around the Discuss forums and/or here, with an eye on Stack Overflow, etc. The feedback loop between the core team and the developers is much tighter.
<discocaml>
<vphantom> I don't care for names but it is nice indeed that a smaller community means more accessibility to the core developers. It would be unthinkable for say Java, but here we have Xavier Leroy and most of the core team hanging around the Discuss forums and/or here, with an eye on Stack Overflow, etc. The feedback loop between the core team and us developers is much tighter.
<discocaml>
<vphantom> I don't care for names but it is nice indeed that a smaller community means more accessibility to the core developers. It would be unthinkable for say Java, but here we have Xavier Leroy and most of the core team hanging around the Discuss forums and/or here, with an eye on Stack Overflow, etc. The feedback loop between the core team and us developers is much tighter than I've seen anywhere else.
<discocaml>
<quantumcat.> Tbh I'm brand new here and to OCaml, so I'm here to learn 😄 I'll take your points with the benefit of the doubt.
John_Ivan has joined #ocaml
kaptch has joined #ocaml
kaptch has quit [Client Quit]
reynir has quit [Ping timeout: 258 seconds]
<steenuil>
I'll propose "kamelåså"
<steenuil>
...hoping somebody gets the reference ;)
<discocaml>
<Kali> OCaml users could collectively be the "OCaravan" :)
<discocaml>
<masterbuilder> steenuil: I did 😄 I love that video
<tom1212>
if I've got a module for the integers Z and an other one for the complex numbers C, how could I cast (or promote) a Z.t to a C.t? with objects you can have subtyping and have Z inherit from C and you can pass a Z.t when a C.t is expected
<tom1212>
sorry C inherit from Z
<tom1212>
functions that do the numeric coercions are an option to consider
<discocaml>
<Kali> `module C = struct include Z ... let of_int z = ...`
<discocaml>
<Kali> oops, and an `end` at the end
<discocaml>
<Kali> or perhaps `of_z`
<discocaml>
<Kali> depends on how you want to name it, if it's distinct from the builtin int type
<discocaml>
<Kali> so, yes, write a conversion function
<tom1212>
thanks! my code looks like module P = module C = struct ... end val fft : (module Cyclic_sig with type t = C.t) -> t -> t but I'd like to relax the constraint so that Cyclic_sig.t "is a" C.t (for instance Cyclic_sig.t=Integer.t and C.t=Complex.t)
<tom1212>
I guess I need a functor that maps a (module Cyclic_sig with type t = Integer.t) to a (module Cyclic_sig with type t = Complex.t) using the conversion function
gareppa has quit [Quit: WeeChat 3.8]
waleee has joined #ocaml
<tom1212>
is it possible to have a self-referencing module type? for instance module type A_sig :type t sig val lift : (module A_sig with and type t = 'p) -> t -> 'p end (approximative syntax)?
bartholin has quit [Quit: Leaving]
<tom1212>
if no, is there a trick do achieve this?
<dh`>
does anyone know if one can rely on the optimizer to shortcut things like List.fold_left (fun z x -> match x with None -> None | Some x' -> ...) z very_large_list?
<dh`>
er, that's all wrong but presumably you get the idea
<dh`>
or is it better to write the recursion out if traversing the list once you hit None is going to waste measurable amounts of time?
<dh`>
corrected: List.fold_left (fun optz x -> match optz with None -> None | Some z -> ...) (Some z) very_large_list
<dh`>
i have some lists that are not all that long but they're being eval'd 85 million times
<discocaml>
<sim642> If you want to end the fold early, just raise an exception
<dh`>
ew
<dh`>
:-p
<dh`>
stopping explicitly (not with an exception) does seem to have an observable effect, though not a large one
<dh`>
hmm, maybe not really
<dh`>
however, this code is tidier with a terminating fold so I'll keep it
xd1le has quit [Quit: xd1le]
<dh`>
more vexingly, I have a nonrecursive function eval_foo where I've both wrapped the (single) call site with time collection and the contents with time collection, and the total elapsed time for the contents is about a third of the total elapsed time at the call site
<dh`>
time collection has many pitfalls but it should not do this
<dh`>
(doing it with Unix.gettimeofday (), difference, and sum, which is imperfect but still should not exhibit such behavior)
<dh`>
should probably use a real profiler, except it's bust on macos
<dh`>
hmm, part of the contents is taking longer than all of the contents