companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
Haudegen has joined #ocaml
vicfred has quit [Quit: Leaving]
<d_bot> <jaiyalas> In https://caml.inria.fr/pub/docs/manual-ocaml/libref/Lazy.html, the 2nd *Note* of `type 'a t` suggests to use `Lazy.t` instead of `lazy_t`. I wonder why use `lazy_t` here (and few other modules like CCLazy_list)
olle_ has quit [Ping timeout: 240 seconds]
<d_bot> <Cyclomatic Complexity> Yeah, indexing is actual work
<d_bot> <Cyclomatic Complexity> Especially that a lot of the questions that are asked there are better indexed as improved documentation rather than a SO-like Q&A
<d_bot> <Cyclomatic Complexity>
<d_bot> <Cyclomatic Complexity> Possibly, rather than indexing the questions themselves, indexing the pain points?
<d_bot> <Cyclomatic Complexity> Like, instead of indexing "Is there an efficient functional queue in OCaml?", listing the problem of very bad results popping up (toy solutions) when one writes "functional queue OCaml"
<d_bot> <Cyclomatic Complexity>
<d_bot> <Cyclomatic Complexity> So that if one wants to later tackle relevant issues, they could find a ready list
<d_bot> <Cyclomatic Complexity>
<d_bot> <Cyclomatic Complexity> Just thinking out loud here
vicfred has joined #ocaml
<d_bot> <Cyclomatic Complexity> Thanks, I've never seen it before
<companion_cube> I have some logs, but how do we know what to index?
reynir has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Leaving]
Tuplanolla has quit [Quit: Leaving.]
olle has quit [Ping timeout: 260 seconds]
olle has joined #ocaml
osa1_ has joined #ocaml
osa1 has quit [Ping timeout: 265 seconds]
mfp has quit [Ping timeout: 246 seconds]
<d_bot> <darrenldl> something something machine learning
<companion_cube> Maximizing engagement
mxns has joined #ocaml
<d_bot> <darrenldl> customer obsession
<companion_cube> Laser focus *
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
<d_bot> <darrenldl> "it's easy, we'll just index by blockchain"
Haudegen has quit [Ping timeout: 272 seconds]
madroach_ has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
madroach has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
vicfred has quit [Quit: Leaving]
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 265 seconds]
Jeanne-Kamikaze has quit [Remote host closed the connection]
mbuf has joined #ocaml
andreas303 has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
andreas303 has joined #ocaml
mbuf has quit [Ping timeout: 240 seconds]
inkbottle has quit [Remote host closed the connection]
inkbottle has joined #ocaml
vicfred has joined #ocaml
sleepydog has joined #ocaml
osa1_ is now known as osa1
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
dborisog has joined #ocaml
<d_bot> <EduardoRFS> yeah blockchain and machine learning
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
nicoo has quit [Remote host closed the connection]
<d_bot> <EduardoRFS> no serious, probably just a bot where you can say
<d_bot> <EduardoRFS> ```ocaml
<d_bot> <EduardoRFS> !some_command from:User question:"How to print a string?" answer:"print_endline or Printf.printf if you need something fancy"
<d_bot> <EduardoRFS> ```
nicoo has joined #ocaml
mbuf has joined #ocaml
narimiran has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
dborisog has quit [Ping timeout: 246 seconds]
mbuf has quit [Ping timeout: 260 seconds]
jbrown has quit [Ping timeout: 258 seconds]
Serpent7776 has joined #ocaml
jbrown has joined #ocaml
dborisog has joined #ocaml
bartholin has joined #ocaml
rdivyanshu has joined #ocaml
cantstanya has quit [Remote host closed the connection]
cantstanya has joined #ocaml
mbuf has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
Tuplanolla has joined #ocaml
reynir has joined #ocaml
olle_ has joined #ocaml
mbuf has quit [Quit: Leaving]
mfp has joined #ocaml
Anarchos has joined #ocaml
rdivyanshu has quit [Quit: Connection closed for inactivity]
olle_ has quit [Ping timeout: 246 seconds]
tane has joined #ocaml
<dborisog> Can you name a good OCaml library that heavily utilizes polymorphic sets of Set library? (maybe)Ideally, with clean use of monads for code structuring?
<Anarchos> dborisog it reminds me i found objects in ocaml very exciting though never saw a use case
<dborisog> Anarchos: I think I might have an extremely potent use case, but I need to test it by implementing a prototype library.
<Anarchos> ok
_whitelogger has joined #ocaml
olle has quit [Ping timeout: 240 seconds]
olle has joined #ocaml
Haudegen has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
olearn has joined #ocaml
olearn has quit [Remote host closed the connection]
waleee-cl has joined #ocaml
dborisog has quit [Ping timeout: 256 seconds]
neiluj has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Changing host]
inkbottle has quit [Remote host closed the connection]
zebrag has joined #ocaml
olle_ has joined #ocaml
Anarchos has joined #ocaml
steenuil_ has joined #ocaml
steenuil_ has quit [Client Quit]
steenuil has quit [Ping timeout: 264 seconds]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
steenuil has joined #ocaml
<qwr> apart from OO the objects can be used as records with row polymorphism, similarly to polymorphic variants
<qwr> the object member access is slower, but probably somewhere it could be useful
Yagotzirck has joined #ocaml
dborisog has joined #ocaml
narimiran has quit [Remote host closed the connection]
narimiran has joined #ocaml
mro has joined #ocaml
FreeBirdLjj has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
zebrag has quit [Remote host closed the connection]
zebrag has joined #ocaml
zebrag has quit [Client Quit]
zebrag has joined #ocaml
zebrag has quit [Remote host closed the connection]
zebrag has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
olle_ has quit [Ping timeout: 246 seconds]
brown121407 has quit [Quit: ZNC 1.8.2 - https://znc.in]
brown121407 has joined #ocaml
brown121407 has quit [Changing host]
brown121407 has joined #ocaml
zebrag has joined #ocaml
flux26 has joined #ocaml
<flux26> is there a way to see what's inside an object type in ocaml
<flux26> eg if i do `type shape = < area : float >;;`
<flux26> is there something i can do in utop to see what a shape type is
<reynir> `#show_type shape`?
<flux26> i didn't know about that, thanks!
<flux26> so if i do `let a = object method area = 5. end;;`, it seems like a doesn't automatically get declared as a shape object?
jnavila has joined #ocaml
Yagotzirck has quit [Ping timeout: 258 seconds]
<flux26> is there a difference between if i do this vs if i do `let a:shape = object .. `
Yagotzirck has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<Armael> it's just a matter of printing I think, as object types are structural
<Armael> i.e. in practice you can use your first a in any place where a shape is expected
Jeanne-Kamikaze has joined #ocaml
mro has quit [Quit: Leaving...]
<Armael> (it's like when you do ```type shape = [ `Area of float ] ;; let a = `Area 5 ```)
aquijoule_ has joined #ocaml
<qwr> you can create and use the object instance in separately compiled modules without declaring anything as long as the used members exist - the same as you can match `Foo with `Foo created somewhere else without declarations, the types are inferred and unified as needed
<qwr> as Armeal said, its structural typing (with row polymorphism) and objects are mirror image to polymorphic variants
mro has joined #ocaml
richbridger has quit [Ping timeout: 260 seconds]
mro has quit [Client Quit]
dborisog has quit [Ping timeout: 272 seconds]
<flux26> in that case, what's the purpose of subtyping?
<flux26> i'm going through RWO's objects chapter and am pretty confused why we need all these new constructs
zebrag has quit [Quit: Konversation terminated!]
<flux26> should i think of subtyping as inheritance
zebrag has joined #ocaml
zebrag has quit [Remote host closed the connection]
zebrag has joined #ocaml
<qwr> afaik subtyping, as far as ocaml has it, is for inheritance
<qwr> the classes are kind of built on top of the object types
zebrag has quit [Remote host closed the connection]
<qwr> as you can use the object types without classes and inheritance, but if you have class, then it has object type also
zebrag has joined #ocaml
dborisog has joined #ocaml
zebrag has quit [Remote host closed the connection]
neiluj has quit [Ping timeout: 260 seconds]
hnOsmium0001 has joined #ocaml
zebrag has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
zebrag has quit [Remote host closed the connection]
Serpent7776 has quit [Quit: leaving]
flux26 has quit [Remote host closed the connection]
Yagotzirck has quit [Quit: Leaving]
mxns has joined #ocaml
Jeanne-Kamikaze has quit [Remote host closed the connection]
tane has quit [Quit: Leaving]
jnavila has quit [Quit: Konversation terminated!]
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
zebrag has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
dborisog has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
mxns has quit [Client Quit]
mxns has joined #ocaml
narimiran has quit [Ping timeout: 256 seconds]
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
narimiran has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
mxns has quit [Client Quit]
mxns has joined #ocaml
mro has joined #ocaml
zebrag has joined #ocaml
zebrag has quit [Client Quit]
oriba has joined #ocaml
zebrag has joined #ocaml
Anarchos has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
mxns has quit [Client Quit]
mxns has joined #ocaml
mro has quit [Quit: Leaving...]
mro has joined #ocaml
mro has quit [Client Quit]
mro has joined #ocaml
<olle> does ocaml do escape analysis to allocate on stack when possible?
<sadiq> no
mro has quit [Client Quit]
<sadiq> but there are optimisations it will do to sometimes avoid allocating at all
mro_name has joined #ocaml
mro_name has quit [Client Quit]
mro0 has joined #ocaml
mro0 has quit [Client Quit]
<Anarchos> i wonder where to find tutorials on the ocaml internals , the big picture.
mro_name has joined #ocaml
<sadiq> Anarchos, what would you like to know?
mro_name has quit [Client Quit]
narimiran has quit [Ping timeout: 246 seconds]
<Anarchos> sadiq how did leroy found all the optimisations in ocamlopt, and how the cmx 'work'
<sadiq> cmx is still a bit of a mystery to me
<sadiq> (not because it's necessarily complex, just that I haven't actually neeed to look at it)
<sadiq> most of my experience is with the lower levels of the compiler
<sadiq> and the code there is surprisingly readable once you get comfortable with ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
<olle> sadiq: ok, thanks. you know why not?
mro_name has joined #ocaml
<Anarchos> sadiq or how the intermediate languages are working together
<sadiq> basically the lower part goes cmm -> mach (which is one IR but goes through several stages) -> linear and then that gets emitted
<Anarchos> what is IR ?
<sadiq> intermediate representation
<sadiq> olle, it's tricky to do and imho it's not really something that fits in with the standard optimisaton passes. It's very much the kind of thing Flambda 2 would probably be able to do though.
<olle> sadiq: alright
<sadiq> certainly in Java land, it can be the source of surprising performance changes.
<olle> what about a language construct like "local" to enforce "no escape" on certain variables?
<olle> would that make sense?
<Anarchos> sadiq i knew that part of code, but could'nt figure what 'pressure on registers' was, neither how leroy calculated those values
<sadiq> olle: change some small methods and suddenly they don't get inlined and something that didn't escape now could and your GC behaviour changes all over the place
mro_name has quit [Quit: Leaving...]
mro_name has joined #ocaml
<olle> why would stack allocation change inlining? oO
<sadiq> olle, it's the other way around - inlining can change stack allocation.
<olle> oh
<olle> hm
mro_name has quit [Client Quit]
<qwr> olle: no stack allocation is probably because of simplicity and the GC minor allocation is considered fast enough
mro_name has joined #ocaml
<sadiq> because if you don't inline something and use an intra procedural pass then you have to assume it escpaes on the method call
<sadiq> also what qwr said
<sadiq> the minor gc's bump allocation is very fast
mxns has quit [Ping timeout: 260 seconds]
<olle> well, bump is not the problem :) collection is
mro_name has quit [Client Quit]
<sadiq> olle, not really with ocaml's generational gc
<sadiq> Anarchos, https://en.wikipedia.org/wiki/Instruction_set_architecture#REGISTER-PRESSURE has a better description than I could write
<sadiq> olle, for the minor collector you pay a cost proportional to your live set in the minor heap
<olle> hm
<sadiq> more garbage means more collections but the actual cost of the collection is only what is live (-ish, it's a bit more complex with the remembered set)
<olle> so you only win space, not time? if you get rid of the boxing for stack allocation
mxns has joined #ocaml
<olle> still, in tight loops?
<sadiq> there are benefits, for sure
<sadiq> putting stuff on the stack means you're probably reusing the same cache space over and over
<sadiq> also not boxing stuff means less indirection
<olle> mm
zebrag has quit [Remote host closed the connection]
<olle> someone worked on RAII in OCaml, right? it also goes back to the uniqueness construct in Clean I blabbered about before.
<sadiq> I did actually put a few hours in to exploring doing scalar value replacement
<olle> and linearity?
<sadiq> I just don't have the time to explore it further at the moment
<olle> right
<Anarchos> i wonder if linear logic could be mixed with lambda-calculus to get accurate use of values and better GC ?
<olle> If you know something has to be consumed, it can't escape.
<olle> I think...
mxns has quit [Ping timeout: 272 seconds]
<olle> And if it can't escape, you can stack allocate it.
<olle> So, no GC needed. :)
<Anarchos> olle so it could lead to languages without gc ?
<olle> Anarchos: no, you can't program with only stack alloc
<olle> because you don't know everything at compile time
<olle> size of lists, and such
zebrag has joined #ocaml
<olle> if you have a known upper bound you can do memory pooling with stack memory
mro_name has joined #ocaml
<Anarchos> olle i mean i was astonished to discover linear logic
<olle> hey, someone did a phd on stack allocation in ocaml
<olle> by "Bruno"
mro_name has quit [Client Quit]
<olle> Anarchos: why?
mxns has joined #ocaml
<Anarchos> olle it sounds so logic and so computer science at same time !!
zebrag has quit [Remote host closed the connection]
mro_name has joined #ocaml
<olle> :)
<olle> well, don't forget the curry-howard isomorphism ;)
mxns has quit [Ping timeout: 260 seconds]
zebrag has joined #ocaml
mxns has joined #ocaml
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<Anarchos> olle i just coulnd't get the curry howard interpretation of linear logic...
mxns has quit [Ping timeout: 264 seconds]
mro_name has quit [Ping timeout: 256 seconds]
olle_ has joined #ocaml
olle has quit [Ping timeout: 246 seconds]
olle has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
flux68 has joined #ocaml
<flux68> i have a file test.ml inside src using "square", and a file square.ml in the current directory, how should I set up dune to be compatible with this structure?
<flux68> so my file structure is something like: square.ml src/test.ml
bartholin has quit [Quit: Leaving]
Jeanne-Kamikaze has joined #ocaml