ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
lewis1711 has joined #ocaml
jleroux has quit [Ping timeout: 272 seconds]
thomasga has joined #ocaml
jeffmo has quit [Quit: jeffmo]
Colourful has joined #ocaml
rand000 has quit [Quit: leaving]
mengu has joined #ocaml
n3ss3s has joined #ocaml
swgillespie has joined #ocaml
ghostpl has quit [Remote host closed the connection]
mengu has quit [Ping timeout: 240 seconds]
ljs has quit [Quit: Be back later ...]
ljs has joined #ocaml
lobo has quit [Quit: leaving]
maurer has quit [Ping timeout: 272 seconds]
ljs has quit [Ping timeout: 272 seconds]
n3ss3s has quit [Read error: Connection reset by peer]
n3ss3s has joined #ocaml
ljs has joined #ocaml
yomimono has joined #ocaml
maurer has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jeffmo has joined #ocaml
xificurC_ has joined #ocaml
xificurC has quit [Remote host closed the connection]
thomasga has quit [Quit: Leaving.]
tanguc_s has quit [Ping timeout: 265 seconds]
darkf has joined #ocaml
swgillespie has joined #ocaml
yomimono has quit [Ping timeout: 256 seconds]
Denommus has joined #ocaml
palomer has joined #ocaml
struktured has quit [Ping timeout: 265 seconds]
Colourful has quit [Quit: Page closed]
palomer has quit [Quit: palomer]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jleroux has joined #ocaml
jleroux has quit [Ping timeout: 250 seconds]
dubosec has joined #ocaml
<dubosec> hi tanguc_s
<dubosec> oh, nvm; s/he is not here anymore
palomer has joined #ocaml
javamonn has joined #ocaml
palomer has quit [Quit: palomer]
shinnya has quit [Ping timeout: 245 seconds]
The_Mad_Pirate has joined #ocaml
n3ss3s has quit [Ping timeout: 246 seconds]
palomer has joined #ocaml
javamonn has quit [Remote host closed the connection]
srcerer has quit [Read error: Connection timed out]
palomer has quit [Quit: palomer]
palomer has joined #ocaml
srcerer has joined #ocaml
javamonn has joined #ocaml
javamonn has quit [Remote host closed the connection]
pyon has quit [Quit: I have irrefutable proof that D < 0. It follows trivially from 2D > 3D, which is obviously true.]
pyon has joined #ocaml
javamonn has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
osa1__ has quit [Ping timeout: 272 seconds]
idegen has quit [Quit: Leaving.]
BitPuffin|osx has quit [Ping timeout: 250 seconds]
jleroux has joined #ocaml
jleroux has quit [Ping timeout: 246 seconds]
lopex has quit [Quit: Connection closed for inactivity]
ljs has quit [Quit: Be back later ...]
xificurC_ has quit [Write error: Broken pipe]
xificurC has joined #ocaml
shinnya has joined #ocaml
struktured has joined #ocaml
JuggleTux has quit [Quit: leaving]
tg has quit [Ping timeout: 256 seconds]
tg has joined #ocaml
ggole has joined #ocaml
ygrek has joined #ocaml
n3ss3s has joined #ocaml
ygrek has quit [Ping timeout: 276 seconds]
javamonn has quit [Remote host closed the connection]
wwilly has joined #ocaml
nullcat_ has joined #ocaml
javamonn has joined #ocaml
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
javamonn has quit [Remote host closed the connection]
shinnya has quit [Quit: ZNC - http://znc.in]
Gama11 has joined #ocaml
seangrove has joined #ocaml
javamonn has joined #ocaml
pobivan has joined #ocaml
javamonn has quit [Remote host closed the connection]
<n3ss3s> So I'm trying to extract n elements spaced by k >= 0 elements from a list. Is there an expression for a list of a certain length, so I could match the list with a :: <k elements> :: b :: <k elements>...?
slash^ has joined #ocaml
swgillespie has joined #ocaml
Denommus has quit [Ping timeout: 240 seconds]
<ggole> No, but you could write a function 'a list -> int -> ('a * 'a list * 'a * 'a list) option that pulls the parts out if they exist
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<n3ss3s> I think the performance difference is significant enough to warrant going array based here (for extracting every set of n consecutive k-spaced elements out of a list)
Denommus has joined #ocaml
Denommus has quit [Ping timeout: 265 seconds]
matason has joined #ocaml
<ggole> You could even avoid copying by using a triple of base, start, end
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
Denommus has joined #ocaml
jleroux has joined #ocaml
jleroux has quit [Ping timeout: 245 seconds]
n3ss3s has quit [Ping timeout: 240 seconds]
jleroux has joined #ocaml
redpoppies has joined #ocaml
ljs has joined #ocaml
ljs has quit [Ping timeout: 272 seconds]
TheLemonMan has joined #ocaml
jleroux has quit [Ping timeout: 272 seconds]
rgrinberg has quit [Ping timeout: 250 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
thomasga has joined #ocaml
matason has quit []
Kakadu has quit [Quit: Page closed]
avsm has joined #ocaml
contempt has quit [Ping timeout: 272 seconds]
contempt has joined #ocaml
asQuirreL has joined #ocaml
lordkryss has joined #ocaml
thomasga has quit [Quit: Leaving.]
milosn has quit [Quit: leaving]
nojb has joined #ocaml
thomasga has joined #ocaml
ygrek has joined #ocaml
olibjerd has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
swgillespie has quit [Client Quit]
Haudegen has quit [Ping timeout: 256 seconds]
tanguc_s has joined #ocaml
matason has joined #ocaml
tane has joined #ocaml
matason has quit []
<tanguc_s> hi
tanguc_s has quit [Quit: leaving]
tanguc_s has joined #ocaml
<tanguc_s> hi
Haudegen has joined #ocaml
<nojb> hi
<lewis1711> utop really chews up my memory. can't tell if it's leaking or just a hog
ir2ivps4 has quit [Ping timeout: 250 seconds]
jleroux has joined #ocaml
mengu has joined #ocaml
jleroux has quit [Ping timeout: 250 seconds]
<lewis1711> yeap, it definitely leaks
thomasga has quit [Quit: Leaving.]
freling has joined #ocaml
thomasga has joined #ocaml
rand000 has joined #ocaml
tani has joined #ocaml
tane has quit [Ping timeout: 256 seconds]
AlexRussia has quit [Ping timeout: 245 seconds]
matason has joined #ocaml
sdothum has joined #ocaml
jeffmo has quit [Quit: jeffmo]
AlexRussia has joined #ocaml
AlexRussia has quit [Excess Flood]
willy_ has joined #ocaml
dsheets has joined #ocaml
wwilly has quit [Ping timeout: 256 seconds]
freling has quit [Quit: Leaving.]
nojb has quit [Quit: nojb]
nojb has joined #ocaml
AlexRussia has joined #ocaml
mengu has quit [Remote host closed the connection]
guto has joined #ocaml
rossberg has quit [Ping timeout: 265 seconds]
tanguc_s has quit [Ping timeout: 265 seconds]
seangrove has quit [Read error: Connection reset by peer]
seangrove has joined #ocaml
mengu has joined #ocaml
BitPuffin|osx has joined #ocaml
thomasga has quit [Quit: Leaving.]
rossberg has joined #ocaml
matason has quit []
ygrek has quit [Ping timeout: 276 seconds]
thomasga has joined #ocaml
yomimono has joined #ocaml
matason has joined #ocaml
avsm has quit [Quit: Leaving.]
thomasga has quit [Quit: Leaving.]
nojb has quit [Quit: nojb]
<reynir> I'm looking at js_of_ocaml. Is there an example of an event handler that actually uses the event?
nojb has joined #ocaml
<reynir> Oh, nevermind
freling has joined #ocaml
Hannibal_Smith has joined #ocaml
matason has quit []
tanguc_s has joined #ocaml
<lewis1711> ocamls object system is really nice. though I often read that people don't really use it, which is a shame
thomasga has joined #ocaml
<reynir> I've experienced that type errors can be really long with objects
<dmbaturin> lewis1711: From my observations, in languages that don't force objects on you, people tend not to use them as often as in languages that do. :)
Hannibal_Smith has quit [Quit: Leaving]
freling has quit [Quit: Leaving.]
freling has joined #ocaml
Hannibal_Smith has joined #ocaml
<lewis1711> dmbaturin, sure. I am a fan of the way ocaml does them though. particularly how I can forego using classes altogether
Submarine has quit [Remote host closed the connection]
<apache2_> I'm not a fan of the silent integer casts :(
Hannibal_Smith has quit [Quit: Leaving]
<lewis1711> apache2_, where?
Choups314 has joined #ocaml
freling has quit [Quit: Leaving.]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
thomasga has quit [Quit: Leaving.]
hugomg has joined #ocaml
ljs has joined #ocaml
Submarine has quit [Remote host closed the connection]
lopex has joined #ocaml
<apache2_> # int_of_float 9223372036854775806.0 ;;
<apache2_> - : int = 0
<apache2_> # int_of_float 9223372036854775805.0 ;;
<apache2_> - : int = 0
<apache2_> 9223372036854775805 ;;
<apache2_> Error: Integer literal exceeds the range of representable integers of type int
<apache2_> I would expect this latter exception to be raised by int_of_float too
<lewis1711> oh right. it's a speed trade off
<apache2_> we're not talking about PHP here :(
<lewis1711> Everything is just a dumb 31 bit integer
<apache2_> if I cared more for speed than correctness I'd code LLVM IR
<lewis1711> If you want numbers that act properly, I think there's other num types
<apache2_> or C
<apache2_> oh!
<reynir> zarith is faster
<lewis1711> but yeah, I am a fan of numbers trying to behave as correctly as possible by default, than having fast-but-error-prone operations be the special case. like scheme with fx+
<apache2_> lewis1711: same
<lewis1711> but anyway, it can be done in ocaml
<apache2_> unsafe_int_of_float or no_fucks_given_int_of_float would be a better name for a function that suffers from this 'everything is 0' syndrome
<lewis1711> I wouldn't say it "Suffers"... ocaml was/is popular among the numerical programming community.
<ggole> Pervasives already has truncate (which is the same operation under a different name)
<ggole> You might prefer to use that name if you feel it describes the semantics better
<apache2_> ggole: truncate is a fine name, and I guess it's useful, but int_of_float is a bit misleading
<ggole> Yeah, can't really disagree
<apache2_> perhaps it should be unaliased.
osa1__ has joined #ocaml
<lewis1711> speaking of numbers... I am trying to do Int32 arithmetic. have all the core stuff loaded, which seems to not have "add" methods
<lewis1711> the stdlib does
<lewis1711> it has "val (+) : t -> t -> t"
<lewis1711> no clue how to use it though
<nojb> Int.(a + b)
<nojb> Int32.(a + b)
<nojb> or let open Int32 in a + b
<lewis1711> nojb, thanks heaps. for future reference, does that feature/syntax have a name?
Denommus has quit [Ping timeout: 256 seconds]
clog has joined #ocaml
hugomg has quit [Ping timeout: 264 seconds]
idegen has joined #ocaml
idegen has quit [Remote host closed the connection]
idegen has joined #ocaml
hugomg has joined #ocaml
darkf has quit [Quit: Leaving]
lewis1711 has quit [Read error: No route to host]
thomasga has joined #ocaml
guto has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
yomimono has quit [Ping timeout: 264 seconds]
palomer has joined #ocaml
psy has quit [Read error: Connection reset by peer]
psy has joined #ocaml
tg has quit [Ping timeout: 252 seconds]
milosn has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sdothum has joined #ocaml
Submarine has joined #ocaml
Submarine has joined #ocaml
badkins has joined #ocaml
lobo has joined #ocaml
javamonn has joined #ocaml
Snark_ is now known as Snark
javamonn has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 276 seconds]
osa1__ has quit [Ping timeout: 265 seconds]
osa1__ has joined #ocaml
<reynir> I don't understand how to use Deriving_Json from js_of_ocaml
lewis1711 has joined #ocaml
<lewis1711> is there a way to do a *deep* copy of a record?
ontologiae_ has joined #ocaml
<nojb> only by hand
<lewis1711> as in, field by field?
<lewis1711> that will copy it deeply?
<reynir> Ah, I needed to install 'deriving'
psy has quit [Ping timeout: 265 seconds]
<nojb> lewis1711: yes, but of course only mutable fields need to be actually copied . You can use the 'with' notation to copy just those
pobivan_ has joined #ocaml
pobivan has quit [Ping timeout: 252 seconds]
pobivan_ is now known as pobivan
BitPuffin|osx has quit [Ping timeout: 246 seconds]
redpoppies has quit [Quit: redpoppies]
psy has joined #ocaml
<ggole> If you mean deep as in an entire linked mutable structure, you'll have to write that yourself
avsm has joined #ocaml
<lewis1711> yeah I was copying an entirely mutable struct
<lewis1711> so had to write it by hand
<ggole> One record you can do with with as nojb suggested
<reynir> maybe you can make a ppx_deriving_deepcopy
<reynir> err
<ggole> Handling cycles would be hard
<lewis1711> with keyword is hard to google for
<ggole> { r with x = r.x; y = r.y; }
<ggole> Or rather, { r with x = deepcopy r.x; y = deepcopy r.y; }
palomer has quit [Quit: palomer]
Choups314 has quit [Ping timeout: 256 seconds]
javamonn has joined #ocaml
avsm has quit [Quit: Leaving.]
guto has joined #ocaml
javamonn has quit [Remote host closed the connection]
hbar has quit [Ping timeout: 272 seconds]
tg has joined #ocaml
guto has left #ocaml [#ocaml]
palomer has joined #ocaml
javamonn has joined #ocaml
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
Choups314 has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
palomer has quit [Quit: palomer]
rgrinberg has joined #ocaml
palomer has joined #ocaml
Denommus has joined #ocaml
hugomg has quit [Ping timeout: 272 seconds]
ygrek has joined #ocaml
<haesbaert> http://codepad.org/quMTuRf3 could someone explain me why this is incorrect ?
<haesbaert> Error: Unbound value t
<haesbaert> is Module.t a special thingy ?
<nojb> t is a type, not a value
<nojb> so probably you mean type foo = t ref
<haesbaert> hmm, actually I wanted a Config.config that would reference an arbitrary Config.t
ontologiae_ has quit [Ping timeout: 250 seconds]
<haesbaert> so I can't have a reference to a type ?
<Denommus> haesbaert: you can have a reference to a value of a type
<Denommus> haesbaert: types usually only exist during compilation, and constraint the operations you can perform over a term
<haesbaert> hmmm
<haesbaert> can I use None there ?
<haesbaert> and then later modify to a real Config.t ?
<haesbaert> let foo = ref None... Config.config := make_new_config...
<nojb> sure, let foo : t option ref = ref None
<haesbaert> ah ok, that might be an option, basically I'm expressing the configuration of my daemon, but the configuration must be created and then applied to Config.config, sicne I don't want to pass that value around the stack
<haesbaert> ok the optional ref solves it
<haesbaert> nojb: thanks
<Denommus> haesbaert: but actually there's two ways you can pass types around. One is with a functor (you may have a functor that takes a sig with an abstract type, and the struct itself defines which type that is). The other is with first-class modules
<Denommus> haesbaert: not that this has anything to do with your problem, I just wanted to not give you incomplete information
<haesbaert> Denommus: would that solve my problem ?
<haesbaert> ah ok
<haesbaert> all in all I just wanted to store a "global pointer" somewhere, and that the first value would be none.
<Denommus> that's fine
javamonn has quit [Remote host closed the connection]
Choups314 has quit [Ping timeout: 240 seconds]
Choups314 has joined #ocaml
<haesbaert> sorry, another stupid question: codepad.org
<haesbaert> arghh: http://codepad.org/IxrZxOEq
<haesbaert> is it because it is now an optional value and I will have to match against none ?
<nojb> you need to pattern match on the option type : match !config with Some config -> config.subnets | None -> failwith "something bad has happened"
javamonn has joined #ocaml
<haesbaert> ah I see, that would be a bummber, since that is always "Some", except on program initialization, so I guess I need something differente.
<haesbaert> *different.
javamonn has quit [Remote host closed the connection]
<haesbaert> I could initialize pointing to a "blank" Config.t maybe
<nojb> that's a good idea
<haesbaert> ok, leme try
<haesbaert> great that makes me happy: let config = ref { subnets = []; options = []}
<haesbaert> thanks again
javamonn has joined #ocaml
javamonn has quit [Remote host closed the connection]
Choups314 has quit [Ping timeout: 265 seconds]
Choups314 has joined #ocaml
<ggole> The downside of doing it that way is that now the type doesn't tell you whether you have a meaningful value or not
<haesbaert> I see that, but in this case is not an issue, it is more or less the very first thing the program does, and it exits if it can't build a valid value.
<ggole> If that's so, maybe you can get the valid value first and just bind to that
<ggole> Not always the most convenient path, I know.
javamonn has joined #ocaml
<haesbaert> to uild it I require runtime paraments
<haesbaert> *parameters
<haesbaert> but maybe I could have a default, that's actually doable.
<nojb> personally I prefer to do away with global variables completely and just pass the values around
mort___ has joined #ocaml
<haesbaert> me too, but this is pretty much a readonly value that cannot change at all
<haesbaert> and will be used all over
mort___ has left #ocaml [#ocaml]
javamonn has quit [Remote host closed the connection]
<haesbaert> I'm basically parsing a dhcpd.conf like the ISC one
<haesbaert> maybe passing the config around is actually doable, then I can kill the global
Choups314 has quit [Ping timeout: 265 seconds]
Choups314 has joined #ocaml
mengu has quit []
palomer has quit [Quit: palomer]
rand000 has quit [Ping timeout: 252 seconds]
tg has quit [Ping timeout: 276 seconds]
lobo has quit [Quit: leaving]
matason has joined #ocaml
olibjerd has quit [Ping timeout: 272 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
NoNNaN has joined #ocaml
SomeDamnBody has joined #ocaml
tanguc_s has quit [Quit: Lost terminal]
Hannibal_Smith has joined #ocaml
SomeDamnBody has quit [Ping timeout: 245 seconds]
BitPuffin|osx has joined #ocaml
nojb has quit [Quit: nojb]
Gama11 has quit [Quit: No Ping reply in 180 seconds.]
Gama11 has joined #ocaml
rand000 has joined #ocaml
lobo has joined #ocaml
tg has joined #ocaml
Choups314 has quit [Ping timeout: 252 seconds]
Algebr has joined #ocaml
SomeDamnBody has joined #ocaml
justgage has joined #ocaml
<justgage> Hey I was wondering if anyone has used a curl library with Ocaml
asQuirreL has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<adrien_znc> (yes)
* adrien_znc afk very soon
<struktured> justgage: there is this: https://github.com/ygrek/ocurl
ontologiae_ has joined #ocaml
SomeDamnBody has quit [Ping timeout: 240 seconds]
<reynir> I've used cohttp for http requests
<Drup> rgrinberg: ping ? :p
<justgage> I was wanting to interact with a companies REST api, which would be best for that? OCurl?
Haudegen has quit [Ping timeout: 272 seconds]
<struktured> justgage: this is a pontification on the subject: http://rgrinberg.com/blog/2014/04/04/introducing-opium/
<Drup> that's not a client
<struktured> oh yeah oops
Haudegen has joined #ocaml
robink has quit [Ping timeout: 248 seconds]
robink_ has joined #ocaml
Algebr has quit [Ping timeout: 256 seconds]
<rgrinberg> Drup: pong
<rgrinberg> justgage: ocurl works but very ugly. try cohttp instead
osa1__ is now known as osa1
Snark has quit [Quit: leaving]
Snark has joined #ocaml
nullcat has joined #ocaml
SomeDamnBody has joined #ocaml
lewis1711 has quit [Ping timeout: 272 seconds]
<Drup> rgrinberg: I've waited all the week to discuss furl directly :3
<Drup> (ok, I was busy too, so not actively waiting :D)
Algebr has joined #ocaml
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
freling has joined #ocaml
SomeDamnBody has quit [Ping timeout: 264 seconds]
redpoppies has joined #ocaml
kaepora has joined #ocaml
<kaepora> Hello everyone!
Algebr has quit [Remote host closed the connection]
<kaepora> I am a new PhD student at INRIA =p as you might expect, I need to learn a lot of OCaml, and fast!
<kaepora> So I'll be hanging out here asking dumb questions.
Algebr has joined #ocaml
<Drup> which team, by curiosity ?
<kaepora> PROSECCO
<Drup> oh, I see
<kaepora> I must say it's quite terrifying
<kaepora> I'm surrounded by OCaml's creators
<kaepora> And I'm completely new to the language
bjorkintosh has quit [Ping timeout: 255 seconds]
<Denommus> kaepora: do you have experience with other statically typed functional language, like ML or Haskell?
<kaepora> Drup: Are you at INRIA as well?
<kaepora> Denommus: Yes. I also use JavaScript copiously, in a purely functional style.
<Drup> not inria, but I'm two floor below. :)
<kaepora> Drup: :D
<kaepora> Neato
<Denommus> kaepora: which one?
<kaepora> Denommus: Haskell (beginner)
<kaepora> The thing is, I grasp OCaml well
<kaepora> And I understand the logic and reasoning behind the features and the language generally
<Denommus> kaepora: ah. Well, the "hardest" (or more interesting) part will probably the module system, then.
<kaepora> What's annoying is that OCaml has hundreds of little quirks, tricks and little-known methods
<Denommus> at least it was for me
<kaepora> And since the team here is so well-versed, they use those tiny things all the tim,e
<Drup> Denommus: you mean, the awesomest, right ? :3
<kaepora> Which makes code really inaccessible
<Denommus> Drup: definitely
<Denommus> why can't every language have OCaml module system? :(
<kaepora> My first OCaml project is to write a JS compiler :P
<Drup> from what ?
<Denommus> cool
<kaepora> JS to ML more or less
<Drup> oh, this direction
<Denommus> kaepora: will you use menhir + sedlex?
<Drup> that's weird, but why not
<kaepora> Denommus: Yes aleady using Menhir
<Denommus> sedlex is a cool lexer
<Denommus> Drup: maybe it's useful to use all those JavaScript libraries on OCaml, I dunno
<kaepora> What does a single colon mean in OCaml?
<kaepora> a:b
<ggole> In what context? :)
<reynir> it means a is type b
<ggole> Could be type ascription or named argument
<kaepora> let example a (x:b) =
<ggole> Type ascription.
<kaepora> I see, thanks!
<ggole> (Named arguments look like ~foo:bar
<ggole> )
robink_ is now known as robink
HrafnA has joined #ocaml
nullcat__ has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
seangrove has quit [Ping timeout: 245 seconds]
nullcat has quit [Ping timeout: 265 seconds]
redpoppies has quit [Quit: redpoppies]
swgillespie has joined #ocaml
<mk270> gday - did anyone have any ideas about my empty .annot file problem? I have a programme with about 5 .ml files, and when I compile it, ocamlc gives me full .annot files, but ocamlopt leaves one of the .annot files blank, which makes tuareg-mode sad
<Drup> mk270: do you have the same issue with bin-annot ?
Hannibal_Smith has quit [Quit: Leaving]
<mk270> Drup: not sure - how do i distinguish between them?
<Drup> they don't produce the same files
<Drup> bin-annot produces .cmt
<mk270> ok
<mk270> how do i make tuareg-mode use .cmt files?
<Drup> hum, I don't know, I use merlin exclusively :x
freling has quit [Quit: Leaving.]
<Drup> if you don't want merlin, use ocp-index, it's working better anyway and works with .cmt files
struktured has quit [Ping timeout: 256 seconds]
<ggole> tuareg-mode doesn't eat .cmts as far as I know
<ggole> Although these days it's merlin all the way for me too
<mk270> ok, so how do i get emacs to tell me the types of compiled .ml files if i am using bin-annot?
<ggole> Install merlin, and use it's show type command
<ggole> It's quite slick, you don't even need to compile the current file
Haudegen has quit [Ping timeout: 240 seconds]
<mk270> merlin isn't actually available from ubuntu yet :(
<Drup> hum, install it with opam ?
<Algebr> ? its via opam install
<Denommus> merlin is probably one of the best minor-modes I have used in Emacs
<mk270> yeah, but that can take hours
<Algebr> I don't understand why ubuntu adds everythig under the sun to apt-get
<Drup> *hours* ?
<Algebr> what hours? Its literally 3 minutes
<mk270> well, when opam has found stuff isn't up to date, it takes forever fixing this
<Drup> then don't opam upgrade, it's independent
<mk270> ok, thanks - it wasn't clear that it was independe
<ggole> Wonder if it's reinstalling a bumped version of core or something
<mk270> nt
<Algebr> I don't know what you're talking about, even installing core takes at most 10 minutes on the slowest machine
<ggole> Just merlin is quite small
freling has joined #ocaml
<ggole> It has only a few dependencies
<mk270> takes 10 minutes. exactly.
<mk270> apt-get takes a few seconds
<Algebr> I said even installing core takes at most 10 minutes, not merlin
<mk270> and on stable does not upgrade anything (opam seems to be able to do this too)
<Drup> Algebr: pretty sure it's longer on a rPI :D
<mk270> ok, i'm going to give this a try
<mk270> turns out merlin is already installed, so better than apt-get, which doesn't know about merlin :)
<mk270> how do i tell ocamlopt to make merlin happy? giving it -bin-annot should be enough to get started?
<Drup> yes
matason has quit []
<Drup> actually, no, you don't need to do anything
<mk270> and then i grovel around in my .emacs to placate merlin
<mk270> (which is 1000 times better than installing a whole file worth of elisp cack)
<mk270> reassuringly, whoever made the merlin emacs integration hates/fears the same things as i do
<mk270> ok - so how do i get emacs to tell me the types, now that i have merlin integrated?
<mk270> it says "Buffer royalty.ml has no process"
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Drup> you launched the merlin mode ?
<mk270> it seems to say "Tuareg merlin (default)"
<mk270> so *something* launched the merlin mode on my behalf
nojb has joined #ocaml
<mk270> looks like the merlin instructions hook themselves into tuareg-mode (fair enough)
<mk270> (add-hook 'tuareg-mode-hook 'merlin-mode)
<mk270> (add-hook 'caml-mode-hook 'merlin-mode)
<Drup> you added a .merlin file in your project, to tell merlin where to find build artifacts and sources ?
<mk270> no of course not :)
<ggole> Test it on a standalone file first
swgillespie has joined #ocaml
<mk270> the merlin docs need a list of links to example .merlin files
<mk270> and to be copy-edited by a native english speaker
<mk270> is there a good example .merlin file anywhere?
<Drup> frenglish is the natural language of the OCaml community.
<mk270> (now that github has succeeded in preventing "search by filename"
<mk270> drup: yeah, and frenglish is super ambiguous
<mk270> and half the speaker community doesnt realise
<mk270> Drup: perfect. thanks
<Drup> hum, that's not a good example, no dependencies
<mk270> i just need "./*.ml{i,}
<mk270> "
<mk270> no dependencies, no nothing
<mk270> just the directory
<mk270> is that
<mk270> S ./* ?
<ggole> That should happen by default, iirc
<Drup> yes, the current directory is included by default
<ggole> You do need to compile with -bin-annot for some features though
<ggole> (merlin works on the .cmts)
<mk270> bupkis
caml has joined #ocaml
<mk270> well, i have a bunch of cmts, and no C-c C-t
<ggole> Does it work on something standalone?
<ggole> let f x = x + 1, C-c C-t on x, gives int?
<mk270> what do you mean by standalone?
<mk270> i have basically 100 lines of ocaml with 0 dependencies
Kakadu has joined #ocaml
<mk270> and no, it doesn't work on a 3 line single .ml file
<mk270> still "Buffer foo.ml has no process"
caml has left #ocaml [#ocaml]
<ggole> Hrm
AlexRussia has quit [Ping timeout: 272 seconds]
<mk270> is there some way i can use merlin without emacs, to check it's doing its thing
<mk270> isolate the blame?
<Drup> Restart emacs ? ^^'
<ggole> You can start ocamlmerlin but there's no real way to do anything
<ggole> Try M-x merlin-restart-process and yeah, restarting emacs
<mk270> ok, i haven't restarted emacs since the clinton administration
Haudegen has joined #ocaml
<mk270> and merlin is now preventing graceful emacs shutdown, so they've managed to screw up my editor of 20 years too
<osa1> does anyone here have any experience with MetaOCaml?
<mk270> ok, so i restarted emacs
<mk270> and C-c C-t gave me an error about wrong types
<mk270> restarted again
<mk270> and now it doesn't work again
<mk270> Buffer ... has no process
<Drup> that's ... weird.
<mk270> ffs
<mk270> it depends on whether emacs was started from xterm or from olvwm
<ggole> Oh, you've probably got the wrong env in emacs
<mk270> and in one case it fails, and in the other it won't let me close emacs without confirming i want to shut merlin
<mk270> why do people have to change things that don't need to be changed?
<mk270> ggole: i am perfectly aware what the problem is
<mk270> but to solve it i need to hardwire opam's notion of what version of the ocaml compiler i am using into my .emacs
<mk270> which i'd rather not do
<Drup> you don't need to hardwire
<mk270> i assume that -annot has worked fine since the early 90s, right?
<mk270> drup: go on?
<mk270> it needs to know where /home/mk270/.opam/4.01.0/bin/ocamlmerlin is
Algebr has left #ocaml ["ERC (IRC client for Emacs 25.0.50.1)"]
freling has quit [Quit: Leaving.]
<mk270> ?
<ggole> I just restart emacs from the terminal if I make opam changes (which I don't do that often)
<ggole> It'd be nice to solve it properly though...
<Drup> ggole: it's solved in what I linked
<Drup> it contains a function that call opam directly
<Drup> instead of relying on env variables
<mk270> [ERROR] user-setup is not available because your system doesn't comply with ocaml-version >= "4.02".
<Drup> eh.
<ggole> Hmm.
<mk270> whatever
SomeDamnBody has joined #ocaml
<mk270> i'll hardwire this crap in my .emacs and hope for the best
<mk270> i literally have not changed my window manager configuration since 1996, and i am not planning to any time soon
<ggole> mk270: so to be clear, with an emacs started from the terminal your C-c C-t is working?
<mk270> ggole: yes
<ggole> OK.
<mk270> because emacs from xterm has inherited the PATH or whatever from bash
<mk270> as bash's per-shell startup script evals some opam-related code
<Drup> mk270: you realize it's just one line in the good .profile/.xinitrc/whatever ?
<mk270> whereas the windowmanager doesn't
<mk270> Drup: i am perfectly aware of that, yes
<mk270> i think it is easier to hardwire the opam compiler version in .emacs
<ggole> That only half works, since you lose updates from opam switch, etc
<Drup> ok.
SkySkimmer has joined #ocaml
<mk270> than to complicate my X startup with a whole bunch of app-specific hacks
<mk270> ggole: yeah, that seems like a small loss
<Drup> depends how much you switch
<mk270> and i reckon if it breaks, it'll say so explicitly rather than silently screwing me over
n3ss3s has joined #ocaml
<Drup> (I do very often ..)
freling has joined #ocaml
<mk270> you may probably infer from how little i change my X setup that i might not change my ocaml setup very often either :) you'd be right
<mk270> so
<mk270> when it's installed properly
<mk270> i get "Wrong type argument: number-or-marker-p, nil"
lordkryss has quit [Quit: Connection closed for inactivity]
<mk270> when using C-c C-t
<mk270> on even the simple example
<mk270> my .merlin file might be to blame, of course
<c-c> what
<c-c> 8)
<reynir> hah
<Drup> :D
<ggole> Hmm... which emacs version?
<mk270> S ./**
<mk270> is all that is in the file
<mk270> emacs 23.4.1
<mk270> whatever ubuntu is giving me
<mk270> i think it's the sensible ubuntu - whatever the most recent LTS is, which is by coincidence the newest anyway
<ggole> Seems like it should be ok... file a bug I guess :(
<Drup> it's weird.
<mk270> a bug?
<mk270> are you serious?
<Drup> it seems like an issue in your setup, though.
<mk270> i find a serious bug in ocamlopt, and you say "stop using -annot", and recommend "-bin-annot" which doesn't work, so i reconfigure everything and file a bug against something else?
<Drup> ahahah x)
<mk270> why is it that ocamlc and ocamlopt will generate different .annot files, one empty?
<ggole> Software, it's a wonderful thing.
<mk270> surely that is not supposed to happen?
<Drup> mk270: no it's not, you should have reported it regardless
<ggole> That sounds like another bug indeed.
<mk270> people who are not being force-fed the latest ocaml wizardry are not going to be aware of merlin etc, and could be being bitten by this missing .annot behaviour
<mk270> Drup: fair enough
<mk270> how do i report a bug in ocamlopt then?
<mk270> without joining a mailing list :)
<Drup> just fwiw, even if it may look like it, irc is not the bug tracker of OCaml :3
<mk270> Drup: i can live with that :)
<mk270> what i can't live with is another email firehose
<mk270> where do i report ocamlc bugs?
<Drup> http://ocaml.org/, scroll to the bottom, there is a link "bugtracker"
<Drup> come on, mk270, you can do better than that :3
<mk270> thanks
<mk270> ok, i am trying to file a bug
<mk270> but the HTML form has drop downs
<mk270> which my version of chrome doesn't support without a bookmarket
<mk270> bookmarklet
<mk270> which i accidentally deleted a few hours ago
<mk270> so i shall need to go and recreate that
<Drup> "but the HTML form has drop downs which my version of chrome doesn't support without a bookmarket" wat
<ggVGc> haha
<ggVGc> eah I was thinking the same
<ggole> Ever had that feeling like your machine hates you and wants you to suffer?
<Drup> mantis is literally billions of years old
<Drup> it's supported by brower who existed before I learned to program
<Drup> how can chrome not support ANYTHING in there ?
<mk270> no, html dropdowns is a weird chrome bug
<mk270> i have never seen anyone else report it
<mk270> it arises from the ability of javascript to disable the location bar
<Drup> but
<mk270> this happens randomly on my browser
<mk270> and disables editing the URL, entering text in the search bar, or enabling any new drop-down element
<Drup> these are forms, there is no javascript in it
<mk270> i KNOW
<Drup> dud
<Drup> dude*
<mk270> but there is a javascript call which enables/disables this functionaliyu
<Drup> your setup is fucked up.
<mk270> and something is calling it
<mk270> my setup is actually fairly normal vanilla ubuntu
<ggole> O_o
<Drup> No, it's clearly not
<Drup> or it's haunted
<Drup> I don't know
<Drup> :D
<mk270> basically, if i run from a bookmarklet "window.open("", "", "location=0")," or something like that, it starts working again
<Drup> I mean, haunted computer is a thing, it's even in pokemon 3rd generation, iirc. :]
SomeDamnBody has quit [Ping timeout: 240 seconds]
ilia has joined #ocaml
<Drup> (prior evidence, scientific sources, all that²)
<reynir> mk270: is it like this? http://superuser.com/questions/324266/
<mk270> reynir: that, or similar
<mk270> thanks
<mk270> it's incredibly irritating
<mk270> and is a real hazard when booking flights/trains etc
def` has joined #ocaml
<Drup> mk270: https://xkcd.com/1172/ :D
freling has quit [Quit: Leaving.]
<mk270> fair enough, but reasonable workflows that have been the same for 20 years shouldn't be broken to help someone advertise the new rent-seeking feature they've been working on as the new default
willy_ has quit [Quit: This computer has gone to sleep]
<Drup> that's just because you don't realize how nice merlin is :3
slash^ has quit [Read error: Connection reset by peer]
AlexRussia has joined #ocaml
<mk270> javascript:window.open("", "_self", "location=yes");
nojb has left #ocaml [#ocaml]
nojb has joined #ocaml
<mk270> that javascript code allows me to use html forms with more than one drop down. no i have no idea what is really wrong
<ilia> Hello, I installed a package from sources, now findlib complains that it cannot find this package
<ilia> what did I miss?
<Drup> how did you installed ?
SkySkimmer has quit [Ping timeout: 246 seconds]
<ilia> ./configure && make && make install
<Drup> what's the package ?
thomasga has quit [Quit: Leaving.]
<ilia> camlp4
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Drup> oh
<Drup> this one is complicated
yomimono has joined #ocaml
<ilia> I see
<dora-molly> problem with merlin :P ?
<Drup> I think it's not using findlib by default and ocamlfind is retro-fitting findlib information when it sees camlp4 is there
SkySkimmer has joined #ocaml
<ilia> it also cannot find other packages: camlp4.extend
<ilia> and camlp4.quotations.o
<Drup> Where does your ocamlfind come from ? distrib packages ?
<ilia> opam install findlib
<Drup> try to reinstall it
SomeDamnBody has joined #ocaml
<ilia> it wants to downgrade some other packages then
dev_ss has joined #ocaml
<Drup> internal solver :(
<Drup> what is your system/distrib ?
Submarine has quit [Quit: Leaving]
<dev_ss> Hi someone is really good with ocamlsdl and could help me ?
<ilia> it works!!
<Drup> =)
<ilia> thanks, Dru
<ilia> Drup*
<rgrinberg> Drup: ash yes, so what about it?
<rgrinberg> Drup: i'm waiting for you to farm the karma on reddit with it
<Drup> it's not reddit
Choups314 has joined #ocaml
<Drup> ahahah
<Drup> It's not ready*
<Drup> well, what do you think of it ? you are the intendend audience, I'm sure you have strong opinions on the question
<dora-molly> dev_ss: just ask your question
<dev_ss> so i have installed opam, sdl, oasis etc ... and when i specify the includesdir in the makefile to the path sdl /home/.opam/lib/sdl i can compile, but when i try to compile from oasis i have an unbound value Sdl
pobivan has quit [Quit: pobivan]
<Drup> remove the +
<Drup> and the Include
<dev_ss> and the makefile who work
<Drup> what does "ocamlfind query sdl" returns ?
<dev_ss> So its : BuildDepends: /home/dev_ss/.opam/4.02.1/lib/sdl/
<Drup> no, It's "BuildDepends: sdl"
<dev_ss> $ ocamlfind query sdl
<dev_ss> /home/dev_ss/.opam/4.02.1/lib/sdl
<Drup> and nothing else
<dev_ss> unbound module sdl, always the same error
<Drup> pastebin the error please
<Drup> you regenerated the oasis stuff ?
<rgrinberg> Drup: it did look pleasnatly familiar :)
matason has joined #ocaml
<Drup> well, the construction is quite different from what you did in your blog post
<dev_ss> yes i do it oasis setup
Anarchos has joined #ocaml
<rgrinberg> Drup: yeah i still don't fully understand all the magic in furl but it looks sexy
<Drup> ahah, no magic
<Drup> only GADTs :D
<mk270> Drup: i have filed a bug with mantis
<Drup> congratuation :D
<Drup> +l
<Drup> rgrinberg: what do you think of the interface ? Do you have opinions on the whole ppx thing ?
<rgrinberg> Drup: :) any sufficiently advanced usage of gadt's is indistinguishable from magic
<dev_ss> always the same error ^^"
<Drup> The main thing that is troubling issue is the issue with the value restriction
<Drup> you can't build "general" urls with the combinators
<Drup> either you have to wrap it in a function (that's what I show in the tutorial) but it's crappy, or you build with the constructor, but it's horrible
<rgrinberg> Drup: what ppx thing?
<dora-molly> Drup: where may I find this?
<Drup> or I could create a ppx that act like format and builds with constructors for you
<Drup> dora-molly: https://github.com/Drup/furl
<dora-molly> thx
pyon has quit [Quit: I have irrefutable proof that D < 0. It follows trivially from 2D > 3D, which is obviously true.]
<rgrinberg> oh i mean it would be cool but IMO it's quite usable without it
<Drup> it's a bit clumsy
<Drup> because of the value restriction
<Drup> if you write "let url = Furl.(finalize @@ camlidae/"name"/%String/?Nil)"
<Drup> you can't use it both for client and server
<Drup> (hence, you can't expose it as a library)
<Drup> which sucks
<Drup> you need to wrap it in a function
<rgrinberg> such is life
<rgrinberg> i want to understand the re voodoo
<Drup> rgrinberg: read the source code, it's documented
<Drup> (and yes, that part is really voodoo ...)
<Drup> the rest of the library took me a night to write, this part took me the rest of the week =')
<rgrinberg> so this needs your marked stuff eh?
<Drup> yes
<rgrinberg> did you ask vouillon about it?
<Drup> well, to be more precise
<Drup> I asked him
<Drup> he said "well, you can do that"
<Drup> I wrote it
<Drup> it was wrong and buggy
<Drup> and he told me where to change stuff and look over my shoulder to make sure what I wrote was not too crappy.
<Drup> so, yes, He's aware of it :D
Intensity has quit [Ping timeout: 244 seconds]
ggole has quit []
<Drup> (the internal code of re's automaton is .... not easy to get in)
<mk270> ok
<mk270> i am trying to use the emacs merlin integration
<mk270> and it complains
<mk270> Command (reset name /home/mk270/Src/obp_sales/royalty/royalty.ml) failed with error invalid arguments
Intensity has joined #ocaml
<Drup> dev_ss: I'm sorry, I don't really know :/
<rgrinberg> Drup: oh ok, so is there a problem with your PR or he'll merge it eventually?
<Drup> can you show the last version of your oasis file ?
<Drup> I guess he'll merge
<Drup> he just didn't took the time to review
s1n4 has quit [Quit: leaving]
<Drup> rgrinberg: I expect your participation for https://github.com/Drup/furl/issues/5 :D
<dora-molly> mk270: merlin binary is not maching emacs script version
<dora-molly> matching*
<mk270> dora: thanks
<mk270> it whinged about an out-of-date elisp file
<mk270> let me look into that
manizzle has joined #ocaml
larhat has joined #ocaml
<mk270> i removed the old elisp file
<mk270> and now everything works
<mk270> thank you all!
<dora-molly> good
<rgrinberg> Drup: no eliom integration of sorts?
<mk270> and i have filed a bug against ocaml for the corrupted .annot file
larhat has quit [Client Quit]
<Drup> rgrinberg: not at first
SomeDamnBody has quit [Ping timeout: 255 seconds]
<Drup> eliom integration would need more work
<rgrinberg> hmm so it compiles the whole re on every match?
<Drup> of course not
<rgrinberg> but nvm
<Drup> rgrinberg: notice how the uri argument is *after* ;)
<rgrinberg> yep
larhat has joined #ocaml
<Drup> I took care of doing as much stuff as possible before matching against the uri
<Drup> it's still doing stuff after, but as little as I could
<rgrinberg> aargh, it would be nice if it worked on raw strings
<rgrinberg> not just Uri.t
<Drup> oh, it's better ?
<Drup> I mean, it's not difficult
<rgrinberg> the hypothetical performance...
<Drup> I'm extracting the strings from a Uri.t anyway ...
<rgrinberg> if ocaml-re worked on bigstrings you could just run this directly on the request buffer
<rgrinberg> and return a 404 without any parsing/copying
<Drup> yeah
<Drup> but we need some work with uri to makes that happen too
<Drup> because, let's be honest, I butched the job on uri handling
<rgrinberg> Drup: well we want to avoid using uri at all actually
<rgrinberg> in fact that's one of the flaws in cohttp, it builds up a Uri.t needlessly on every request
<Drup> Actually, we want to use uri as much as possible
<Drup> just the non exposed part
<Drup> the part that defines all the corect separators and regexps.
<Drup> currently, it's well hidden inside uri
<Drup> There is still a big issue, it's the query handling
<Drup> the current hack is to sort the query by name
<rgrinberg> Drup: i think we might be in agreement. all i'm saying is Uri.t shouldn't be constructed unless the user needs it directly
<Drup> to allow using re.
mengu__ has joined #ocaml
<Drup> ideally, I should ... not use Re at all for that, and build a proper decision tree
<Drup> building a proper decision tree would also be easier to extend to other things, such as post parameters, header parameters, http verb, all that
<Drup> (but it's more complicated to do, so I choose the hacky way first)
<rgrinberg> Drup: wait, what do you mean by "query"?
<Drup> the query part of the url
<rgrinberg> so furl handles query string?
<Drup> sure
<Drup> see the tutorial
<Drup> let by_humps () =
<Drup> Furl.(finalize @@ camlidae/"humps"/%Int/?("extinct",Opt Bool)**Nil)
<rgrinberg> ah yes
<rgrinberg> from the server perspective i'm actually not convinced that matching like this is such a good idea
<rgrinberg> because query params should be optional by convention
<Drup> what's the issue with that ?
<rgrinberg> there's no issue, i just think it's bad to write server handlers that expect a query param to always be present
<rgrinberg> it's a philosophical objection
<rgrinberg> it's very useful for constructing a client though
Hannibal_Smith has joined #ocaml
<Drup> rgrinberg: but furl handles optional query parameters
<Drup> and you can always define a route as base, without query parameters
<Drup> when I say: ("extinct",Opt Bool)
<Drup> extinct can, or not, be present, and if it's present, it should be a boolean
Denommus has quit [Quit: going home]
<Drup> your point is more a matter of how you should use furl, but not really what furl capabilities should be
<Drup> I think.
<rgrinberg> yes, exactly
<rgrinberg> anyway, excited to try this out with cohttp
<rgrinberg> i'm adding spaces around my operators though
<Drup> :D
pyon has joined #ocaml
<Drup> I can understand that :3
<Drup> I'm still very unhappy about the whole value restriction thing
<rgrinberg> at least you know there's nothing that can really be done about it
<rgrinberg> apart from ppx i guess
<Drup> No, I know that *I* haven't figured out a work around
<Drup> that's rather different :p
dev_ss has quit [Ping timeout: 256 seconds]
<dora-molly> Drup: what's the purpose of all the type parameters?
asQuirreL has joined #ocaml
<Drup> so, there is a system that I haven't documetented yet, that I call "converter"
<Drup> where, you can provide a converter to and from one of them parameter
<Drup> to encode a more complex datastructure, basically
<Drup> so, in ('f,'r,c,'rc) path/query/url
<Drup> f is the function
<Drup> r is the return type of f
<Drup> c is the list of the convereters
<Drup> rc is the result type of that
<Drup> is that clear ?
<dora-molly> f and r yes, I am not sure what you mean by list of converters
<dora-molly> just as many arrows as there are converters finally returning rc ?
<Drup> yes
<Drup> with the appropriate types
<dora-molly> ok :)
<Drup> this way, you can provide all the convereters first
<Drup> get something out (what I call a "finalized" url)
<Drup> (and then hide 'rc and 'c behind existential, since the user don't need to see them anymore)
<Drup> dora-molly: ideally, the type I would like is ∀r. (a1 -> a2 -> ... -> r) t
<Drup> which ensure proper generalization
<Drup> unfortunatly, it's not expressible, because arbitrary number of arguments :(
<dora-molly> yep
<Drup> if you have ideas, I'm all hear
<dora-molly> you could still encode forall r. (a1 * (a2 * (a3 * …))) -> r
<Drup> I'm aware of that
<dora-molly> and you only want generalization on r, not on a1, a2, a3… ?
<Drup> but the UI for that is terrible
<Drup> yes
rand000 has quit [Quit: leaving]
<Drup> encoding the list of argument as tuple means the user is exposed to the nested tuples
<Drup> and that's horrible
<dora-molly> I agree
<dora-molly> r is in a covariant position, there is still some hope to get generalization
<Drup> unfortunatly
<Drup> it is not
<Drup> because of the base case: "Ret : ('r, 'r) t"
<Drup> which makes it invariant
<rgrinberg> dora-molly: def-lkb?
<Drup> yes
matason has quit []
<dora-molly> :D
<Drup> =')
w0rp has joined #ocaml
<Drup> I was going to say "A guy offering technical help on merlin and doing type-wizardery on irc with a name starting in d, totally incognito"
<Drup> but then I realized there was another one =')
<Drup> (far less technical on merlin, though)
w0rp has quit [Client Quit]
<rgrinberg> i just saw some merlin activity on github
<rgrinberg> from a new profile picture...
<dora-molly> I find it soooo cool \o/
w0rp has joined #ocaml
Choups314 has quit [Ping timeout: 264 seconds]
Haudegen has quit [Ping timeout: 256 seconds]
w0rp has quit [Quit: GONE]
w0rp has joined #ocaml
n3ss3s has quit [Ping timeout: 264 seconds]
SomeDamnBody has joined #ocaml
w0rp has quit [Quit: GONE]
bobry has joined #ocaml
struktured has joined #ocaml
n3ss3s has joined #ocaml
w0rp has joined #ocaml
Haudegen has joined #ocaml
Gama11 has quit [Read error: Connection reset by peer]
tani has quit [Quit: Verlassend]
Guest26 has joined #ocaml
Guest26 has left #ocaml ["Textual IRC Client: www.textualapp.com"]
Choups314 has joined #ocaml
osa1 has quit [Ping timeout: 272 seconds]
larhat has quit [Quit: Leaving.]
Choups314 has quit [Quit: Leaving]
osa1 has joined #ocaml
SkySkimmer has quit [Quit: Leaving]
mengu__ has quit []
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
matason has joined #ocaml
n3ss3s has quit [Ping timeout: 272 seconds]
bobfang has joined #ocaml
bobfang has quit [Client Quit]
bobfang has joined #ocaml
<bobfang> hi anyone using js_of_ocaml?
<Drup> rgrinberg: btw, if you have ideas for the tutorial, especially one that would involve converters :D
<bobfang> thanks
<Drup> bobfang: the right way is to use http://ocsigen.org/js_of_ocaml/2.5/api/Lwt_js_events
<Drup> Lwt_js_events.clicks my_element (fun event _ -> do_something ())
<bobfang> cool
<Drup> and do_something returns unit Lwt.t
ilia has quit [Quit: Leaving]
<Drup> give me a sec, I'll answer properly
<bobfang> so a minimal button hanlder would look like
<bobfang> let _ = Lwt_js_events.clicks button
<bobfang> (fun _ev _ -> Lwt.return())
<bobfang> right?
<Drup> yes
<rgrinberg> Drup: a client tutorial would be nice. Quite a lot of people aren't sure how to get started with that
<bobfang> js_of_ocaml? yeah the examples are quite hard to understand for me at least
<rgrinberg> Having a hard time thinking of a good example for a converter in a client though. Since you really just need 1 way conversion...
javamonn has joined #ocaml
<Drup> rgrinberg: any concrete proposition to write a client for ?
<Drup> And doesn't matter, Converters are always bi-directional anyway. I don't give you the choice about it.
<rgrinberg> reddit's api is pretty simple
<Drup> nothing more OCaml centric ? :D
<Drup> yeah, but that's really not interesting, no parameters ?
<rgrinberg> subreddit is a parameter
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
ljs has quit [Quit: Be back later ...]
ljs has joined #ocaml
<Drup> yeah, but that's not very interesting
AlexRussia has quit [Ping timeout: 252 seconds]
nullcat__ has quit [Ping timeout: 252 seconds]
<rgrinberg> Drup: there's only so much complexity in url construction :)
<rgrinberg> but anyway, worldbank has a pretty rich url structure
<rgrinberg> IIRC
ljs has quit [Client Quit]
nullcat has joined #ocaml
<Drup> ah, that's more interesting
ljs has joined #ocaml
<bobfang> hi when keep getting this error
<bobfang> Uncaught 248,Not_found,-7hg @ toplevel.js:1933(anonymous function) @ toplevel.js:1956(anonymous function) @ toplevel.js:1957
<bobfang> any idea why?
<bobfang> here is my code
<bobfang> let () =
<bobfang> let program_submit = Dom_html.getElementById "program-submit" in
<bobfang> let _ = Lwt_js_events.clicks program_submit
<bobfang> (fun _ev _ -> Lwt.return())
<bobfang> in ()
<Drup> how did you linked ?
<Drup> well, compiled
matason has quit []
<bobfang> all:
<bobfang> ocamlbuild -use-ocamlfind -plugin-tag 'package(js_of_ocaml.ocamlbuild)' \
<bobfang> -pkg core -tag thread \
<bobfang> toplevel.js
<bobfang> .PHONY: clean
<bobfang> clean:
<bobfang> rm -rf _build
<Drup> why are you linking the toplevel ?
<Drup> err
<Drup> core
<Drup> not gonna happen, sorry
<bobfang> oh I am not using core
javamonn has quit [Remote host closed the connection]
<bobfang> I just forgot to delete it
<bobfang> that line is not used
<Drup> do you have _tags file ?
<bobfang> yep
<bobfang> true: -traverse
<bobfang> "parser" : include
<bobfang> <*.{ml,mli,byte}>: syntax(camlp4o), package(js_of_ocaml), package(js_of_ocaml.syntax)
<Drup> the error still shows up without core ?
<bobfang> yep
<bobfang> its this line
<bobfang> b=f1.getElementById(a.toString());if(b==aN)throw T;return b}b([d,f3,0]);fZ(aM.HTMLElement)===cr;var
ljs has quit [Ping timeout: 264 seconds]
<Drup> yes, it doesn't found your element
<bobfang> and if I print out f1, it is a document with no body
<bobfang> it is a html document without body in it
<Drup> I guess you are loading the javascript before the html is there
<bobfang> yeah that's my guess too
<bobfang> do you know how to stop that?
<Drup> the simple solution is either to move the script element in your html to put it later
<bobfang> cool
<bobfang> let me try
<Drup> or to wait in your javascript for Lwt_js_events.onload
<bobfang> cool worked
<bobfang> thanks :)
<bobfang> by the way
<bobfang> the logger
<bobfang> provided by js_of_ocaml
<bobfang> seems not working
<Drup> the logger ?
igitoor has quit [Ping timeout: 252 seconds]
<Drup> which browser ?
<bobfang> chrome
<Drup> that's weird
<Drup> it doesn't show anything in the console ?
javamonn has joined #ocaml
<bobfang> wait a sec let me try again I remember its something about compiling
igitoor has joined #ocaml
<Drup> if you don't link js_of_ocaml.log, it's surely not going to work.
<bobfang> Error: Error while linking toplevel.cmo:
<bobfang> Reference to undefined global `Lwt_log_js'
<bobfang> Command exited with code 2.
<bobfang> so should I add that in the _tags file?
<Drup> well, yeah ...
<bobfang> if I add that
<bobfang> I got this error
<bobfang> + js_of_ocaml --no-runtime +js_of_ocaml/runtime.js -o toplevel.js toplevel.byte
<bobfang> There are some missing primitives
<bobfang> Dummy implementations (raising 'Failure' exception) will be used if they are not available at runtime.
<bobfang> You can prevent the generation of dummy implementations with the commandline option '-disable genprim'
<bobfang> Missing primitives provided by +weak.js:
<bobfang> caml_weak_blit
<bobfang> caml_weak_check
<bobfang> caml_weak_create
<bobfang> caml_weak_get
<bobfang> caml_weak_get_copy
<bobfang> caml_weak_set
<bobfang> Missing primitives:
<bobfang> Finished, 32 targets (16 cached) in 00:00:02.
<Drup> please use pastebin for messages of more than 3 linse.
<Drup> lines*
<bobfang> sorry
igitoor has joined #ocaml
igitoor has quit [Changing host]
<bobfang> I guess I need to pass +weak.js to js_of_ocaml
<bobfang> in some way
<bobfang> but I am not sure how
<bobfang> since I am using ocamlbuild
<Drup> just link js_of_ocaml.weak
<Drup> but it's weird, it should not happen
nullcat has quit [Ping timeout: 246 seconds]
madroach has quit [Ping timeout: 264 seconds]
nojb has quit [Quit: nojb]
nullcat_ has joined #ocaml
<Drup> does it works ?
<bobfang> nah even I added package(js_of_ocaml.weak),package(js_of_ocaml.log) to my _tags I still got that error
madroach has joined #ocaml
<bobfang> saying something is not implemented
<Drup> which versions of ocaml/ocamlbuild/js_of_ocaml ?
<bobfang> js_of_ocaml is 2.5
<bobfang> oocamlbuild 4.02.1
<bobfang> ocamlbuild 4.02.1
<bobfang> The OCaml toplevel, version 4.02.1
<Drup> that is very strange, let me try to reproduce.
<bobfang> thanks
NoNNaN has quit [Remote host closed the connection]
Kakadu has quit [Remote host closed the connection]
lobo has quit [Quit: leaving]
<Drup> I can't with a trivial test case
javamonn has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
nullcat_ has quit [Ping timeout: 255 seconds]
nullcat has joined #ocaml
<bobfang> nevermind I don't think the logger is essential for me
<Drup> well, it's still weird
<Drup> rgrinberg: thanks for the link to the work bank, it can actually showcase almost all of furl's features, so I'll use it
<Drup> world*
<bobfang> I read something before, they say they have some fake stub for these functions in js_of_ocaml
<bobfang> but I am not sure why it is not working for me
<Drup> no but, you don't need fake stubs
<Drup> js_of_ocaml did that for you already
<Drup> and It works on my box
<bobfang> cool I will have a look later, I am prototyping something so I think I need the basic functions done first
<Drup> ah !
<Drup> I found the issue
<Drup> put the tags on .js too ...
<bobfang> ?
<bobfang> let me try
<Drup> well, really, put the packages tag on "true" ...
<Drup> no need to be picky
swgillespie has joined #ocaml
<bobfang> okay it compiles
<bobfang> but when I have
<bobfang> Lwt_log_js.fatal "I am Bob";
<bobfang> it does not print anything to console
<bobfang> this is my code for now
<Drup> hum, I don't know
<bobfang> cool thanks
<bobfang> dont worry
<bobfang> can I ask another question?