adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
jao has quit [Ping timeout: 245 seconds]
ncthom91 has joined #ocaml
badkins_ has joined #ocaml
badkins has quit [Ping timeout: 240 seconds]
grouzen has joined #ocaml
k1000 has quit [Remote host closed the connection]
badkins has joined #ocaml
badkins_ has quit [Ping timeout: 246 seconds]
MrScout has quit [Remote host closed the connection]
swgillespie has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
grouzen has quit [Ping timeout: 260 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
tennix has joined #ocaml
sailorswift has joined #ocaml
sailorswift has quit [Client Quit]
mcc has joined #ocaml
sailorswift has joined #ocaml
tokik has quit [Quit: leaving]
tokik has joined #ocaml
jeffmo has quit [Quit: jeffmo]
jeffmo has joined #ocaml
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mcc> Hello i have a very awkward question, it is about existential types
sailorswift has joined #ocaml
<mcc> sailorswift: cool nick btw
<sailorswift> thanks !
tokik has quit [Quit: leaving]
tokik has joined #ocaml
jeffmo has quit [Quit: jeffmo]
<mcc> okay so here is my awkward question... i'm getting helped by jeremy yallop on the ocaml-ctypes list ... http://lists.ocaml.org/pipermail/ctypes/2015-August/000186.html
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mcc> I had a thing i wanted to do... he showed me a way to do it with existential types... i wound up implementing that with the function here, "typeConvert"... https://bitbucket.org/runhello/test-emily-game/src/a4b7101add783c222a644cb628bcb4629e2730ac/src/internalPackage.ml?at=default
<mcc> the compiler treats treats typeConvert as ok.... but... when I try to CALL typeconvert... it prints this... kinda horrifying message: https://pbs.twimg.com/media/CMLBZlBUsAAjFN0.png
badkins has quit []
<mcc> can anyone help me understand this error message, and in general how to proceed?
jeffmo has joined #ocaml
<ygrek> mcc, I cannot help here but please do not screenshot error messages!
<mcc> I'd be happy to gist if anyone who would be able to help if they had one gets in ^_^;
<mcc> I wonder if it possible to make a gist from the command line.
govg has joined #ocaml
<mcc> Here is a gist outlining my ocaml-ctypes / existential types problem and it has my error message as text: https://gist.github.com/anonymous/6390fa6d9cb0de2c5ef3
<mcc> at the moment i honestly don't understand what the error message even means. it says "this expression has type a = b but an expression was expected of type b". I don't know what the "=" means in that context. It also refers to "a#0" several times, I've never seen it do anything like that and I don't know what that name means.
<mcc> Then it says "The type constructor a#0 would escape its scope" and I don't know what THAT means, either.
higgs has joined #ocaml
kalzz has quit [Ping timeout: 246 seconds]
badkins has joined #ocaml
<hnrgrgr> mcc: the error message is very confusing, I believe there is already an issue open in mantis about it. The only meaningful part is 'The type constructor a#0 would escape its scope'.
<hnrgrgr> The notation 'a#0' is for existential types.
<mcc> ok, cool.
<mcc> that raises another question. where are existential types documented?
<hnrgrgr> Probably with the GADT.
<mcc> if i look on google for "ocaml existential types", google actually finds http://caml.inria.fr/pub/docs/manual-ocaml-400/manual021.html#toc85
<mcc> okay. SOme people suggested that existential types and GADTs are in fact slightly different.
<mcc> but is this maybe the case mathematically but not from the perspective of the implementation?
<hnrgrgr> They are. But in OCaml, the most easiest way to introduce existential is GADT..
<hnrgrgr> type t = Ex : 'a -> t
<hnrgrgr> let x : t = Ex 3
<mcc> that's helpful, thanks
<hnrgrgr> let y : t = Ex "str"
<hnrgrgr> let f x = match x with Ex y -> y -> buggy. y as an existential type. You can't give a type to 'f'.
govg has quit [Ping timeout: 264 seconds]
kalzz has joined #ocaml
<mcc> ok. i see. so what kinds of things can i do with this "existential value"? like, could i pass it to "foreign", as mr. yallop recommends?
<mcc> Ctypes.foreign is doing some really odd existential type thing
<hnrgrgr> For sure.
<hnrgrgr> With this particular 'type t = Ex : 'a -> t' proabably nothing.
<mcc> okay. so... two questions that might help me understand
<mcc> in the case of your example... "let z = f y" . should i be able to say that?
<mcc> it seems like that is the kind of statement that is resulting in my "type constructor might escape" message.
shinnya has quit [Ping timeout: 256 seconds]
<hnrgrgr> Indeed you can't say that. But your not even able to typecheck 'f' : because the type of 'y' would "escape its scope".
higgs has quit [Remote host closed the connection]
<mcc> oh, no, … yes, sorry, i just typed. even f fails.
<mcc> i mean, i just tested
<mcc> okay so... if once something goes inside an Ex it can't come out again... how do I actually *use* it?
<hnrgrgr> The existential type might be seen as an abstract type that replace the 'a from the type definition when you pattern match on it.
<hnrgrgr> But this type must stay within the branch
claudiuc has quit [Remote host closed the connection]
<mcc> ok... what is the span of "the branch"? once "the branch" closes, may i ever open it again?
<hnrgrgr> The most simple case is : type t = Ex : ('a -> int) * 'a -> t
<hnrgrgr> let g = Ex ((+), 3)
<hnrgrgr> let h = Ex (int_of_string, "3")
<hnrgrgr> let f x = match x with Ex (g, v) -> g v;;
<hnrgrgr> Here, 'f' has type 't -> int'.
<xaimus> mcc: you can't do anything with a value of type Ex; i find existential types to be most useful when more than one thing is scoped by the same existential
<hnrgrgr> But inside the branch 'g' has type "a#0 -> int" and 'v' has type "a#0"
<xaimus> mcc: you can think of existentials used in that way as a formalized version of the 'c userdata pattern', or maybe the 'c++ type erasure pattern'
<mcc> xaimus: does it actually solve my problem then? mr. yallop seemed to think it did
<xaimus> no, i don't think so
<xaimus> also i think you are my roommate
<xaimus> hello!
<mcc> xaimus: but userdata, if i know a priori what the type is, i can get it out again
<xaimus> (i'm imran)
<mcc> xaimus: pffft uhh yes, i am your roommate. hello!
<mcc> i think the thing i want to do might be outright impossible.
<xaimus> mcc: the caller can get the 'underlying' type out of the userdata again because they have access to the original value (and because they have a priori knowledge of what type they've stuffed inside the void *); the callee can't do anything like that--all the callee can do is pass that void * to other function pointers in the same struct
<xaimus> well; you can do anything you want in c, but the this is a simplification that i used to build my own intuition
<xaimus> i don't think you can exactly do the thing you want to do, which is dynamically create well-typed bindings with static types determined entirely by dynamic information
<mcc> i want to use this ocaml-ctypes function which takes as a parameter this deeply odd thing based around existential types. it will then return a function of type a->b, and i know a priori what a and b are because they were encoded in the "deeply odd" thing
ncthom91 has joined #ocaml
<mcc> i want to then somehow feed a->b into something that will convert it into a thing of type value->value, where i as the person who constructed a->b know how to turn a into value and b into value
<mcc> but intuitively, it… the analogy i've been using in my head is C++ templates
<mcc> and with those, the a and b involved have to be known at compile time, and i'm
<xaimus> yes, that's an accurate analogy here
<mcc> *imagining* that the way the ocaml compiler can do all these things, and the reason ocaml-ctypes "foreign" can work, is because a and b are both known at compile time in its intended use case
<mcc> so i wonder what mr. yallop was thinking. maybe i did not clearly understand what i was trying to do
<mcc> xaimus: anyway thank you for the help!
<mcc> hnrgrgr: do you think there is a way out of this trap, or do you think xaimus basically has it?
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkf has joined #ocaml
KDr2 has joined #ocaml
<hnrgrgr> It is a bit late here for me to make a clear idea. But, by reading your mail and the answer, it seems I understand your problem the same way than Jeremy Yallop did. And something alongst his suggestion might work.
NingaLeaf123 has joined #ocaml
<hnrgrgr> mcc: ^^
<mcc> hnrgrgr: hm, ok
<hnrgrgr> I will keep your gist bookmarked and give it a try on a later day.
<hnrgrgr> (might)
<mcc> hnrgrgr: okay. thank you :)
<mcc> i am trying to just figure out how to proceed here-- mr. yallop is being very helpful. so i am trying to push through until i have exhausted his explanation, and have a new clearly-formed answer
<mcc> i mean a new clearly-formed question, to ask him
<mcc> maybe i will try to explore his Fn : thing, which after y'all's explanations i understand better
<mcc> thanks!
NingaLeaf has quit [Ping timeout: 246 seconds]
badkins has quit []
c74d has quit [Remote host closed the connection]
c74d has joined #ocaml
samrat has joined #ocaml
ncthom91 has joined #ocaml
tmtwd has joined #ocaml
tmtwd has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 250 seconds]
<xaimus> mcc: oh! i missed the dynamic language interpreter part
<xaimus> here's a silly draft:
<xaimus> i wonder what mr. yallop had in mind
MrScout has joined #ocaml
samrat has quit [Ping timeout: 272 seconds]
<mcc> xaimus: ok, that's useful, thanks. let me study this for a moment
MrScout has quit [Ping timeout: 244 seconds]
samrat has joined #ocaml
MercurialAlchemi has joined #ocaml
tmtwd has joined #ocaml
psy_ has quit [Remote host closed the connection]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
igoroliveira has quit [Quit: Connection closed for inactivity]
tmtwd has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 245 seconds]
samrat has quit [Ping timeout: 252 seconds]
AlexRussia has joined #ocaml
MrScout has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<xaimus> mcc: let rec hoo f args = match args with | h :: [] -> f (ptr time_t) h
<xaimus> | h :: t -> hoo (fun descr arg -> f (ptr time_t) h) t
<xaimus> | [] -> failwith "oh no!"
<xaimus> let do_hoo args = hoo (fun descr arg -> foreign "time" (descr @-> returning time_t) arg) args
<xaimus> ack! copy buffer
<xaimus> OK back to lurking forever
mcc has quit [Quit: This computer has gone to sleep]
ggole has joined #ocaml
scythe- has quit [Ping timeout: 272 seconds]
scythe- has joined #ocaml
ncthom91 has joined #ocaml
ncthom91 has quit [Client Quit]
Sorella has quit [Quit: Connection closed for inactivity]
MrScout has quit [Ping timeout: 246 seconds]
ncthom91 has joined #ocaml
psy_ has quit [Remote host closed the connection]
BhavyaM has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ely-se has joined #ocaml
NingaLeaf123 has quit [Read error: Connection reset by peer]
Haudegen has quit [Ping timeout: 265 seconds]
Lis has quit [Read error: Connection reset by peer]
thomasga1 has joined #ocaml
Haudegen has joined #ocaml
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mcorbin has joined #ocaml
Simn has joined #ocaml
xificurC has joined #ocaml
xificurC has quit [Remote host closed the connection]
antkong has quit [Quit: antkong]
matason has joined #ocaml
grouzen has joined #ocaml
<jyc> what does it mean when ocamlbuild outputs .a files? It seems like they are needed in addition to the cma and cmxa files for my package to work through findlib, although the documentation just notes that they are C library object files.
<jyc> Is a C library being generated from my module?
<companion_cube> I think they are used for libraries that use some C
<jyc> Oh, that would make sense. So I guess something in the module is using something that uses C in that way
<jyc> thanks companion_cube
mort___ has joined #ocaml
mort___1 has joined #ocaml
mort___1 has left #ocaml [#ocaml]
mort___ has quit [Ping timeout: 246 seconds]
AltGr has joined #ocaml
AltGr has left #ocaml [#ocaml]
AlexRussia has quit [Ping timeout: 256 seconds]
ggole has quit [Ping timeout: 246 seconds]
c74d has quit [Remote host closed the connection]
thomasga1 has quit [Quit: Leaving.]
maurer has quit [Ping timeout: 265 seconds]
kakadu has joined #ocaml
thomasga has joined #ocaml
c74d has joined #ocaml
zpe has joined #ocaml
AlexRussia has joined #ocaml
<companion_cube> grr, I have a link error in the compiler, and I don't see why
maurer has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 264 seconds]
dsheets has quit [Ping timeout: 246 seconds]
kushal has joined #ocaml
sepp2k has joined #ocaml
thomasga has quit [Quit: Leaving.]
native_killer has joined #ocaml
<gasche> companion_cube: it probably comes from what you are trying to do?
antkong_ has joined #ocaml
<companion_cube> indeed, I'm trying to rebase Pierre's branch that is about dynlink; the problem is I don't understand why it has troubles finding Assert_failure since the stdlib is in the path
ggole has joined #ocaml
KDr2 has quit [Remote host closed the connection]
dsheets has joined #ocaml
dsheets has quit [Client Quit]
dsheets has joined #ocaml
<gasche> Assert_failure is not declared in the standard library I think, it's in the initial typing environment
<companion_cube> sounds even more mysterious then :S
<gasche> well typing and linking are different
<gasche> predefined exceptions seem to be handled differently in native and bytecode
<gasche> in any case
<gasche> you should ask Pierre to rebase the patch :]
<gasche> (is it the first-class-module dynlink? pretty cool work)
<companion_cube> I will ask him if he knows what the issue is :)
<companion_cube> if you have ideas about how to compute CRCs of any kind of (sub-)module...
<jyc> gasche: your link doesn't actually explain what .a and .lib files are
<def`> :D
octachron has joined #ocaml
<jyc> Just reread the first link and it is explained, I just didn't catch it the first time through due to the phrasing. Thanks for the help
ollehar has joined #ocaml
native_killer has quit [Quit: Leaving]
nightuser has joined #ocaml
lewis1711 has joined #ocaml
BhavyaM has quit [Quit: Quit the channel]
ollehar has quit [Ping timeout: 252 seconds]
_andre has joined #ocaml
gustav_ has quit [Ping timeout: 246 seconds]
tennix has quit [Ping timeout: 264 seconds]
kushal has quit [Quit: Leaving]
gustav_ has joined #ocaml
grouzen has quit [Ping timeout: 245 seconds]
mcorbin has quit [Ping timeout: 246 seconds]
QuanticPotato has joined #ocaml
tashjash has joined #ocaml
lobo has joined #ocaml
gustav_ has quit [Ping timeout: 264 seconds]
ollehar has joined #ocaml
martinium has quit [Read error: Connection reset by peer]
nightuser has quit [Ping timeout: 250 seconds]
ousado has quit [Ping timeout: 246 seconds]
antkong_ has quit [Quit: antkong_]
obadz has quit [Ping timeout: 265 seconds]
ollehar has quit [Ping timeout: 256 seconds]
obadz has joined #ocaml
ousado has joined #ocaml
nightuser has joined #ocaml
nightuser has quit [Ping timeout: 250 seconds]
tennix has joined #ocaml
thomasga has joined #ocaml
ousado has quit [Changing host]
ousado has joined #ocaml
izaak has joined #ocaml
ceryo has joined #ocaml
grouzen has joined #ocaml
badkins has joined #ocaml
tennix has quit [Ping timeout: 260 seconds]
tennix has joined #ocaml
tennix has quit [Ping timeout: 252 seconds]
tennix has joined #ocaml
obadz has quit [Ping timeout: 246 seconds]
obadz has joined #ocaml
gustav_ has joined #ocaml
tmtwd has joined #ocaml
tennix has quit [Ping timeout: 246 seconds]
govg has joined #ocaml
samrat has joined #ocaml
tennix has joined #ocaml
tennix has joined #ocaml
tennix has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 252 seconds]
obadz has quit [Ping timeout: 264 seconds]
obadz has joined #ocaml
BitPuffin has joined #ocaml
govg has joined #ocaml
mort___ has joined #ocaml
govg has quit [Ping timeout: 246 seconds]
struktured has quit [Ping timeout: 255 seconds]
nightuser has joined #ocaml
mcorbin has joined #ocaml
ollehar has joined #ocaml
Sorella has joined #ocaml
izaak has quit [Quit: izaak]
tennix has joined #ocaml
tennix has joined #ocaml
tmtwd has quit [Ping timeout: 245 seconds]
izaak has joined #ocaml
thomasga has quit [Quit: Leaving.]
tennix has quit [Ping timeout: 250 seconds]
tane has joined #ocaml
tennix has joined #ocaml
oriba has joined #ocaml
<adrien> dmbaturin, dsheets : I'm at the Camp and not always with a network on
<adrien> well
<adrien> I was in Berlin and now at the camp so now I have a much better connection but less power :P
<dmbaturin> adrien: Which camp?
<adrien> Chaos Communication Camp
<Leonidas> Chaos Communication Camp
<dmbaturin> Oh.
<Leonidas> THE camp :)
<oriba> hi. I want to classify strings (UTF-8 or Unicode in general)... so that I can get char-classes for each letter, so that I then can work on the strings, e.g. transform / substitute unwanted encodings (e.g. chinese to "_" or so).
<adrien> :)
<oriba> Which lib is good for that?
<oriba> Id Camomile the right lib for that?
<oriba> Or what else?
<companion_cube> there are several libraries, including camomille, its successor ucorelib (I think), bunzli's uucp/uucd/uuseg...
<Leonidas> oriba: uucd maybe?
<dsheets> adrien, have fun!
thomasga has joined #ocaml
<adrien> :)
<oriba> Leonidas: you ask me? I have no clue... so I just try to get some names of libs (with recommendations if possible)...
tennix has quit [Ping timeout: 265 seconds]
<companion_cube> oriba: opam search unicode
<oriba> companion_cube: aha... the OCaml-google is called opam? ;-)
<companion_cube> no, but opam has some basic search features :p
<oriba> hmhh, "uucp -- Unicode character properties for OCaml" sounds good...
amirmc has joined #ocaml
BitPuffin has quit [Ping timeout: 255 seconds]
itPuffinB has joined #ocaml
itPuffinB is now known as BitPuffin
tennix has joined #ocaml
tennix has joined #ocaml
ericbmerritt has quit [Ping timeout: 244 seconds]
seako has quit [Ping timeout: 244 seconds]
lambdahands has quit [Ping timeout: 244 seconds]
bitbckt has quit [Ping timeout: 244 seconds]
lambdahands has joined #ocaml
ericbmerritt has joined #ocaml
keen_ has joined #ocaml
tennix has quit [Ping timeout: 244 seconds]
bitbckt has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
seako has joined #ocaml
tmtwd has joined #ocaml
BitPuffin has joined #ocaml
pyon-nanon has quit [Ping timeout: 246 seconds]
<Enjolras> hi
<Enjolras> how can i tell ocamlbuild to always use ocamlfind in mycocamlbuild ?
<Enjolras> i don't see how to set this via the Options module
tennix has joined #ocaml
slash^ has joined #ocaml
<Enjolras> hmm, there is one actually, just not in the web doc linked from ocaml.org
<mfp> hoho who'd have said a 5-line patch could make ocsigen over twice as fast https://github.com/ocsigen/ocsigenserver/issues/49#issuecomment-130337030
<flux> enjolras, so what't the magic if you get it working?-)
<Enjolras> flux: sorry ?
<flux> enjolras, I've always just used -use-ocamlfind; if there's a myocamlbuild.ml alternative, I'd be happy to hear it
tennix has quit [Ping timeout: 264 seconds]
<flux> nice
<Enjolras> ah ok, i didn't understand your sentence :)
<flux> thanks :)
tmtwd has quit [Ping timeout: 265 seconds]
oriba has quit [Quit: WeeChat 1.2]
ely-se has quit [Quit: leaving]
tennix has joined #ocaml
tennix has quit [Ping timeout: 255 seconds]
dsheets has quit [Ping timeout: 255 seconds]
nullcatxxx_ has joined #ocaml
tennix has joined #ocaml
tmtwd has joined #ocaml
tennix has quit [Ping timeout: 244 seconds]
grouzen has quit [Ping timeout: 272 seconds]
QuanticPotato has quit [Ping timeout: 260 seconds]
tennix has joined #ocaml
tennix has joined #ocaml
jeffmo has quit [Quit: jeffmo]
mcorbin has quit [Remote host closed the connection]
QuanticPotato has joined #ocaml
ceryo has quit [Quit: Textual IRC Client: www.textualapp.com]
pyon has joined #ocaml
cthuluh has quit [Ping timeout: 255 seconds]
amirmc has quit [Quit: Leaving.]
xet7 has joined #ocaml
MercurialAlchemi has joined #ocaml
pyon has quit [Ping timeout: 244 seconds]
mort___ has quit [Ping timeout: 246 seconds]
cthuluh has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Client Quit]
jeffmo has joined #ocaml
ncthom91 has joined #ocaml
tane has quit [Quit: Verlassend]
xificurC has joined #ocaml
QuanticPotato has quit [Quit: Leaving]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pyon has joined #ocaml
pyon has quit [Read error: Connection reset by peer]
pyon has joined #ocaml
darkf has quit [Quit: Leaving]
tashjash has quit [Quit: Leaving]
jwatzman|work has joined #ocaml
rand000 has joined #ocaml
<ollehar> how does ocaml infer mutual recursion functions?
swgillespie has joined #ocaml
<ollehar> because you have to look at the body of the function to know the type. ocaml scan twice, then?
tane has joined #ocaml
pyon has quit [Ping timeout: 272 seconds]
tennix has quit [Ping timeout: 255 seconds]
antkong_ has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
ely-se has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<companion_cube> ollehar: you put variables for types you don't know, and refine them later through unification
<companion_cube> however it doesn't work for polymorphic recursion (which isn't inferrable)
tennix has joined #ocaml
<ollehar> companion_cube: ok then
<companion_cube> type inference, afaik, is mostly a question of gathering unification constraints and solving them
pyon has joined #ocaml
<ollehar> but then you need to "guess" what type a function has from usage?
<companion_cube> yes, but you know the type of primitives and previously defined functions
<ollehar> true
<companion_cube> every type is known, except the one of the function (and variables) you try to type
<ollehar> ok, maybe not such a hard problem :)
<companion_cube> that is why there is + and +., so you know the types of their arguments
<ollehar> exactly
<ollehar> (brb)
MrScout has joined #ocaml
breadmonster has joined #ocaml
<breadmonster> Hey everyone.
<octachron> afaik, it is also for this reason that you need special annotations for higher rank polymorphism
tennix has quit [Ping timeout: 240 seconds]
<breadmonster> How do I implement vim style modes in OCaml?
grouzen has joined #ocaml
tmtwd has quit [Ping timeout: 245 seconds]
pyon has quit [Ping timeout: 260 seconds]
tennix has joined #ocaml
tennix has joined #ocaml
badkins has quit []
jao has joined #ocaml
<flux> breadmonster, I don't think I quite understand the question..
<flux> you can't extend vim in just any language, you need to use the vim supported ones?
tennix has quit [Ping timeout: 245 seconds]
<breadmonster> No so like you know how vim uses keypresses to switch modes?
<breadmonster> How does it do that? Like is there a library for CLIs or something in OCaml that handles that kind of stuff?
<breadmonster> My CS teacher told me to look at something called curses.
<breadmonster> Or something like that.
<Maelan> curses is a library for interactive console applications.
<Maelan> It’s all you need.
<breadmonster> Maelan: yeah, I think that's what I'm looking for.
<breadmonster> Does OCaml have bindings?
<ggole> Yes
<ggole> Also see lambda-term
<Maelan> Just google-it!
<Maelan> Yeah, lambda-terme is probably a better idea.
tennix has joined #ocaml
tennix has joined #ocaml
ncthom91 has joined #ocaml
<Maelan> See ‘opam search curses’.
tennix has quit [Ping timeout: 250 seconds]
octachron has quit [Quit: Leaving]
thomasga has quit [Quit: Leaving.]
<ollehar> octachron: makes sense. the problem with PHP - which I'm using type-inference on - is optional arguments. they have no specific syntax in usage, only in definition.
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tennix has joined #ocaml
badkins has joined #ocaml
tennix has quit [Ping timeout: 244 seconds]
ncthom91 has joined #ocaml
psy_ has joined #ocaml
thomasga has joined #ocaml
<ollehar> wait wait wait, is OCaml GC deterministic?
<ollehar> but still unpredictable.
<ollehar> how can it be both?
<mrvn> it is totaly deterministic. Its just to complex for you to know.
<mrvn> it's also configurable at runtime so you can't know how it will behave beforehand.
<mrvn> Further apps could non-deterministically call GC stuff.
<haesbaert> ollehar: flip a coin, the result is totally deterministic if you know all the variables involved, but it's just too complex to know.
ncthom91 has quit [Quit: Textual IRC Client: www.textualapp.com]
<mrvn> haesbaert: that's worse because it is chaotic. You can't know all the variables.
<haesbaert> we have no tools to know all the variables
tmtwd has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<ollehar> hm
dsheets has joined #ocaml
tmtwd has quit [Ping timeout: 265 seconds]
Algebr has joined #ocaml
<Algebr> Is there a code folding minor mode that works for ocaml in emacs?
ely-se has quit [Quit: Leaving...]
lewis1711 has quit [Ping timeout: 245 seconds]
nightuser has quit [Ping timeout: 250 seconds]
martinium has joined #ocaml
ely-se has joined #ocaml
ygrek has joined #ocaml
<bernardofpc> haesbaert> we have no tools to know all the variables -> no, you can't know all variables (Heisenberg) with sufficient precision to predict the (binary) result of the system
BitPuffin has quit [Ping timeout: 265 seconds]
octachron has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
badkins has quit []
rand000 has quit [Ping timeout: 265 seconds]
profan has quit [Quit: leaving]
keen__ has joined #ocaml
profan has joined #ocaml
keen_ has quit [Ping timeout: 252 seconds]
nightuser has joined #ocaml
Lis has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
breadmonster has quit [Quit: Page closed]
tmtwd has joined #ocaml
octachron has quit [Quit: Leaving]
kakadu has quit [Quit: Page closed]
zpe has quit [Ping timeout: 245 seconds]
jabesed has joined #ocaml
antkong_ has quit [Quit: antkong_]
badkins has joined #ocaml
zpe has joined #ocaml
MercurialAlchemi has joined #ocaml
zpe has quit [Remote host closed the connection]
thomasga has quit [Ping timeout: 240 seconds]
ggole has quit []
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AlexRussia has quit [Ping timeout: 272 seconds]
ely-se has quit [Quit: Leaving...]
slash^ has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
tennix has joined #ocaml
tennix has quit [Ping timeout: 240 seconds]
c74d is now known as Guest91301
Guest91301 has quit [Remote host closed the connection]
pyon has joined #ocaml
c74d has joined #ocaml
tennix has joined #ocaml
kakadu has joined #ocaml
tennix has quit [Ping timeout: 252 seconds]
sepp2k has quit [Quit: Leaving.]
badkins has quit []
nullcatxxx_ has joined #ocaml
lobo has quit [Quit: leaving]
matason has quit []
NingaLeaf has joined #ocaml
pyon_ has joined #ocaml
claudiuc has joined #ocaml
pyon has quit [Ping timeout: 244 seconds]
matason has joined #ocaml
claudiuc has quit [Read error: Connection reset by peer]
pyon_ is now known as pyon
claudiuc has joined #ocaml
samrat has quit [Ping timeout: 252 seconds]
BitPuffin|osx has joined #ocaml
_andre has quit [Quit: leaving]
pyon has quit [Ping timeout: 244 seconds]
ousado has quit [Ping timeout: 244 seconds]
ousado has joined #ocaml
ousado has quit [Changing host]
ousado has joined #ocaml
rand000 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 272 seconds]
nightuser has quit [Quit: Leaving]
ely-se has joined #ocaml
pyon has joined #ocaml
izaak has quit [Quit: izaak]
izaak has joined #ocaml
zpe has joined #ocaml
thomasga has quit [Quit: Leaving.]
<ollehar> is there any work in a GC that can be done in parallell as the main thread of a program?
<ely-se> ollehar: look up generational GCs and parallel GCs
thomasga has joined #ocaml
<ollehar> ok, I'm reading about java gc now
<ely-se> Haskell has a parallel GC.
<ely-se> The way Erlang does garbage collection is also incredibly interesting.
tmtwd has quit [Quit: Leaving]
<ollehar> ely-se: I read they use refcount where cycles are impossible?
<ely-se> Who?
<ely-se> Erlang has one GC per process.
<ollehar> you mean where? :)
<ollehar> aha
pyon has quit [Ping timeout: 260 seconds]
<ollehar> erlang is quite slow, though :P
Lis has quit [Read error: No route to host]
<ely-se> No.
<ely-se> Certain programs are slow when running in the official Erlang implementation compared to the equivalent programs in certain implementations of other programming languages.
xet7 has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
<ely-se> Also, CPU speed isn't gonna help you when 99% of what you do is I/O, which is the case in Erlang (if it isn't then you're insane for choosing to use Erlang).
shinnya has joined #ocaml
obadz has quit [Ping timeout: 255 seconds]
obadz has joined #ocaml
pyon has joined #ocaml
<ollehar> ely-se: going back to parallel GC, in a server environment, would you want one core to take care of GC, and other cores to run application logic?
xificurC has quit [Ping timeout: 256 seconds]
<ely-se> I don't care. I want it fast enough.
<mrvn> then don't modify anything. modifying with a parallel GC is death
tane has quit [Quit: Verlassend]
<ollehar> mrvn: modifying?
<mrvn> ollehar: ref or mutable
<ollehar> oh
<mrvn> When you modify a value then you have to tell the GC (all the GC threads) about that so they can rescan the value.
matason has quit []
<mrvn> Which means synchonising across cores, which takes forever.
<ollehar> ok
<mfp> IIRC OCaml multicore is going to use a very concurrent mark & sweep GC for the shared heap
<ollehar> but why would you have more than one gc thread for one environment?
<mrvn> to spread the load
<mfp> ollehar: IIRC GHC has got a parallel (not concurrent!) GC
<mrvn> Also you can have a per core heap that each core cleans itself.
<mfp> (i.e., stop-the-world, but several cores working at the same time to finish GC as fast as possible)
<mrvn> Any function that transmits data between threads then has to move it out of the core heap, same when modifying a value outside the core heap.
pyon has quit [Ping timeout: 252 seconds]
pyon has joined #ocaml
<ollehar> mfp: hm no, will do :) thanks
<mrvn> I wish the GC / runtime would be reentrant so you can run one per core.
<mrvn> or have different libraries that start their own ocaml runtime.
<mfp> ollehar: more details here (maybe the design evolved a bit in the meantime though) http://www.cl.cam.ac.uk/~sd601/multicore.md
<mfp> mrvn: that's the route the ocamlpro guys nearly completed (I don't remember if they used TLS or passed a context around, maybe the latter)
<mfp> ... and then when it was close to ready for merging, it just stopped
<mrvn> mfp: yeah. I hate when that happens
<mfp> IIRC it happened twice actually :-/
<mfp> (for the same thing I mean, making the runtime reentrant)
<mfp> so it was most surprising to see the ANN from the people in charge that ocamllabs' stuff would indeed be merged
<mfp> by the end of the year(!)
<ollehar> mfp: what would that mean, reentrant runtime?
<mfp> ollehar: essentially, getting rid of the global variables the runtime uses
tennix has joined #ocaml
<mfp> so you can run multiple runtimes at once
<ollehar> why, though?
<mfp> like multiple OCaml programs, but within the same process
<ollehar> with message passing...?
<mfp> likely, IIRC ways to do it were being explored at the time
pyon has quit [Ping timeout: 250 seconds]
<mrvn> ollehar: say you have 2 C libraries that internally use ocaml. Their runtimes will collide.
<mfp> yeah that's a bummer, ocamllabs' departing from multiple runtimes means it won't be possible to embed OCaml in general :-/
tennix has quit [Ping timeout: 246 seconds]
<mfp> OCamlPro indeed was passing a context structure around
<mfp> ocamllabs just went TLS
<mrvn> I've been playing around with porting my ARM bare-metal ocaml stubs to SMP running one ocaml runtime per core with a module to send messages between cores. For that I was planing to simply mark all the data ad copy-on-write so each runtime gets it's own copy if they modify some global state.
<mrvn> No shared data between cores, just message passing.
<ollehar> what's done in recent research about GC?
<ollehar> except parallel, I'd suppose.
<ollehar> typical google question, I know :)
<ollehar> top answer: a closed stackoverflow thread
<mrvn> maybe non-parallel GC work has finished.
<ollehar> perhaps
<ollehar> or, RAM is so abundant, you don't need to collect anymore.
<mrvn> With even mobiles being multi-core and 64bit doing a single core GC is kind of yesterday.
<ely-se> ollehar: just turn RAM into a ring buffer
<ely-se> wrap pointers around
<ollehar> haha
<ollehar> cowboy programming at its best
<ollehar> yeah, everything is about cache sync these days.
<ely-se> everything is about maintainability
GeorgeHahn has joined #ocaml
Lis has joined #ocaml
mrm has quit [Ping timeout: 240 seconds]
jao has quit [Quit: Using Circe, the loveliest of all IRC clients]
jao has joined #ocaml
Simn has quit [Quit: Leaving]
pyon has joined #ocaml
zpe has quit [Remote host closed the connection]
ely-se has quit [Quit: Leaving...]
rand000 has quit [Quit: leaving]
scythe- has quit [Quit: leaving]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
<ollehar> or... you could make a type-system which ensures no objects live longer than N time. then the "ring buffer GC" might work. :)
antkong_ has joined #ocaml
<ollehar> or... the memory usage is in the type system, so when malloc, the compiler will tell you if you have enough memory or not, and if something need to be freed.
<ygrek> can I haz ponies too?
<ollehar> ygrek: and unicorns!
kakadu has quit [Remote host closed the connection]
<ollehar> but the second alternative would be possible with effect types, yes?
<ollehar> maybe a fork of Rust could do that...
Haudegen has quit [Ping timeout: 260 seconds]
jao has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 264 seconds]
<ollehar> you would only have permanent object and object with life-time N
<ollehar> keyword perm
<ollehar> *objects
madroach has joined #ocaml
<ollehar> I'm in the zone. ^^
<ollehar> keyword 2: temp, for temporary objects.
thomasga has quit [Quit: Leaving.]
<ollehar> and stat, for static variables.
<ollehar> this is weird.
Haudegen has joined #ocaml