companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.05.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.05/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
zv has quit [Ping timeout: 252 seconds]
sam_ has joined #ocaml
zv has joined #ocaml
eh_eff has quit [Ping timeout: 240 seconds]
sam_ has quit [Ping timeout: 240 seconds]
Algebr has quit [Ping timeout: 240 seconds]
AceJohnny has joined #ocaml
enterprisey has quit [Read error: Connection reset by peer]
mengu has quit [Remote host closed the connection]
enterprisey has joined #ocaml
taki has joined #ocaml
mengu has joined #ocaml
mfp__ has quit [Ping timeout: 246 seconds]
taki has quit [Quit: Leaving]
ristos has quit [Quit: Connection closed for inactivity]
sam_ has joined #ocaml
sam_ has quit [Ping timeout: 260 seconds]
zv has quit [Ping timeout: 246 seconds]
zv has joined #ocaml
pierpa has quit [Quit: Page closed]
philtor has joined #ocaml
Algebr has joined #ocaml
Algebr is now known as Guest1562
sam_ has joined #ocaml
jimmyrcom_ has joined #ocaml
sam_ has quit [Ping timeout: 240 seconds]
zv has quit [Ping timeout: 252 seconds]
Guest1562 has quit [Ping timeout: 248 seconds]
zv has joined #ocaml
mbuf has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
MercurialAlchemi has joined #ocaml
leah2 has joined #ocaml
Algebr` has joined #ocaml
peterppp has joined #ocaml
sam_ has joined #ocaml
sam_ has quit [Ping timeout: 240 seconds]
zlsyx has joined #ocaml
<zlsyx> How to define abstract class of type 'a in ocaml?
<zlsyx> Like parametrized abstract class. Something like class ['a] virtual rpc object end;; doesn't work
jimmyrcom_ has quit [Ping timeout: 248 seconds]
TarVanimelde has joined #ocaml
TobiasBales has joined #ocaml
zlsyx has quit [Quit: Leaving...]
Simn has joined #ocaml
<companion_cube> class virtual ['a] foo = object method virtual x : 'a list end;;
Mercuria1Alchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
mengu has quit [Remote host closed the connection]
peterppp has quit [Remote host closed the connection]
TarVanimelde has quit [Quit: TarVanimelde]
TarVanimelde has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 255 seconds]
samrat_ has joined #ocaml
cbot has quit [Quit: Leaving]
TheLemonMan has joined #ocaml
Algebr` has quit [Ping timeout: 248 seconds]
nahra` has quit [Remote host closed the connection]
TarVanimelde has quit [Quit: TarVanimelde]
sam_ has joined #ocaml
igstan has joined #ocaml
igstan has quit [Client Quit]
Soni has quit [Ping timeout: 260 seconds]
sam_ has quit [Ping timeout: 248 seconds]
Soni has joined #ocaml
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 246 seconds]
pigeonv has joined #ocaml
enterprisey has quit [Read error: Connection reset by peer]
samrat_ has quit [Ping timeout: 240 seconds]
samrat_ has joined #ocaml
dakk_ has quit [Ping timeout: 240 seconds]
hstuart has joined #ocaml
sepp2k has joined #ocaml
mengu has joined #ocaml
argent_smith has joined #ocaml
sz0 has joined #ocaml
BitPuffin|osx has joined #ocaml
sam_ has joined #ocaml
ygrek has joined #ocaml
bbc has quit [Quit: ZNC - http://znc.in]
sam_ has quit [Ping timeout: 248 seconds]
bbc has joined #ocaml
mfp__ has joined #ocaml
<ShalokShalom> when ;; is just for the toplevel, why use JaneStreet code it?
<ShalokShalom> Do they programm in REPL and copy that one then into files? o.O
ristos has joined #ocaml
<companion_cube> ewwww
<zozozo> +1 @ewww
<ShalokShalom> ?
<companion_cube> it's a matter of style, I just find it ugly, is all :)
<ShalokShalom> is it possbile to write without?
<ShalokShalom> why do they add it?
<companion_cube> it's possible. no idea.
<ShalokShalom> the rest of it looks nice
<companion_cube> they also use non-standard indentation, it seems
<ShalokShalom> i am just worried of so many different opinions about it
<ShalokShalom> like?
<companion_cube> no indentation after `match`
<ShalokShalom> ah i see
pigeonv has quit [Ping timeout: 248 seconds]
ziyourenxiang has joined #ocaml
andreas__ has quit [Quit: Connection closed for inactivity]
stux|RC-only has quit [Ping timeout: 248 seconds]
stux|RC-only has joined #ocaml
ShalokShalom_ has joined #ocaml
ShalokShalom has quit [Ping timeout: 260 seconds]
<rwmjones> sgnb: are you still having problems with ocaml 4.05 + aarch64? I think this is the patch we're going to go with: https://github.com/ocaml/ocaml/pull/1268#issuecomment-327438814
<rgrinberg> ShalokShalom_: there's a point to ;; in the source sometimes. I find that if i have a syntax error and the compiler is spewing some bogus locs
<rgrinberg> ;;'s make it show better error locationos
TheLemon1an has joined #ocaml
TheLemonMan has quit [Ping timeout: 255 seconds]
kakadu has joined #ocaml
wklm has quit [Remote host closed the connection]
<aantron> Lwt's mythical new manual is slightly more real as of today https://github.com/ocsigen/lwt/pull/469
<flux> all hail the new terminology :)
<flux> (I think it might have even been the biggest bug of Lwt, so I really appreciate this change.)
sam_ has joined #ocaml
al-damiri has joined #ocaml
sam_ has quit [Ping timeout: 248 seconds]
pigeonv has joined #ocaml
KeyJoo has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
<ShalokShalom_> rgrinberg: thanks
ShalokShalom_ is now known as ShalokShalom
<hannes> rwmjones: IIUC your patch introduces lots of new symbols? is this measurable in the binary size?
<companion_cube> rgrinberg: I'm happy with jbuilder, but it's not very flexible so far (e.g. for compiler-specific options)
two_wheels has joined #ocaml
TheLemon1an has quit [Read error: Connection reset by peer]
TheLemonMan has joined #ocaml
<rwmjones> hannes: they're just hidden aliases so I wouldn't expect them to have any effect (except on debuginfo)
<rwmjones> otoh I didn't look because I'm more interested in whether it works or not
<hannes> rwmjones: working is for sure a good argument :) -- but I'd be interested (since in the issue there were several potential solutions outlined AFAIR)
<rwmjones> hannes: none of the other solutions work
TheLemonMan has quit [Ping timeout: 246 seconds]
<hannes> rwmjones: oh, ok.
samrat_ has quit [Ping timeout: 246 seconds]
ygrek has quit [Ping timeout: 248 seconds]
_andre has joined #ocaml
<aantron> flux: indeed. it's still the old terminology in most of the the rest of the manual at this point, though :/
copy_ has joined #ocaml
Orion3k has quit [Ping timeout: 255 seconds]
Orion3k has joined #ocaml
sam_ has joined #ocaml
wklm has joined #ocaml
AltGr has joined #ocaml
sam_ has quit [Ping timeout: 260 seconds]
mbuf has quit [Quit: Leaving]
sepp2k has quit [Remote host closed the connection]
samrat_ has joined #ocaml
steve_gh has joined #ocaml
dakk_ has joined #ocaml
AltGr has left #ocaml [#ocaml]
sz0 has quit [Quit: Connection closed for inactivity]
sh0t has joined #ocaml
TheLemonMan has joined #ocaml
Denommus has joined #ocaml
AltGr has joined #ocaml
TobiasBales has quit [Ping timeout: 248 seconds]
Mercuria1Alchemi has quit [Ping timeout: 248 seconds]
sam___ has joined #ocaml
sam___ has quit [Ping timeout: 255 seconds]
dakk_ has quit [Ping timeout: 260 seconds]
AltGr has left #ocaml [#ocaml]
TheLemonMan has quit [Ping timeout: 246 seconds]
TheLemonMan has joined #ocaml
argent_smith has quit [Quit: Leaving.]
wklm has quit [Quit: leaving]
tokomak has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has joined #ocaml
Denommus has quit [Ping timeout: 252 seconds]
aciniglio has joined #ocaml
jao has joined #ocaml
dakk_ has joined #ocaml
AltGr has joined #ocaml
KeyJoo has quit [Ping timeout: 240 seconds]
<rgrinberg> companion_cube: i knew you'd come around :P. Yeah, I'm aware that's issue, there's some ideas on how to fix it. Maybe this upcoming jbuilder hackathon will make some progress?
<companion_cube> bah, it's just for one project
<companion_cube> where I also decided to restrict myself to OCaml >= 4.04.0+flambda :p
<rgrinberg> companion_cube: do you believe the speed claims yet?
<companion_cube> meh
<companion_cube> with flambda, it's slow anyway ;)
<companion_cube> (but granted, the startup is faster)
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
MercurialAlchemi has joined #ocaml
superherointj has joined #ocaml
samrat_ has quit [Ping timeout: 248 seconds]
Denommus has joined #ocaml
ygrek has joined #ocaml
pigeonv has quit [Ping timeout: 248 seconds]
flux has quit [Ping timeout: 240 seconds]
flux has joined #ocaml
enterprisey has joined #ocaml
AltGr has left #ocaml [#ocaml]
flx_ has joined #ocaml
flux has quit [Read error: Connection reset by peer]
flx_ is now known as flux
govg has joined #ocaml
andreas__ has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
superherointj has quit [Quit: Leaving]
jlam has quit [Quit: Leaving]
FreeBirdLjj has quit [Ping timeout: 246 seconds]
mengu has quit [Remote host closed the connection]
TheLemonMan has joined #ocaml
samrat has joined #ocaml
philtor has quit [Ping timeout: 248 seconds]
zlsyx has joined #ocaml
FreeBirdLjj has joined #ocaml
<zlsyx> If you have TLB with 32 slots and you iterate over 200 000 longs, how many misses will you get?
<zlsyx> Assume 46-bit virt. address space and 32 bit physical address space.
<mrvn> 200000 * sizeof(long) / sizeof(TBL entry coverage)
<mrvn> So for 4 byte longs = 800000 byte < 1MB page it's one TLB miss for a 2MB page.
<zlsyx> Page size if 8KB so TLB entry covarage will be also 8KB right?
<zlsyx> Page size of 8KB so TLB entry covarage will be also 8KB right?
<mrvn> depends on your cpu
<mrvn> most architectures have 4k pages. are you on sparc?
<zlsyx> No, just exam problem.
<zlsyx> Page size is given and 64 bits are read consecutively.
<zlsyx> Shouldn't it be that we read 8 bytes at a time so we get a miss and then load it in the TLB 8KB so 1024 read longs for 1 miss. So 200 000 / 1024 I'm assuming they are consecutive in memmory which I think they should be?
<mrvn> if the longs are unaligned you might get an extra TLB fault.
<zlsyx> Like ok, you read the first long, since TLB empty you get one 8KB so you are good for 1024.
<mrvn> if they are random access every one may fault.
<zlsyx> And if alligned?
<mrvn> actually, random and unaligned might fault twice per long.
<mrvn> zlsyx: if you read sequentially and aligned then yes, you get one fault on the first read and then the next 1023 longs will hit.
<zlsyx> What I don't understand is why the 32 slots matter at all. Like when you aren't finding it in cache it's a miss so you must overwrite the TLB cache, am I wrong?
jao has quit [Ping timeout: 255 seconds]
<mrvn> the number of slots is totally irelevant for sequential access. Only matters for random access or repeated access.
<mrvn> But that's really not an ocaml problem, is it?
<zlsyx> So if sequential then 200 000 / 1024 misses?
<aantron> Lwt has a bounty now https://github.com/ocsigen/lwt/issues/337
<aantron> i don't know how this play out, hopefully well. if you want to work on it, its extra important to claim it to avoid disappointing others if they work concurrently. im basically going to ignore the bounty, and work with any contributors as normal (hopefully in a helpful way :))
Ragora has quit [Read error: Connection reset by peer]
Ragora has joined #ocaml
superherointj has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 248 seconds]
kakadu has joined #ocaml
nahra has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
zlsyx has quit [Quit: Leaving...]
ayxih has joined #ocaml
sam___ has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ygrek has quit [Remote host closed the connection]
sam___ has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Read error: Connection reset by peer]
TobiasBales has joined #ocaml
FreeBirdLjj has joined #ocaml
enterprisey has quit [Ping timeout: 240 seconds]
TobiasBales has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Algebr` has joined #ocaml
FreeBirdLjj has quit [Read error: No route to host]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
superherointj has quit [Quit: Leaving]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
MercurialAlchemi has quit [Ping timeout: 260 seconds]
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
samrat has quit [Ping timeout: 240 seconds]
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: No route to host]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
jao 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
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
_andre has quit [Quit: leaving]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
enterprisey has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
enterprisey has quit [Ping timeout: 240 seconds]
dh_work has joined #ocaml
<dh_work> I am moving some elements of a compiler pass into a separate file in order to share them with another pass, and the context for this pass requires some callbacks to the parent.
<dh_work> (which require access to the parent context)
<dh_work> just using functions for the callbacks means the child context has to refer to the parent context (implicitly or explicitly)
<dh_work> I don't suppose there's any way to name "the record currently being defined", is there?
<dh_work> I would prefer to avoid having to set the whole thing up as a functor because that's a big nuisance
mengu has joined #ocaml
<mrvn> # type r = { bla : r };;
<mrvn> type r = { bla : r; }
<mrvn> just works out of the mox. no magic required.
<mrvn> s/mox/box/
jlam has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0_ has joined #ocaml
infinity0 is now known as Guest35835
sam___ has joined #ocaml
<dh_work> mrvn: was that for me?
<dh_work> if so, I don't follow
<dh_work> oh wait, maybe I do but it's not the question I was asking
<dh_work> here's a small example:
<dh_work> is there anything that can be used in place of (self ())?
<Armael> let rec x = { foo = ... x ... } ?
<dh_work> does that work?
<dh_work> hmm
sam___ has quit [Ping timeout: 248 seconds]
<dh_work> Error: This kind of expression is not allowed as right-hand side of `let rec'
<dh_work> apparently not.
<Armael> well, it usually is when it makes sense
<Armael> I can do: type t = { foo : t };; let rec x = { foo = x };;
<Armael> (which builds a cyclic data structure)
<dh_work> let rec ctx = {
<dh_work> }
<dh_work> otherstuff = ref (0, 0);
<dh_work> fooctx = mkfoocontext ctx barlookup;
<dh_work> in ctx
<dh_work> doesn't work
<ayxih> If it needs to access x when building x, OCaml won't accept.
<Armael> yea
<ayxih> Because x is still not really defined.
<dh_work> right, that's what I figured
<dh_work> doesn't help to close the context into the callback, either
<dh_work> oh well, I suppose I need to make it a functor
<dh_work> could also probably stratify it but that'll be uglier than functorizing it. :(
<dh_work> (by "stratify", I mean split the part of the upper-level context the lower-level context needs to access into its own type)
<mrvn> you can make it a mutable option and set it after creation
<mrvn> Otherwise you have to specify the record as a literal. You can't call a function in the creation of the record and pass it.
<mrvn> Or make the callbacks in foocontext take a barcontext as argument
<dh_work> they do, just abstractly
<dh_work> ugh I think it needs to be stratified regardless of whether foo ends up as a functor
<dh_work> grr
<mrvn> functors would work on modules. you can pass first class modules around instead of your records
<dh_work> right, except it ends up with the same problem of being circular
<mrvn> but you wouldn't have a value that triggers the restricion
<mrvn> the 't in foocontext would go away
<dh_work> instead you get a circular module reference
copy_ has quit [Quit: Connection closed for inactivity]
<dh_work> the Foo functor gets the parent context type from its arg, but then when you go to define a Bar to be the arg, you end up needing a value whose type is Foo's context type
<mrvn> yes, you can't have that. the module wouldn't exist at that point to call the functor with it.
<mrvn> you can do it with recursive modules. but then they are in the same file again.
<mrvn> as said, simplest solution is to pass the barcontext to the callbacks, not the constructor.
<dh_work> I think the only way is to stratify the type, like this:
<mrvn> or literals: let mkbarcontext () = let rec ctx = { fooctx = { parent = ctx; lookup = baclookup; stuff = 0} otherstuff = ref (0, 0);
<mrvn> }
<dh_work> passing the barcontext to the callbacks doesn't work
<dh_work> unless I go thread it through every damn function in the thing as another argument, and there's more code than I want to do that with
<mrvn> that works too if you can split it like that
<mrvn> yes, passing it to callbacks means you have to pass it along everyway.
<mrvn> everywhere
<dh_work> I can, it just requires an uglifying massedit to all the client code
<dh_work> maybe I should just make it a ref
<mrvn> mutable.
<mrvn> create it with (Obj.magic 0), replace it, then Obj.magic it to a type without mutable and return. Ugly but works.
<mrvn> clean would be a mutable option but then you have to extract the option on every use.
<dh_work> that seems more evil than I want
<dh_work> let me see
<mrvn> why does lookup take a 't instead a 't foocontext?
barcabuona has quit [Ping timeout: 240 seconds]
<mrvn> Obj.magic is totaly evil.
<companion_cube> just don't :D
<dh_work> because it retrieves info from the parent context that the shared code doesn't have
<dh_work> (in the actual code, it's things like looking up types of variables)
<dh_work> making the callbacks themselves refs is reasonably tidy:
<dh_work> no options needed, just dummy versions
<dh_work> there's only one call site for each, so it's not a huge edit job
<dh_work> ok, I think that's what I'll do
<dh_work> thanks
ayxih has quit [Quit: Leaving]
sh0t has quit [Remote host closed the connection]
Sim_n has quit [Quit: Leaving]
<mrvn> dh_work: that's stupid. A ref is a boxed value. A mutable doesn't add the extra indirection and doesn't need !lookup on use either.
sam____ has joined #ocaml
<mrvn> Note: a ref is just a { mutable val : 'a; } internally.
<companion_cube> mutable contents: 'a actually ;)
<companion_cube> val is a keyword
<mrvn> right, val is a bad label. :)
cbot has joined #ocaml
kakadu has quit [Ping timeout: 248 seconds]
<dh_work> mrvn: performance isn't a concern
<dh_work> I'm more concerned with maintainability
<dh_work> and maybe I'm wrong but I don't get the impression mutable is intended for widespread use
mengu has quit [Quit: Leaving...]
enterprisey has joined #ocaml
ziyourenxiang has quit [Ping timeout: 255 seconds]
govg has quit [Ping timeout: 240 seconds]
eh_eff has joined #ocaml
cbot has quit [Ping timeout: 240 seconds]
cbot has joined #ocaml