adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.1 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
AnAverageHuman has joined #ocaml
<orbifx> thanks companion_cube , I like it, fast lookups too, which is the key operation I imagine
<orbifx> ah wait I was thinking of using a Map of (parent set, children set)
<orbifx> key being the node, and value being (parent * childen) sets
AnAverageHuman has quit [Ping timeout: 256 seconds]
<orbifx> gotta go, thanks for the chat companion_cube
orbifx has quit [Quit: WeeChat 2.3]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<cemerick> Is there a documented compiler API, or is that what the command line programs are for?
<companion_cube> there's compiler-libs
<companion_cube> "documented" might be a bit controversial though — some parts are well documented, some others are opaque to anyone but core maintainers
keep_learning has joined #ocaml
<cemerick> Ok, will check it out
<companion_cube> it's pretty exhaustive :)
jao has quit [Remote host closed the connection]
jao has joined #ocaml
kalio has joined #ocaml
<cemerick> Not much in the way of docs huh
<companion_cube> some files are well documented (parsetree.mli I think)
olle has quit [Ping timeout: 255 seconds]
olle has joined #ocaml
kvda has joined #ocaml
silver has quit [Read error: Connection reset by peer]
demonimin has quit [Ping timeout: 245 seconds]
demonimin has joined #ocaml
demonimin has joined #ocaml
mfp has quit [Ping timeout: 268 seconds]
<Drup> cemerick: what do you want to do with it ?
wham has joined #ocaml
<cemerick> Drup: a lisper without eval will eventually make one 😋
rwmjones has joined #ocaml
rwmjones|HOLS has quit [Ping timeout: 264 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
aplainzetakind has joined #ocaml
aplainzetakind has left #ocaml [#ocaml]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ziyourenxiang_ has quit [Ping timeout: 250 seconds]
kvda has joined #ocaml
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 250 seconds]
h116 is now known as h11
AnAverageHuman has joined #ocaml
sagax has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gravicappa has joined #ocaml
kvda has joined #ocaml
powerbit has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
marvin3 has quit [Ping timeout: 240 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
Jeanne-Kamikaze has joined #ocaml
Jeanne-Kamikaze has quit [Quit: Leaving]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AnAverageHuman has quit [Ping timeout: 256 seconds]
kvda has joined #ocaml
kvda has quit [Client Quit]
jao has quit [Ping timeout: 250 seconds]
olle has quit [Ping timeout: 255 seconds]
olle has joined #ocaml
ggole has joined #ocaml
JimmyRcom has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ocaml
<andreypopp> @cemerick: what purpose? Have you see meta ocaml?
freyr69 has joined #ocaml
olle has quit [Ping timeout: 255 seconds]
sagotch has joined #ocaml
ziyourenxiang_ has joined #ocaml
demonimin has quit [Quit: bye]
demonimin has joined #ocaml
freyr69 has quit [Ping timeout: 244 seconds]
freyr69 has joined #ocaml
marvin2 has joined #ocaml
jao has joined #ocaml
Serpent7776 has joined #ocaml
Birdface has joined #ocaml
silenc3r has joined #ocaml
mfp has joined #ocaml
sagotch has quit [Quit: Leaving.]
dhil has joined #ocaml
Simn has joined #ocaml
sagotch has joined #ocaml
silver has joined #ocaml
Haudegen has quit [Remote host closed the connection]
ollehar has joined #ocaml
ollehar_ has joined #ocaml
sagotch has quit [Quit: Leaving.]
freyr69 has quit [Quit: ERC (IRC client for Emacs 26.1)]
freyr69 has joined #ocaml
<freyr69> Are unboxed float arrays indeed faster than the boxed
<freyr69> ones? Does it mean that each Floatarray.get leads to an
<freyr69> allocation and associated checks, while Array.get just
<freyr69> returns a pointer?
<def`> In vanilla ocamls, float arrays are never boxed.
<freyr69> What do you mean? What's the point of floatarray then?
<def`> Two possibilities: if the type of elements is statically known to be float, Array.get is specialized and just load the float in a floating point register. Allocation will happen if the value escapes the local scope
<def`> Otherwise, Array.get will check the tag of the array and branch between a non-allocating (normal) path and an allocating one for float values.
<def`> freyr69: we want to get rid of unboxed float arrays because it introduces a lot of arbitrary limitations and the benefits are not obvious
<octachron> And there is already a configuration option in the compiler for disabling the automatic unboxing of float array.
Simn has quit [Quit: Leaving]
<freyr69> def`: is ocaml compiler good at unboxing floats in general?
<freyr69> for example I have an allocation in code:
<freyr69> let square (type a) (module N:Num with type a) x = N.mul x x
<freyr69> when module N is Float
<freyr69> even if Float is defined in the same file
<freyr69> is it possible to avoid it? Is it flambda's job (at the moment it doesn't optimize it it seems)?
<ggole> x and the result both escape, so unboxing isn't really an option there
<ggole> If the function is inlined, which is likely given it is so small, perhaps unboxing can be done.
<freyr69> Yes, but square can be inlined?
<ggole> With the usual reservations: yes
<freyr69> Though it isn't even with -O3 -unbox-closures
sagax has quit [Quit: Konversation terminated!]
<ggole> Hmm, lemme try it
sagax has joined #ocaml
<freyr69> Here is the code
<ggole> Hmm, it does just call apply
<ggole> Looks like square is inlined, but its argument is not
<ggole> And since its argument is called unknown, unboxing won't happen.
<def`> :/ flambda should do that, at some point.
<ggole> I haven't really looked into what flambda does and doesn't do in detail
<freyr69> I hope so, allocating on simple multiplication is a bit unfortunate
<ggole> The multiplication isn't the problem.
<ggole> eg, something like let test a = a.(0) <- a.(1) *. a.(1) won't allocate.
<ggole> The problem is that the compiler doesn't know that the N.mul is Float.mul, so it assumes the worst.
opt9_ has quit [Quit: leaving]
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
Guest22618 has joined #ocaml
bartholin has joined #ocaml
<Leonidas> is there a sensible way to have a library with a public_name without all the libraries it depends on requiring to have a public_name too?
<Leonidas> I don't want to pollute the findlib list with all internal stuff from my library
asymptotically has joined #ocaml
Guest22618 has quit [Remote host closed the connection]
Haudegen has joined #ocaml
sagotch has joined #ocaml
<freyr69> I'm pretty sure it was in dune's roadmap
dhil has quit [Ping timeout: 245 seconds]
dhil has joined #ocaml
silenc3r has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 245 seconds]
spew has joined #ocaml
cemerick has quit []
cemerick has joined #ocaml
q9929t has joined #ocaml
q9929t has quit [Quit: q9929t]
FreeBirdLjj has joined #ocaml
freyr69 has quit [Remote host closed the connection]
<cemerick> andreypopp: the things one uses eval for, e.g. executing arbitrary code provided at runtime, maaaybe sandboxed
<andreypopp> ah, ok
<cemerick> I've got what could be considered a little internal DSL. Not sure yet whether people will write against it directly, or if I'll create a separate language and interpet the results of that
<cemerick> I hadn't seen MetaOCaml, but it doesn't seem relevant in this case
<Drup> cemerick: it's not very idiomatic to implement external languages as eval'd code in OCaml :)
<Drup> (I know, it's a big thing in Lisp)
<Drup> ("external" as in "not an embedded DSL")
<cemerick> sure, if I do introduce a separate language, then it'll get parsed and interpreted in the usual way
<Drup> Well, in that case, you don't need eval, you just use combinators
<cemerick> correct
<Drup> (So you never need eval, case closed :D)
<cemerick> but that's a lot more work than just taking snippets of OCaml and compiling and running the results as necessary
ygrek has joined #ocaml
<Drup> it is, but that's only a good idea in very specific cases
<Drup> (and in those cases, you can compile the thing and dynlink against it. No need to fiddle with compilerlibs)
<cemerick> Drup: see, I always manage to get new useful search terms, thank you. I was unaware of https://caml.inria.fr/pub/docs/manual-ocaml/libref/Dynlink.html
<cemerick> I had already ignored compiler-lib, just exec'ing ocamlopt is easy enough
<cemerick> but dynlink looks a lot easier than exec'ing the compiled program :-P
<Drup> well, it doesn't do the same thing
AnAverageHuman has joined #ocaml
<cemerick> yeah, I see I'll need to set up some global function tables or something, that's fine.
AnAverageHuman has quit [Ping timeout: 256 seconds]
sagotch has quit [Quit: Leaving.]
johnelse_ has quit [Quit: leaving]
ollehar has quit [Ping timeout: 246 seconds]
ollehar_ has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
johnelse has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
JimmyRcom has joined #ocaml
KeyJoo has joined #ocaml
Haudegen has quit [Read error: Connection reset by peer]
ziyourenxiang_ has quit [Ping timeout: 250 seconds]
tane has joined #ocaml
sim642 has joined #ocaml
q9929t has joined #ocaml
gareppa has joined #ocaml
<sim642> local dot opens aren't a thing for functors, right? e.g. Foo.(Bar1 (Bar2)) instead of Foo.Bar1 (Foo.Bar2)
dhil has quit [Ping timeout: 245 seconds]
gareppa has quit [Remote host closed the connection]
<Drup> huh, no they aren't
ggole has quit [Quit: Leaving]
q9929t has quit [Quit: q9929t]
FreeBirdLjj has joined #ocaml
dhil has joined #ocaml
unyu has joined #ocaml
Jesin has quit [Quit: Leaving]
Haudegen has joined #ocaml
Jesin has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
olle has joined #ocaml
jnavila has joined #ocaml
gravicappa has quit [Ping timeout: 250 seconds]
jnavila has quit [Ping timeout: 246 seconds]
kakadu_ has joined #ocaml
dhil has quit [Ping timeout: 246 seconds]
KeyJoo has quit [Ping timeout: 245 seconds]
dhil has joined #ocaml
jnavila has joined #ocaml
dhil has quit [Ping timeout: 246 seconds]
Haudegen has quit [Remote host closed the connection]
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]
kvda has joined #ocaml
troydm has joined #ocaml
Serpent7776 has quit [Quit: leaving]
<cemerick> Is there anything like haskell's OverloadedStrings? Always having to tag simple values with the requisite newtype-esque constructors can be irritating.
Ulrar has quit [Remote host closed the connection]
Ulrar has joined #ocaml
Haudegen has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<companion_cube> you mean for tagging various types that are actually string?
sagotch has joined #ocaml
<cemerick> companion_cube: yes; if you're not familiar, OverloadedStrings allows you to use a string literal and have it automatically converted into whatever type is expected there (presuming you provide the necessary instance for that type)
<companion_cube> ugh, this must rely on some typeclass, so no luck in OCaml
<companion_cube> I'd say the idiomatic way (more verbose) would be to have `type t = private string` in a module, with an easy constructor
<companion_cube> this gives you subtyping (but not overloading
<companion_cube> )
sagotch has quit [Client Quit]
jnavila has quit [Remote host closed the connection]
spew has quit [Quit: going home]
asymptotically has quit [Quit: Leaving]
AnAverageHuman has joined #ocaml
troydm1 has joined #ocaml
troydm has quit [Ping timeout: 244 seconds]
tane has quit [Quit: Leaving]
gareppa has joined #ocaml
kvda has joined #ocaml
gareppa has quit [Remote host closed the connection]
Haudegen has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 246 seconds]
kakadu_ has quit [Remote host closed the connection]
Jesin has quit [Quit: Leaving]
ziyourenxiang_ has joined #ocaml
AnAverageHuman has quit [Ping timeout: 256 seconds]
Jesin has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]