ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Logs at http://irclog.whitequark.org/ocaml
WraithM has joined #ocaml
hhugo has quit [Quit: Leaving.]
hhugo has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
penglingbo has quit [Ping timeout: 260 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
WraithM has quit [Ping timeout: 272 seconds]
eikke__ has quit [Ping timeout: 245 seconds]
thomasga has quit [Quit: Leaving.]
sheijk_ has quit [Quit: n8]
fold has joined #ocaml
zpe has joined #ocaml
hhugo has quit [Quit: Leaving.]
zpe has quit [Ping timeout: 264 seconds]
penglingbo has joined #ocaml
caseyjames_ has joined #ocaml
q66 has quit [Quit: Leaving]
WraithM has joined #ocaml
keen____ has joined #ocaml
keen___ has quit [Ping timeout: 240 seconds]
<caseyjames_> HI I'm using emacs 24.4.5 and I'm finding ml text to be black on white bg with no colorization. I can M-x global-fontlock four times. It disables, enable colorizing the visible area of the buffer, disable and the fourth colorizes all of the code. Any ideas?
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
WraithM has quit [Ping timeout: 255 seconds]
pyon has quit [Quit: WeeChat 0.4.3]
alinab has quit [Remote host closed the connection]
alinab has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
shinnya has joined #ocaml
englishm has joined #ocaml
pyon has joined #ocaml
ygrek has joined #ocaml
zpe has joined #ocaml
pyon has quit [Client Quit]
pyon has joined #ocaml
araujo has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 260 seconds]
zpe has quit [Ping timeout: 255 seconds]
shinnya has joined #ocaml
tnguyen has joined #ocaml
tnguyen has quit [Client Quit]
deavid has quit [Ping timeout: 255 seconds]
deavid has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
jao has quit [Ping timeout: 272 seconds]
lostman_ is now known as lostman
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
WraithM has joined #ocaml
Algebr` has joined #ocaml
<Algebr`> I'm having trouble understanding behavior of ocamllex. I have a .ml called terminals. in terminals, I have multiple algebraic data types defined, in my .mll I have a rule which is using type foos in its actions initially, but as soon as it hits type bar, I get and error saying constructor x expected of type foos but got bar. Does this mean that you can only use one algebraic data type for the entire pattern match?
<whitequark> that's unrelated to ocamllex
<whitequark> a function can have only a single return type
<whitequark> so it must return either values of type foo or of type bar
<Algebr`> I see, so the solution is to define another entry point rule
<Algebr`> for the bars
<whitequark> that's one way to do it
<Algebr`> are you implying I'm doing something wrong?
<whitequark> well, you usually only have a single ADT in the lexer
<whitequark> "token" or something
<Algebr`> wouldn't it make sense to have multiple? like type operator, type keyword?
<Algebr`> or does that not really add much value at this stage/
<whitequark> not really
<whitequark> at any stage
<Algebr`> y?
<orbitz> Algebr`: how would you construct an ast then?
izaak has quit [Ping timeout: 272 seconds]
<Algebr`> ah...
zpe has joined #ocaml
Algebr` has quit [Ping timeout: 245 seconds]
Algebr has quit [Ping timeout: 256 seconds]
zpe has quit [Ping timeout: 255 seconds]
axiles has joined #ocaml
badon has joined #ocaml
ggole has joined #ocaml
Hannibal_Smith has joined #ocaml
pyon has quit [Quit: WeeChat 0.4.3]
Simn has joined #ocaml
pyon has joined #ocaml
miko has joined #ocaml
pyon has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
BitPuffin has joined #ocaml
arj has joined #ocaml
englishm has quit [Remote host closed the connection]
englishm has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
fraggle_laptop has joined #ocaml
testcocoon has joined #ocaml
BitPuffin has quit [Ping timeout: 264 seconds]
WraithM has quit [Ping timeout: 245 seconds]
_0xAX has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
morphles has joined #ocaml
BitPuffin has joined #ocaml
Kakadu has joined #ocaml
rand000 has joined #ocaml
BitPuffin has quit [Ping timeout: 255 seconds]
q66 has joined #ocaml
AltGr has joined #ocaml
angerman has joined #ocaml
eikke__ has joined #ocaml
pyon has joined #ocaml
studybot has quit [Remote host closed the connection]
studybot has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
sagotch has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
ocp has joined #ocaml
pminten has joined #ocaml
madroach has quit [Quit: leaving]
madroach has joined #ocaml
hhugo has joined #ocaml
penglingbo has quit [Ping timeout: 250 seconds]
<morphles> So as ocaml has no type classes there is no easy way to write big int operations as plain operations?
<Drup> morphles: you have local open
<Kakadu> you can open a module to hide previous opeartions and use bigint-related ones
<Drup> (work perfectly fine with zarith, for exemple)
jonludlam has joined #ocaml
penglingbo has joined #ocaml
zpe has joined #ocaml
<Drup> <3
Anarchos has joined #ocaml
mal`` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
fraggle_ has quit [Remote host closed the connection]
mal`` has joined #ocaml
dsheets has joined #ocaml
ygrek has joined #ocaml
thomasga has joined #ocaml
fraggle_ has joined #ocaml
<morphles> I'm having trouble with linking what should be the command line to link against Big_int, I'm getting no impelemenations for module, or with some other commands moduel big_int not found
<morphles> I mean to compile
<morphles> Before using big int I just compiled using "ocamlopt file"
<morphles> Searching seems to suggest that ocamlfind should be used, but I did not manage to make it work
<Drup> ocamlfind ocamlopt -package num
<Drup> (plus the usual stuff after that)
<Kakadu> and maybe -linkpkg
jonludlam has quit [Ping timeout: 250 seconds]
<morphles> Tried those do not help
<Drup> you will have to provide more details than that :p
<morphles> "ocamlfind ocamlopt -package num %" (% is just from vim, curren file)
<morphles> No implementations provided for the following modules: Big_int referenced from fib.cmx
<morphles> hm
<morphles> this time linkpkg solved
<morphles> solved the issue
<morphles> why is big_int package name num when linking/
<morphles> ?
<Drup> because Big_int is not a pacakge, it's a module
<morphles> Ah
<morphles> Thanks
<morphles> Though I still have not found how to use regular operators for big ints
<Drup> I don't think they are implemented in the num library
<Drup> but, to be honest, don't use it
<Drup> use zarith
<Drup> it's better in every way
<morphles> ok
Submarine has joined #ocaml
<whitequark> Drup: so the last thing I need before 0.2 now is some minor refactoring
<whitequark> which will also enable [%deriving.Foo: ] syntax
<Drup> I suggest you allow a shorter syntax too
<whitequark> [%derive.Foo:] rather
<Drup> eventually with a command line option to disable it
<whitequark> is this too long?
<whitequark> in my experience it is just fine
rand000 has quit [Quit: leaving]
<whitequark> List.sort [%derive.Ord: int * string]
jonludlam has joined #ocaml
<Drup> maybe it is, I don't know
maufred has quit [Remote host closed the connection]
ggole_ has joined #ocaml
maufred has joined #ocaml
ggole has quit [Ping timeout: 245 seconds]
maattdd has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
ggole_ is now known as ggole
hhugo has quit [Quit: Leaving.]
hhugo has joined #ocaml
maattdd has quit [Ping timeout: 264 seconds]
sagotch has quit [Ping timeout: 250 seconds]
dsheets has quit [Ping timeout: 240 seconds]
<troydm> how can I use camlp4 with obuild?
<troydm> I have a file that should be processed with camlp4 prior to compiling
<troydm> I'm not too familiar with camlp4
<morphles> Say I install package using opam (zarith), can I somehow view its documentation using opam or similar?
jonludlam has quit [Ping timeout: 260 seconds]
thomasga has quit [Quit: Leaving.]
<Kakadu> You can browse its API with ocamlbrowser/qocamlbrowser
<Kakadu> How to browser doc I want to know answer too
<Kakadu> There is opam-doc project
<Kakadu> but I don't know how good it is
dsheets has joined #ocaml
jonludlam has joined #ocaml
penglingbo has quit [Ping timeout: 240 seconds]
thomasga has joined #ocaml
BitPuffin has joined #ocaml
<Armael> Drup: yes it is
<Armael> (in the meantime I realized that I forgot bits of the patch in the PR)
<Armael> (maybe i should recreate it)
<Armael> (because you cannot push --force on mercurial, so I cannot easily correct my PR)
<Armael> (at least that's what I understood
<Armael> when asking on #mercurial)
<morphles> It seems that if I open zarith, I can no longer use simple operators for regular ints, what would be solution to that?
pyon has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
<Armael> about patching camlimages in opam: the extra patches you would want would be, I think:
<Armael> - the patch for giflib compat
<Armael> - removing -Werror
<Armael> the thing is, these patchs (the first at least) apply to the current HEAD
<Drup> morphles: don't use open, do it like that : Q.(5//3 + ~$7)
<Armael> not the opam release
<Armael> so should we also change the source of the opam package to point to the current HEAD?
<Armael> (and hm I didn't find how to have a tar.gz for a particular revision on bitbucket)
<Armael> i mean, that sounds like a hold up
<Leonidas> I think pointing to git packages is discouraged
<Leonidas> doesn't the patch apply to the opam release?
<Armael> yes, I was thinking pointing to some precise revision
<Armael> which would happen to be the last, at the time we're speaking
<Armael> hmm I don't know
<Armael> plus between the release and the HEAD some compilation related patch have occured
<Armael> patches
<Armael> so you'd want to add them too
<Drup> Armael: you just want a new release :)
<Armael> and my patches merged
<Armael> yes
<Armael> now let's think of an other solution
<Armael> : d
<Leonidas> maybe you could just ping camlspotter?
<Armael> well, I made a PR
<Armael> like 2 months ago
<Leonidas> maybe contact him on twitter, he is kinda reading that.
<Armael> erf.
<Armael> ok maybe
<Armael> I will recreate my PR first
<morphles> Drup: thanks, nice
_andre has joined #ocaml
<Armael> wow, on bitbucket you cannot close/remove a PR you have made.
<Armael> aswose
<Armael> awesome.
pyon has joined #ocaml
<whitequark> Drup: # print_endline ([%derive.Show: int*string] (1,"hi"));;
<whitequark> (1, "hi")
morphles has quit [Ping timeout: 250 seconds]
morphles has joined #ocaml
pminten has quit [Remote host closed the connection]
englishm has quit [Read error: Connection reset by peer]
englishm has joined #ocaml
englishm has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 260 seconds]
<Armael> Leonidas: what do you think I should say to camlspotter on twitter?
<Armael> i'm not really familiar with twitter so erm..
maattdd has joined #ocaml
<Leonidas> Armael: you can ask him to apply the patches and make a release, so opam users can use it with 4.02
<Leonidas> I think adding a 'please' somewhere would be sensible, too :)
<Leonidas> or maybe write hin an email, explaining the situation or something.
<whitequark> Drup: FINALLY, I released ppx_deriving 0.2
<whitequark> so I can get to whatever I was doing when I got distracted by all this
fold has quit [Ping timeout: 260 seconds]
<whitequark> .. what was that, again
englishm has joined #ocaml
sad0ur has quit [Read error: Connection reset by peer]
sad0ur has joined #ocaml
dsheets has joined #ocaml
maattdd has quit [Ping timeout: 264 seconds]
<Armael> hmm so in the meantime, if anybody wants to test my giflib 5 patch
<Armael> tests are welcome.
penglingbo has joined #ocaml
<Unhammer> if I have .cmt files, should merlin be able to locate the source definition of opam stuff?
<Unhammer> did
<Unhammer> $ export OPAMKEEPBUILDDIR=true
<Unhammer> $ export OCAMLPARAM="_,bin-annot=1"
<Unhammer> and reinstalled pcre-ocaml
<Unhammer> $ find .opam/ -name pcre.cmt
<Unhammer> .opam/system/build/pcre-ocaml.7.1.1/_build/lib/pcre.cmt
<Unhammer> but merlin-locate says e.g. "Pcre.extract_all not found."
<ggole> You need to tell it where to find the .cmt with an entry in .merlin
<Unhammer> like
<Unhammer> B /home/me/.opam/system/build/pcre-ocaml.7.1.1/_build
<Unhammer> ? (did a merlin-restart-process but no luck)
<ggole> B /home/me/.opam/system/build/pcre-ocaml.7.1.1/_build/lib/, I think
thomasga has quit [Quit: Leaving.]
<Unhammer> tried that too, didn't work :(
morphles has quit [Ping timeout: 264 seconds]
<def`> ping rks`
<Unhammer> $ grep extract_all /home/me/.opam/system/build/pcre-ocaml.7.1.1/_build/lib/pcre.cmi
<Unhammer> Binary file /home/me/.opam/system/build/pcre-ocaml.7.1.1/_build/lib/pcre.cmi matches
dsheets has quit [Ping timeout: 272 seconds]
<ggole> Hmm.
dsheets has joined #ocaml
<Drup> whitequark: :p
<ggole> Does locate work for local files?
<Unhammer> yeah
<Unhammer> well, within my one-file project :)
<Drup> whitequark: I'm wondering if you should write something to help transition from typeconv/deriving
englishm1 has joined #ocaml
<Drup> (I'm not sure which form it would take)
<ggole> It's cross-file locate that is the sticking point, really
<Drup> vbmithr_: as a type-conv user, can you tell if ppx_deriving covers your usage (and what is it missing if not) ?
thomasga has joined #ocaml
maattdd has joined #ocaml
girrig_ has quit [Ping timeout: 240 seconds]
darkf has quit [Quit: Leaving]
<Drup> AltGr: :3
girrig has joined #ocaml
<AltGr> :)
<Drup> AltGr: do you have time to work on libIndex a bit currently ?
<Drup> documentation printing (from cmt file) is quite horrible currently
<Unhammer> ggole, it works with several files in the same local dir
<Drup> (you can see it by browsing React)
<AltGr> once opam 1.2 is released, I may find a little time
<ggole> Unhammer: hmm, perhaps the .merlin is missing something else
<Drup> nice
<Unhammer> it does have "PKG pcre" at least
<ggole> I forget whether merlin needs a source directory to be visible to jump to it, might be worth trying that
sagotch has joined #ocaml
<AltGr> it's just the raw comments at the moment
<ggole> Will it complete identifiers from that package?
<Drup> AltGr: wrt ocp-lambda, there are also various bikeshedding questions, like "should I put background on the selected item" or "should I put only a line instead of a complete frame" and so on :p
morphles has joined #ocaml
<Unhammer> adding that line with S instead of B didn't help either
girrig has quit [Ping timeout: 260 seconds]
<Unhammer> ggole, or what did you mean by "visible"?
<ggole> Entered into .merlin
<Unhammer> ok, yeah I've got it both as S and B
<Unhammer> (it offered completions with only "PKG pcre")
<ggole> Um.
<ggole> :(
<ggole> Unhammer: ok, installed pcre-ocaml and I get completions but not locate.
<ggole> If I figure it out I'll let you know.
bjorkintosh has quit [Ping timeout: 264 seconds]
<ggole> ...locate works fine for me
<ggole> B /home/ggole/.opam/4.02.0+trunk/build/pcre-ocaml.7.1.1/_build/lib/
<ggole> And S too
<ggole> However, I'm using the merlin2 branch
girrig has joined #ocaml
tane has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
<Unhammer> oh, you got it to work?
parcs has quit [Read error: Connection reset by peer]
<Unhammer> maybe I should just wait for merlin2 then
rz has joined #ocaml
<ggole> Yeah
<ggole> Ideally just PKG foo would do the job...
<ggole> Not sure if opam exposes enough info to make that easy.
bjorkintosh has joined #ocaml
<Unhammer> that would sure be nice :)
bjorkintosh has quit [Excess Flood]
englishm2 has joined #ocaml
dsheets has joined #ocaml
bjorkintosh has joined #ocaml
englishm1 has quit [Ping timeout: 250 seconds]
englishm has quit [Ping timeout: 255 seconds]
bjorkintosh has quit [Ping timeout: 245 seconds]
parcs has joined #ocaml
englishm has joined #ocaml
shinnya has joined #ocaml
penglingbo has quit [Quit: Leaving]
maattdd has quit [Ping timeout: 250 seconds]
araujo has joined #ocaml
bjorkintosh has joined #ocaml
morphles has quit [Ping timeout: 255 seconds]
ygrek has quit [Ping timeout: 260 seconds]
angerman has quit [Quit: Bye]
ygrek has joined #ocaml
leowzukw has joined #ocaml
ocp has quit [Quit: Leaving.]
_0xAX has quit [Remote host closed the connection]
sagotch has quit [Remote host closed the connection]
Algebr has joined #ocaml
Submarine has quit [Remote host closed the connection]
eikke__ has quit [Ping timeout: 245 seconds]
BitPuffin has quit [Ping timeout: 255 seconds]
caseyjames_ has quit [Ping timeout: 246 seconds]
caseyjames has quit [Ping timeout: 246 seconds]
maattdd has joined #ocaml
BitPuffin has joined #ocaml
angerman has joined #ocaml
angerman has left #ocaml [#ocaml]
tobiasBora has joined #ocaml
<Algebr> I'm confused about the relationship between ocamllex and menhir/ocamlyacc. I've seen lots of examples of .mlls where there are references to a .mly, which to me sounds backwards? I've also seen people write something akin to an ast.ml, which just has one or two ADT defined. And that further confuses me because in the .mly, you could do %token <char> OPER, or in the ast, write type operator = Add of char | Minus of char
<ggole> The token type is often defined in the .mly, and a scanner for those tokens implemented in the .mll
pminten has joined #ocaml
<ggole> An Ast module will usually be whatever it is that you want the parser to produce.
leowzukw has quit [Quit: leaving]
<Algebr> how is 1) not backwards? the scanner has to reference the parser?
<flux> maybe they want to define the 'meat' in a single file, so .mly
fold has joined #ocaml
<ggole> The scanner references whatever token type you like.
<Algebr> So ast needs to be stuff like expressions and statements?
<ggole> It's the parsed result.
<ggole> Design that however you like: usually it's a tree of some kind
<ggole> There are other possible designs: some compilers construct SSA during parsing, for example.
caseyjames has joined #ocaml
<Drup> SSA directly during parsing ? that sounds adventurous :O
eikke__ has joined #ocaml
<Armael> well
<Armael> you can do assembly generation during parsing
tane has quit [Quit: Verlassend]
<Algebr> What is SSA?
<caseyjames> Hi, I finally got syntax coloring going. Does anyone know how I can set a dark emacs theme for tuareg mode?
ygrek has quit [Ping timeout: 256 seconds]
<ggole> Drup: one of Click's papers describes the algorithm, I can't remember the name of the top of my head
<Drup> a form of IR with nice properties
<Drup> ggole: on what source ?
<ggole> A standard C-like language IIRC
<ggole> Maybe it was Java?
<Drup> (also, it ties your put into SSA form with the syntax, which I don't like, but that's another issue)
englishm has quit [Remote host closed the connection]
englishm2 has quit [Quit: Leaving.]
englishm has joined #ocaml
<ggole> It's mostly about speed
<ggole> Click was working on JIT compilers like Hotspot
<Drup> huuum, ok
englishm_ has joined #ocaml
<Drup> caseyjames: It should work out of the box, if you use a dark emacs theme
morphles has joined #ocaml
<caseyjames> Drup: thanks. I just figure out the regular way to switch the theme
<dmbaturin> I need a new idea for ocaml excerices. Does generating a random string from a context-free language sound good?
pminten has quit [Read error: Connection reset by peer]
maattdd has quit [Ping timeout: 250 seconds]
zpe has quit [Remote host closed the connection]
Kakadu has quit [Ping timeout: 246 seconds]
<Algebr> Say you are outputting C code for a compiler, do you basically just keep adding code to one big lexbuf?
<Drup> lexbug is not for outputing stuff
englishm_ has quit [Remote host closed the connection]
englishm has quit [Quit: Leaving.]
englishm has joined #ocaml
caseyjames has quit [Quit: Page closed]
yacks has quit [Quit: Leaving]
<ggole> Algebr: stick it in a Buffer.t or put it in a file
<ggole> The former can be a bit more convenient for testing.
<ggole> And it is just as convenient, as printf has support for Buffer.
<Algebr> ah, thanks
Hannibal_Smith has joined #ocaml
yacks has joined #ocaml
jwatzman|work has joined #ocaml
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
mort___ has joined #ocaml
AltGr has left #ocaml [#ocaml]
<Algebr> can and also be used in definitions of ADT?
<def`> of any type
<Algebr> so I can do type foo = Thign and type bar = Bar foo?
<Drup> yes
<def`> not and type
<def`> type foo = Thign and bar = Bar of foo
arj has quit [Quit: Leaving.]
<Algebr> ah
manizzle has quit [Ping timeout: 255 seconds]
George_ has quit [Ping timeout: 246 seconds]
binarybi1me is now known as binarybitme
maattdd has joined #ocaml
braman has joined #ocaml
<braman> hello help a newbie please
<braman> I seem to be having a command line parsing code, deep in I find >>= function.
<braman> what's >>= ?
<Drup> braman: can you show the code ?
<braman> let command =
<braman> Command.async_basic ~summary:"show contract details"
<braman> Command.Spec.(
<braman> +> Common.logging_flag ()
<braman> empty
<braman> +> Common.host_arg ()
<Drup> >>= is usually the bind operation for some monad, but it's probably not going to help you said like that. :)
<braman> +> Common.port_arg ()
<braman> +> Common.client_id_arg ()
<Drup> please use pastebin.
mort___ has quit [Remote host closed the connection]
<braman> )
<braman> (fun enable_logging host port client_id () ->
<braman> run ~enable_logging ~host ~port ~client_id ()
<braman> >>= function
<braman> | Error e -> prerr_endline (Error.to_string_hum e); exit 1
<braman> | Ok () -> return ()
<braman> )
mort___ has joined #ocaml
<Drup> mrvn, adrien : would it be possible to just drop messages that are more than 3 lines ?
shinnya has quit [Ping timeout: 272 seconds]
maattdd has quit [Ping timeout: 250 seconds]
<braman> lemme see
<Drup> braman: you're using Core, I presume ?
morphles has quit [Ping timeout: 250 seconds]
<braman> yes
<def`> It's just Async monadic bind operator
<braman> yes I have Async . may be I go look at the doc for Async .
noname` has joined #ocaml
<braman> Thanks. I found the defn in the doc : val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
<companion_cube> whitequark: the { optional=true } thing in ppx_deriving seems extremely promisin g
_0xAX has joined #ocaml
avsm has joined #ocaml
locallycompact has joined #ocaml
Simn has quit [Ping timeout: 256 seconds]
<companion_cube> whitequark:
zpe has joined #ocaml
<companion_cube> https://github.com/whitequark/ppx_deriving#plugin-conventions <--- some casing issues here (qualified names are module-qualified, aren't they?)
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<Algebr> I'm really confused about the module system resolution. I have a.ml that uses B.c where B is coming from b.ml, but when I try to do ocamlc -c a.ml, I get unbound module B error.
<mrvn> both in the same dir?
<Algebr> yes
<mrvn> compile B first. you need the .cmi
<Drup> (or don't compile by hand, and use the wise knowledge of people who build a tool to do that for you)
<Algebr> What is the .cmi for anyway? Is it like an object file interface? Its not actually needed for runtime right? I'm setting up a make file
<mrvn> Compiled Module Interface
<whitequark> companion_cube: oh, yes, casing issues
<mrvn> Algebr: use ocamldep output
<Drup> Algebr: don't write a makefile yourself
<ggole> Or ocamlbuild
<whitequark> companion_cube: oh, no, actually not
<mrvn> if everything expects and uses int maybe the define should just be fixed?
<mrvn> ups
<whitequark> a deriving plugin Eq looks at attributes foo, eq.foo and deriving.eq.foo
<Drup> whitequark: it's a bit weird, I would prefer Eq I think
<whitequark> hrm
<whitequark> makes sense
<companion_cube> +1
<Drup> but it means you need "Deriving")
<whitequark> ummm, no, that's really ugly
<companion_cube> at least for Eq.foo
<companion_cube> which is what I'd expect to use in 99% of cases
<whitequark> so you would have
<whitequark> [@@deriving Eq], [@foo] / [@Eq.foo] / [@deriving.Eq.foo], [%derive.Eq: ]
<whitequark> I think it's a nice consistency
<Drup> oh right, it's at the attribute level, not grammar
<whitequark> companion_cube: it's thought that in most cases you would use just foo
ollehar has joined #ocaml
<companion_cube> oh, ok
<companion_cube> thats what it meant
rishabhjain has joined #ocaml
avsm has quit [Quit: Leaving.]
<whitequark> okay, will probably do in next release
WraithM has joined #ocaml
<whitequark> I've decided against making sexp/json right now, because I don't have an immediate use case and they're complex
<whitequark> I don't want to have an oddly broken plugin
<Drup> whitequark: did you do Read ?
<companion_cube> you don't have a use case because you have protobuf, is that it?
<whitequark> companion_cube: no, I just don't need any serialization atm
<companion_cube> oh.
<whitequark> except Show
<whitequark> Drup: nope
Simn has joined #ocaml
<whitequark> for same reason
<Drup> k
<noname`> Hello everyone
<noname`> I hope someone of you is familiar with syscall library
<noname`> I have a question about the datatype of the timestamps
<Drup> (link to the library ?)
<Drup> ah, unix library, right
englishm has quit [Remote host closed the connection]
<noname`> sorry I am not so expert
<Drup> are you reading the caml-light manual on purpose ?
englishm has joined #ocaml
braman has quit [Quit: Leaving]
<Drup> if you are not in a french class prepa, you should go there : http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html
englishm_ has joined #ocaml
<noname`> not really, is that is the most near reference to the resource we are using in our project
avsm has joined #ocaml
<noname`> thanks
<noname`> indeed
tobiasBora has quit [Ping timeout: 250 seconds]
<noname`> I am dealing with timestamps
<noname`> and the format used by ocaml is float
<noname`> (searcg for st_ctime in that page)
<noname`> now from this format is impossible to retrieve the nanoseconds of a timestamp!
<noname`> indeed in the syscall_stubs.c file that is used by the library
<noname`> there is a line who clearly truncates that information
<noname`> ctime = copy_double((double) buf->st_ctime);
<noname`> (this is C code from syscall_stubs.c)
<noname`> a timestamp in Unix is a data structure containing two fields {tv_sec; tv_nsec}
<noname`> an other question is why we loose the tv_nsec information?
locallycompact has quit [Ping timeout: 255 seconds]
<Drup> I have no idea why It's that way, I suppose you will have to write a super small C binding to access the field in C
<noname`> wow, I suppose I will need that. Still I am so curious about this design choice!
<Drup> (Maybe it deserves a bug report)
<Drup> (especially the missing field)
<noname`> for example Linux supports nanoseconds, but through syscall you will loose that info
<noname`> (I was just asking, you are really kind Drup!)
<Drup> ^^'
<Drup> (but a question remains : which kind ?)
<Drup> (sorry, I shouldn't do type theorist jokes)
<noname`> haha
jao has quit [Ping timeout: 250 seconds]
<bitbckt> if you can't use them here, where can you?
<Drup> #haskell-blah ? :D
<bitbckt> haha
dsheets has quit [Ping timeout: 245 seconds]
avsm has quit [Quit: Leaving.]
jonludlam has quit [Ping timeout: 250 seconds]
hhugo has quit [Quit: Leaving.]
mort___ has quit [Quit: Leaving.]
rishabhjain has quit [Remote host closed the connection]
manizzle has joined #ocaml
avsm has joined #ocaml
philtor has joined #ocaml
dsheets has joined #ocaml
samrat has joined #ocaml
<Drup> whitequark: it's related, but it's not exactly the same issue
<whitequark> hm?
avsm has quit [Quit: Leaving.]
<whitequark> yes, I already deleted it
<Drup> x)
samrat has quit [Ping timeout: 240 seconds]
Submarine has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
samrat has joined #ocaml
<troydm> I'm trying to follow http://llvm.org/docs/tutorial/OCamlLangImpl1.html and I get This expression has type 'a -> 'b but an expression was expected of type 'c Stream.t
<troydm> on following line [< 'Token.Kwd c; lex stream >]
<Drup> hee
<troydm> which is last line of lex function
<troydm> *almost last line*
<Drup> did you load the syntax extension and all that ?
<troydm> not sure what that is?
<troydm> I'm using obuild
<Drup> yeah :/
<troydm> and I've specified preprocessor as camlp4o
<Drup> ok
<troydm> should I specify some additional configurations for camlp4?
<troydm> article omits the tools configuration almost entirely
<troydm> so I'm not quite sure what am I doing wrong
<Drup> no, it's included directly with camlp4
<Drup> (to be honest, we told Algebr one day ago "don't follow this tutorial, it's outdated, use ocamllex + menhir for the parsing part")
<whitequark> ^
<whitequark> we really need to find someone to rewrite it
hhugo has joined #ocaml
<Drup> troydm: I can't see what's wrong with the function, if you copied it exactly, it should behave as expected
<troydm> Drup: I've copied it exactly
<troydm> Drup: I can provide you with my source code and configuration file for obuild if you want to check it
philtor has quit [Ping timeout: 260 seconds]
<Drup> pastebin it :p
isomorph1smes is now known as isomorphismes
samrat has quit [Ping timeout: 255 seconds]
hhugo has quit [Quit: Leaving.]
<Drup> I can reproduce
<Drup> I have literally no idea
<troydm> nor am I an expert on camlp4
<troydm> :)
samrat has joined #ocaml
thomasga has quit [Quit: Leaving.]
_0xAX has quit [Remote host closed the connection]
<troydm> Drup: okey I'm now sure, problem is with lex_comment function
<troydm> try commenting it and it will compile
<troydm> now I'm not expert on camlp4
pyon is now known as pyon-lunch
srax has quit [Quit: WeeChat 0.3.8]
hhugo has joined #ocaml
samrat has quit [Ping timeout: 250 seconds]
nojb has joined #ocaml
pyon-lunch is now known as pyon
thomasga has joined #ocaml
Khady has quit [Remote host closed the connection]
samrat has joined #ocaml
dinosaure has quit [Ping timeout: 250 seconds]
ollehar has quit [Quit: ollehar]
thomasga has quit [Quit: Leaving.]
Armael has quit [Ping timeout: 240 seconds]
<Drup> troydm: urk, obviously
<Drup> troydm: change "lex_comment buffer" into "lex_comment"
samrat has quit [Ping timeout: 240 seconds]
<Drup> troydm: note that there is no buffer argument in the original piece of code :3
tane has joined #ocaml
<troydm> Drup: err.. I don't have lex_comment buffer in my source code
<troydm> ohh wait
<troydm> now I understand
<Drup> line 47 in your pastebin
<troydm> gawd
<troydm> hahaha
<troydm> so stupid problem
samrat has joined #ocaml
<troydm> and that's why the type checker went crazy
<Drup> I did check the two other function for missed partial application, but not this one >_>
<troydm> heh type inference problems are sure hard to spot without bending your mind
<Drup> sometimes
<troydm> Drup: thx alot
<Drup> you still should use ocamllex + menhir , though :p
<troydm> Drup: I'm not familiar with either of those, it'll take some time till I'll be able to use any of those tools
<troydm> Drup: I guess for now I'll just follow this tutorial blindly
<troydm> Drup: but I'll keep that in mind for future references
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
thomasga has joined #ocaml
Anarchos has quit [Ping timeout: 260 seconds]
samrat has quit [Ping timeout: 272 seconds]
noname` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
sheijk has joined #ocaml
samrat has joined #ocaml
octachron has joined #ocaml
_andre has quit [Quit: leaving]
maattdd has joined #ocaml
Anarchos has joined #ocaml
philtor has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
<octachron> Hi, I am searching for documentation on the typing part of the compiler. Any pointers?
* jeroud tries not to make a void* joke.
<Anarchos> octachron 'le langage caml'
<jeroud> Do the last few chapters of Real World OCaml talk about that stuff? I haven't read them yet.
<Leonidas> jeroud: it is not void*, it is 'value' :p
<jeroud> Leonidas: Is 'value' an untyped pointer?
<Unhammer> last part of RWO talks a bit about that yes
<octachron> jeroud: The chapter 22 speaks a little about the compiler internal but only a bit
<Leonidas> jeroud: mlvalues.h says it is an intnat which I suppose to be some native integer type :)
<jeroud> I haven't looked at OCaml's implementation yet.
<octachron> Anarchos: Hm... What is the translation of polymorphic variant in French?
<jeroud> I thought I'd build something nontrivial in the language first.
<Anarchos> octachron variant polymorphe
<Leonidas> a, there it is, in config.h: typedef int intnat;
<jeroud> Speaking of which, is there a tool I should be using for code generation?
<Leonidas> ah, I'm just fooling around :)
<Leonidas> jeroud: Depends what you want to do, maybe ppx?
shinnya has joined #ocaml
dinosaure1 has joined #ocaml
enquora has joined #ocaml
<jeroud> I need to build a bunch of types and protocol parsers/builders from an XML definition.
<jeroud> (This is an AMQP client.)
<octachron> Anarchos: :( As far as I see, "le langage caml" book doesn't speak about polymorphic variant...
<Leonidas> jeroud: you could check what https://github.com/pelzlpj/capnp-ocaml does.
<Anarchos> octachron no they were introduce after the book.
<jeroud> I've got most of the spec parser built and I have a reasonable idea of what the generated code needs to look like.
<bitbckt> octachron: perhaps start here? http://ocaml.org/docs/papers.html#PolymorphicVariants
<Leonidas> ok, it just constructs strings
<jeroud> But I'm sure there's a better way to generate the code than emitting arbitrary strings.
<enquora> what, if any, facility is available for concurrent programming - either through the language itself or libraries? I'm concerned here about code that must run on both server and web browser, so am looking for something like communication of sequential processes or a state machine with a meta language DSL (something like Ragel). not concerned about threads or processes at all.
<Leonidas> maybe you can use the types from Asttypes to construct an AST and generate source code from there.
<Leonidas> Though I don't know if it can be mapped "back" to source code form
<jeroud> Leonidas: I'll look at that, thanks.
samrat has quit [Quit: Computer has gone to sleep.]
<jeroud> Otherwise I'll just write a structured string emitter.
<Leonidas> or maybe someone else here comes up with a good idea :)
fraggle_laptop has quit [Remote host closed the connection]
maattdd has quit [Ping timeout: 272 seconds]
<jeroud> I was given some good XML parser advice in here yesterday.
<jeroud> I think this is the best programming channel I've ever been in. :-)
NoNNaN has quit [Ping timeout: 264 seconds]
<whitequark> enquora: Lwt
tobiasBora has joined #ocaml
tobiasBora has quit [Client Quit]
<Leonidas> wojciech was such a cool guy :-(
<bitbckt> yeah :/
<Leonidas> what happened? Sounds quite sudden.
<bitbckt> I don't know the cause.
<enquora> whitequark: lwt maps to a run loop and state machine, or something like that, for javascript target?
<octachron> bitbckt: thanks for the link, it is not exactly answering my question but it should help a lot
<whitequark> enquora: I think so
<bitbckt> octachron: it's all I have to offer on the subject.
Kakadu has joined #ocaml
axiles has quit [Remote host closed the connection]
<Drup> jeroud: did you had a look at cduce ?
maattdd has joined #ocaml
<jeroud> Drup: I haven't.
<Drup> jeroud: otherwise, My vote goes to compiler libs, just build a Parsetree.t (you can use the same interface than ppx extensions)
<jeroud> What is it?
Submarine has quit [Quit: Leaving]
<Drup> ppx extensions ?
<Drup> a way to do syntax extension that is going to be introduced in 4.02
<Drup> basically, it's an AST transformers
<jeroud> Ah.
<Drup> enquora: afaik, the generate code is in CPS and will yield regularly
<Drup> (and after that, yes, a scheduler decide were to go)
<Drup> so, basically, what you said
<jeroud> Drup: Out of curiosity, is your native language French?
Thooms has joined #ocaml
<Leonidas> I'm starting to believe that OCaml Labs is the best that happened to OCaml in the last... decade.
<Leonidas> http://anil.recoil.org/2013/12/29/the-year-in-ocamllabs.html - this stuff is superexciting and shoul've happened earlier :-)
<Drup> jeroud: yes, the typos are that easy to recognize ? :D
<Leonidas> I think it is more with the space in front of the question mark which is quite characteristic for french.
<Drup> oh, right, that too
<jeroud> Drup: Most of the Francophones I know are from West and Central Africa.
ggole has quit []
pyon has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
<Leonidas> (I was quite surprised to learn that the space is actually correct in french. SOmething they never told us in school :()
<jeroud> They make similar but slightly different errors. :-)
<Drup> jeroud: yeah, I'm not surprised (and I do make a lot of errors by lack of proof-reading)
<jeroud> I didn't actually notice the question mark.
<Drup> Leonidas: due to my french conditioning, I find the lack of space before !/? very very ugly. :D
<Leonidas> Drup: for me it is the other way round ;)
<Anarchos> jeroud i am from France
tobiasBora has joined #ocaml
<jeroud> I have come to the completely unscientific conclusion that Europeans are good at programming languages.
<jeroud> Based on a sample population of pypy and OCaml.
<sheijk> + that no one ever uses!
<jeroud> I don't know why OCaml isn't more popular.
<Anarchos> Drup there should be a breakable space too, after a punctuation diacritic sign in french.
<Anarchos> jeroud because real programmers are bad, conservative and fear the unknown languages (sad but true).
<jeroud> I suppose a bunch of the tooling is still quite new.
<Leonidas> jeroud: actually, I think OCaml is getting more popular lately. And Haskell.
<Leonidas> Saw a number of startups using these langs.
yacks has quit [Ping timeout: 240 seconds]
<jeroud> Anarchos: Sure, but I know a bunch of people who were writing Haskell and Clojure and Scala and stuff a few years ago.
<Leonidas> but yeah, tooling is shaping up only now
<Leonidas> and the fight to the death between Lwt and Async is still to come :p
dinosaure1 has quit [Ping timeout: 240 seconds]
<Anarchos> i work principally in java , and for a silly bank programming (j2ee and all this crap)
<sheijk> yep. tooling is really getting a lot better than it used to be
pyon has joined #ocaml
<parcs> i don't buy that
<jeroud> My first job was Java and Ruby. I managed to switch between them often enough that neither managed to completely overwhelm me with its flaws.
<Leonidas> Anarchos: my condolences.
dinosaure1 has joined #ocaml
<Leonidas> Standard Chartered (another bank) is said to have the largest Haskell codebase worldwide.
<jeroud> These days I'm working in Python and am increasingly unhappy with it for various reasons.
<jeroud> (Although it's still my first choice for most things.)
<Leonidas> Yeah, Python is kinda convenient. I am currently trying to avoid Ruby/JS and try to make as many projects as possible in OCaml
Kakadu_ has joined #ocaml
Kakadu_ has quit [Client Quit]
Kakadu_ has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
dinosaure1 has quit [Client Quit]
Kakadu_ is now known as Kakadu
<Leonidas> with nodejs, the libraries raise and die in weeks, can't be rewriting everything once a new shiny thing comes along.
<jeroud> Hrm. I keep meaning to look at the OCaml to JS stuff.
wieczorek has joined #ocaml
<jeroud> Can that interact with existing JS code?
<Leonidas> Opa can
<Leonidas> (Opa is implemented in OCaml and compiles to JS for Browser/Nodejs)
<def`> yes that can (of course :))
<jeroud> Maybe I should try that when I'm done (or stuck) with my AMQP client.
<wieczorek> Hi. I have two files A.ml and B.ml, in both files I have instantiation of parameterized module by identitial arguments. For example module M = Map.Make(MyLib.IntOrderType). Where the code of M module will be stored? In both compilation units? Does linker remove a duplication?
<Leonidas> and it kinda looks like a sensible solution, because everything is typesafe. Including the stupid HTML
<def`> wieczorek: functor application is just like applying a function
BitPuffin has quit [Ping timeout: 240 seconds]
<def`> no code gets generated
<jeroud> We have a node.js sandbox in our messaging system and that might be a convenient target for some OCaml.
<def`> so at runtime you'll have two applications, that's all
<wieczorek> def`: I am not sure if I understand correctly. The functions defined in the functor will have a hidden value, the parameter module?
<Drup> Leonidas: I would advise against Opa
<Drup> the language *was* great, until they completly changed it to look more like js soap, the community is basically non existent
hhugo has quit [Quit: Leaving.]
jwatzman|work has joined #ocaml
<Leonidas> Drup: oh, that's sad. You know some real-world usable alternatives? Ocsigen?
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
<Drup> As an ocsigen dev, I would tend to say yes :>
<Leonidas> Drup: oh :D
pango has joined #ocaml
<Leonidas> Drup: Then I might be bothering you in the future with questions about it :-)
<Drup> jeroud: you forgot Haskell, Scala and Rust (I think), in your sample
<Leonidas> (if they let me use ocaml at work)
<Drup> (and lot's of other)
<Leonidas> Rust is not really functional
<Drup> Leonidas: "good at languages"
<Leonidas> oh. Sorry.
<Drup> "European are good at languages"
<jeroud> Drup: I haven't used those enough to have a solid opinion, except for Haskell which I found somewhat impractical.
<Leonidas> Rust is kinda neat and #rust is also a nice channel
<Leonidas> I'm just a tad too stupid for lifetimes
<jeroud> Rust's still too immature.
<Leonidas> I found Haskell pretty amazing
teiresias has quit [Quit: rebooting]
Anarchos has quit [Quit: went to sleep]
<Drup> jeroud: Well, I agree, but it's far better than most mainstream languages
<jeroud> Drup: That's a depressingly low bar.
<Leonidas> but it is easy to fall into the compexity well where all code requires a solid understanding of cathegory theory
<Drup> jeroud: but a more exact statement would be that europeans are very good a PL *research*
<jeroud> I mean, Java and C++ and PHP are in there.
<Drup> Leonidas: that's not true
<Drup> you don't need category theory to code in haskell
<Leonidas> Rasmus Lerdorf is European, tho.
englishm_ has quit [Remote host closed the connection]
englishm has quit [Quit: Leaving.]
hhugo has joined #ocaml
<Drup> jeroud: about your js question, js_of_ocaml is very good, quite mature and is node.js-proof
<jeroud> Drup: The pypy people are very good at implementation, but they explicitly avoid language innovation.
englishm has joined #ocaml
<Leonidas> Drup: no, you don't need to, but you can and if you're good at haskell, you probably will end up writing very smart and elegant code that hardly anyone will understand
<jeroud> Drup: Cool, I'll take a look at it sometime.
<Drup> Leonidas: I .. don't disagree x)
<Leonidas> css_of_ocaml, anyone? Please?
<Drup> Leonidas: COW
<jeroud> My main problem with Haskell is that I found it really hard to debug.
<Leonidas> ah, mirage. Again.
<Leonidas> strange, I found it hard to make bugs in haskell
<Drup> Leonidas: but, in the end, you're better off writing the CSS for real
Algebr has quit [Ping timeout: 264 seconds]
<jeroud> And also to solve part of a problem rather than the whole problem.
* Leonidas off for today, getting late and have to get up early
<Drup> Leonidas: oh, there is also ccss, a preprocessor for css written in ocaml
yacks has joined #ocaml
<jeroud> OCaml's much more amenable to dropping debug prints and such into.
<Leonidas> jeroud: you can add debug trace in haskell just as well
<Drup> just don't enable the optimization if you put some debug printing :p
<jeroud> I'll need to give Haskell another try at some point, but not until I'm fluent in OCaml.
<Leonidas> that sounds reasonable
<jeroud> Erlang wasn't bad, but the punctuation kept getting in my way.
englishm has quit [Remote host closed the connection]
englishm has joined #ocaml
englishm_ has joined #ocaml
<jeroud> Hrm. Why doesn't Lwt_io have an easy way to make a server that passes the remote address to the connection handler?
BitPuffin has joined #ocaml
<maurer> OK, on windows, my stublib doesn't seem to be linked in
<maurer> Anyone know how to debug this?
<maurer> The build succeeds on mac and linux
<maurer> On windows, linking against the package seems to just forget the stublib is there
<maurer> I double checked, and the ld.conf pointed to by ocamlfind printconfig ldconf contains a line with the directory that has the stublib
<maurer> but it fails to find symbols the stublib provides
jonludlam has joined #ocaml
Khady has joined #ocaml
octachron has quit [Quit: Page closed]
izaak has joined #ocaml
<wieczorek> Can I do something like this: module type TSIG = sig ... end; module type TSIG_EXTENTIONS = functor (S : TSIG) -> sig ... end; module F (T : TSIG) (TX : TSIG_EXTENSIONS(T)) = struct ... end ?
<wieczorek> def`: ?
maattdd has quit [Ping timeout: 240 seconds]
<Drup> replace the definition of TSIG_EXTENTIONS by "module TSIG_EXTENTIONS (S : TSIG) = struct module type T = sig .... end end
<Drup> and the usage by TSIG_EXTENSIONS(T).T
dinosaure has joined #ocaml
<Drup> but generally speaking, it's not very idiomatic, in most cases you don't want to do it like that
<Drup> you should define a signature which match TSIG_EXTENTIONS's output
<Drup> and enforce some type equalities
<wieczorek> Maybe I would write what I want to achieve
xitology_ has joined #ocaml
<Drup> yes :)
<wieczorek> and you will give me a note.
<wieczorek> Ok, I am trying to do some compiler framework. I did one, but it forces user to write ast and ast manipulators for each language.
tobiasBora_ has joined #ocaml
<wieczorek> Now I am trying to do some generic ast.
rz has quit [Read error: Connection reset by peer]
<wieczorek> I have a module type AstDriver
Brocoli_ has joined #ocaml
* Drup prepare signs from 0 to 5.
<wieczorek> which has type kind and some functions.
Brocoli_ is now known as Armael
<wieczorek> Next, I have a module MakeAst(AstDriver : AstDriver) which produces a type for ast and fold, iter, top down rewriter.
<wieczorek> Now I would like to some extension for languages which supports binders.
<wieczorek> I would like to do module type SubstitutionDriver
<wieczorek> which has some functions related to binders/variables.
<wieczorek> and I am trying to produce module Substitution (SubsituttionDriver) which adds some new functions for ast manipulations like paraller_substitution
<wieczorek> now usage:
<wieczorek> I have LambdaDriver and LambdaAst = MakeAst(LambdaDriver)
<wieczorek> now I would like to write LambdaSubstitutionDriver and make LambdaSubstition = Substitution(LambdaSubstitutionDriver)
tobiasBora has quit [Ping timeout: 245 seconds]
<wieczorek> Now I did that SubstitutionDriver includes the AstDriver
<wieczorek> and the Substitution module opens the MakeAst(SubstitutionDriver) to use generic ast manipulators.
<wieczorek> when I amdefining LambdaSubstitution I got a conflict
<Drup> I would make Substitution take AstDriver as first argument
<Drup> don't include it in SubstitutionDriver
<wieczorek> that MakeAst(AstDriver).someType is not equal to Substitution.AST = MakeAst(SubsitutionDriver)
<wieczorek> ok
<wieczorek> bow how to relate SubstitutionDriver to given AstDriver as first parameter of Subsituttion module
<wieczorek> ?
<wieczorek> errata: bow -> but
pango has quit [Remote host closed the connection]
<Drup> module ( Ast : AstDriver) (Subs : SubstitutionDriver with type ast = Ast.ast)
<wieczorek> errata: that MakeAst(AstDriver).someType is not equal to Substitution.AST = MakeAst(SubsitutionDriver), AST.someType
<wieczorek> hm
<Drup> module MakeSubsitution*
<wieczorek> ok, I understand.
<Drup> wieczorek: if you want a bigger example
tane has quit [Quit: Verlassend]
<wieczorek> but I wonders me what in cases where Driver module has many types
<Drup> you can look at how the svg and the html functors are constructed in tyxml
<Drup> it's basically the same thing
<Drup> let me find you the exact file
Simn has quit [Quit: Leaving]
<wieczorek> I have to write type equality for each type?
<wieczorek> Ok, thanks.
drewolson1 has joined #ocaml
jao has quit [Ping timeout: 245 seconds]
<drewolson1> hey all. i'm trying to follow the installation instructions for real world ocaml and opam is failing to install core. I'm on a mac with fresh installs of opam and ocaml. ideas? https://gist.github.com/drewolson/6fee023ed6c6239041e9
<wieczorek> oh, it has 'with module A = B'
<wieczorek> it would allow programmer to do some aggregation of needed equality instead of writing many type equalities.
<Drup> the point is that, the Html5_f.Make functor takes as argument a module Xml (just like the functor Svg_f.Make and a module Svg
<wieczorek> errata: equalities,
<wieczorek> sorry for typos.
<Drup> wieczorek: indeed, but it's not exactly enough
<Drup> notice "Html5_sigs.Make(Xml)(Svg).T"
<Drup> it's for the output
<Drup> (I changed that recently)
<Drup> (I factorized all the type equalities in a single "functor signature)
<Drup> but that's only for the *output* signature
<wieczorek> Why?
<Drup> for the intra-input equalities, you don't need that much, usually
drewolson1 has left #ocaml [#ocaml]
<Drup> (or you can figure out a way to use only module X := Y
drewolson has joined #ocaml
<wieczorek> Ok.
<Drup> and you should limit intra-input equalities anyway, just the bare minimum to ensure correctness
<wieczorek> Thanks for time, I need time to analyze this. I don't have resolver for ocaml module dependencies, I am not using this ussually.
<wieczorek> errata: resolver in mind
<wieczorek> eh, why I am doing so many errors today?
<wieczorek> am I*
<wieczorek> lol
tobiasBora_ has quit [Quit: Konversation terminated!]
<Drup> wieczorek: well, it's a complicated part of the ocaml type system, so, take your time :D
<drewolson> any help on there on this issue running 'utop install core' on a fresh utop / ocaml installation on osx? https://gist.github.com/drewolson/6fee023ed6c6239041e9
<drewolson> (or is there somewhere else i should ask?)
manizzle has quit [Remote host closed the connection]
manizzle has joined #ocaml
<Drup> drewolson: last version is core 111.21.00, not core 109.31.00, install this one
Hannibal_Smith has quit [Quit: Sto andando via]
<drewolson> Drup: is there an easy way to specify versions in opam? google-ing / man pages hasn't been helpful. do i need to pin somehow? when i do an `opam show core` i see the new version but the install task doesn't seem to want to install it
<Drup> (opam sometimes doesn't select the lastest version possible, because :reasons:, and it's the source of a bug in your case
<Drup> "opam install core.111.21.00"
<drewolson> thanks :)
<wieczorek> I wonder if ocaml stdlib will be extended in future. Current stdlib should be named do-everything-self-stdlib.
<Drup> wieczorek: no.
<wieczorek> I do not understand this strategy ;]
<def`> wieczorek: re, yes for "functions will have a hidden argument", that's how all ocaml functions work
<wieczorek> I very like the ML languages, I prefer to use ml instead of haskell.
<wieczorek> but the stdlib lacks of everythings.
hhugo has quit [Quit: Leaving.]
<def`> and another encoding of your functor is to define extensions as part of your module, e.g module type TSIG = sig ... module type EXTENSION end;;
<jerith> wieczorek: My experience with languages that have big stdlibs is that there are usually third-party libraries that are better than the stdlibs.
<def`> and the functor will have parameters (S : TSIG) (E : S.EXTENSION)
<jerith> But most people use the inferior stdlibs anyway, because it's there.
<def`> (stdlib in the case of haskell makes it problematic to fix the class hierarchy)
<def`> Yes.
<Drup> wieczorek: I won't say I agree with the core team, but there is somewhat a misunderstand about this part
<Drup> the stdlib is "the library needed by the compiler"
<Drup> not really "the featurefull library anyone should use to build an ocaml project"
Thooms has quit [Ping timeout: 240 seconds]
<Drup> (that's Core or Batteries)
<Drup> I won't say I agree with the strategy, but at least it's explicit
<jerith> I think it's a different tradeoff.
<Drup> everything that can leave outside the compiler should
<wieczorek> Drup: I think that making language stdlib for language compiler is a bit weird idea. Next step in this way of thinking would be making ocaml language to make ocaml compiler.
philtor has quit [Ping timeout: 240 seconds]
<Drup> wieczorek: but, the ocaml language is already the compiler :D
<jerith> I think there's probably a good middle ground.
maattdd has joined #ocaml
<wieczorek> 00:04 < Drup> I won't say I agree with the strategy, but at least it's explicit
<jerith> A comprehensive set of tools around the basic types (like Core's List module, etc.) and maybe a few simple libraries that are commonly used in a wide variety of programs.
<wieczorek> Yeah, the explicit attribute (explicitness?) of some strategy is an important value, but it is not a goal which suppress other values.
<wieczorek> I don't agree that existence of Core/Batteries is a good complement of ocaml strategy.
<jerith> I don't think XML parsers and HTTP clients really belong in a stdlib, but I'd prefer something a little less... sparse than OCaml's.
<wieczorek> When I am making library i have to decide which group I target
<wieczorek> the Batteries users or Core users
<wieczorek> and it is only because I dont want to write basic functions for list manipulations.
<wieczorek> madness.
<Drup> jerith: well, there is a dedicated library for both these things, recognized to be "the good way to do it" :p
<wieczorek> I agree that stdlib don't need be such big
<wieczorek> like .NET/Java stdlibs.
<Drup> wieczorek: the division is regretful, the fact that it's outside the compiler is not
<Drup> (except for the Option module, seriously >_>)
<def`> the standard library is small but also inconsistent and not encouraging good practices
<Drup> yeah :/
dsheets has quit [Read error: Connection reset by peer]
<wieczorek> also would like to see some more modern features in ocaml
<def`> that's more of a problem, otherwise other libraries good just extend rather than replacing
<wieczorek> like threading and mapping module hierarchy to file system
<Drup> mapping module hierarchy to file system would be madness xD
<Armael> wat
<jerith> Drup: I chose those examples because they're things the Python stdlib does really badly.
<Drup> it's not a modern feature, it's an archaism from java :D
<wieczorek> for me it is the best thing.
<jerith> wieczorek: Mapping modules to the filesystem has cause me endless trouble in Python.
<wieczorek> One time i did some hacking madness of mlpack
<def`> depends on what extent you want to map to FS, but it's generally a bad idea
<wieczorek> but then I discover that ocamldoc does not support this :D
<wieczorek> Why you dont like this mapping?
<jerith> It's convenient for simple structures, but breaks as soon as you want to do something more complex.
<def`> ah yes, module packing is a hack, and not a well supported one
<Drup> wieczorek: because after 3 stack of depth, it's a mass ?
<Drup> mess*
<wieczorek> You are too dogmatic.
<Drup> especially considering the first class nature of ocaml's modules
<wieczorek> I would like to do for example a namespace Language
<Drup> right
<wieczorek> which could be extended by plugins loaded dynamiccaly.
<Drup> there is an issue with namespaces
<Drup> but that's different :p
<wieczorek> Currently it can be only fixed by hand written aggregation or by mlpack.
<wieczorek> Ok
<def`> 4.02 provides a cleaner solution
<Drup> (there are lengthy discussions about namespaces)
<wieczorek> Ok, maybe I put wrong words.
<wieczorek> I would like to have a namespaces mapped to file system.
<def`> (not a perfect one yet, but better than mlpack)
<jerith> wieczorek: Python's mechanism breaks down in the same places, but for different reasons.
Kakadu has quit [Quit: Konversation terminated!]
<wieczorek> jerith: Haskell, Java, C# mechanism also break down for some places?
<wieczorek> I would like to tell one word about Haskell hierarchy
<Drup> Haskell module system doesn't break
<wieczorek> it is also madness.
<Drup> it's non existent.
<wieczorek> Each library puts generic names in hierarchy, like Data.Vector. What if I want to write my own Vector? Or use some libraries which also defines some Vector module.
<Drup> and java project are a maze of directories because everything is hidden in some.name.space.somewhere.far.beyond.the.border.of.our.galaxy
<wieczorek> Why they do not use standard C/C++ convention that name of module is related to library name.
<wieczorek> You are critizing usage of reverse dns in hierarchy.
<Drup> well, it's how it ended up in java :D
<wieczorek> Yes, it is a bit overkill, but it is culture of naming, not the hierarchy mechanism itself.
<wieczorek> Could someone explain me of + annotation in type variables?
<Drup> it's for covariance
<wieczorek> Does it has sense only for objects?
<Drup> no, not only for objects
<wieczorek> I do not understand this.
<Drup> it's related to subtyping
<wieczorek> I always saw the covariance term in context of subtyping of functions.
nojb has quit [Ping timeout: 245 seconds]
<wieczorek> but when I see + annotation, I do not understand where this covariance occurs.
<wieczorek> I understand the sentence 'when someone subtypes the function type, then ... is covariance... is countercovariance (it is proper name? I know only polish term)'
philtor has joined #ocaml
<jerith> wieczorek: contravariance, I think.
<Drup> let us note t1 :> t2 "t2 is a subtype of t1" (or, in another way "t1 can be coerced to t2"
<Drup> yes, contravariance
<Drup> if 'a t is covariant, noted +'a t, then x :> y imply x t :> y t
<Drup> if 'a is contraviant, noted -'a t, then x :> y imply x t <: y t
<wieczorek> Ok
<wieczorek> I understand.
<wieczorek> Now I do not understand why I do not understand if previously.
<wieczorek> Now I do not understand why I do not understand it previously.
<wieczorek> It is related only to objects?
<Drup> yes
<wieczorek> Ok.
<Drup> because subtyping
<Drup> I gave you the "normal" definition of variance
<Drup> it gets much more complicated if you throw mutability in the mix, like OO language do
<maurer> Like, literally, if I go into the folder where the stublib is installed, run ar x on it to get the object out, ar q to put the object into the regular archive, it builds and runs successfully.
<Drup> iirc, in ocaml, I think any mutable type is forced to be invariant, period
<Drup> ( def` is that right ?)
<wieczorek> It sounds like something we would like to expect
<wieczorek> I remember example that mutable arrays would brake typesystem without invariance
<Drup> well, java break your expectation in the matter in multiple ways.
pango has joined #ocaml
<wieczorek> There is another feature of ocaml I would see.
<wieczorek> Maybe it is already available and I don't know.
<wieczorek> I very like to write clean code and use type system, compiler warnings, etc to have code of good quality
<wieczorek> sometimes I want to write module of some signature without truncating module interface to given signature
<wieczorek> for example
<wieczorek> I would like to write
<wieczorek> module LambdaAstDriver : AstDriver = struct ... end
<wieczorek> and have compiler errors when module LambdaAstDriver does not meed required signature.
<wieczorek> I like this when I am doing some refactoring.
<wieczorek> I see error on definition, not on usage.
<wieczorek> but the " : AstDriver" statement truncates the interface of defined module.
<wieczorek> I would like to see something like this
<wieczorek> module LambdaAstDriver :> AstDriver = ...
tobiasBora has joined #ocaml
<wieczorek> which forces compiler to check interface of my module, but not truncate the signature.
<wieczorek> What do you thinks about this feature?
<Drup> you don't need :>, : will do
<wieczorek> but : will truncate the interface of my module.
<Drup> well, that's what you want :D
<wieczorek> No, I want only to check if I satisfy the given signature.
<wieczorek> but still have this module 'open'
<wieczorek> Maybe 'open' is not the best term.
<Drup> oh, just check it
<wieczorek> yes.
<Drup> I would just add a test for that, instead
<wieczorek> It is not a solution for me.
<wieczorek> because when I am writing a tests for my library
<def`> Drup: yes, I think so
<wieczorek> I have my library already compiled.
<wieczorek> So when I am doing refactoring
<Drup> wieczorek: and ?
<wieczorek> and change signature
<def`> covariance is also used to relax value restriction
<wieczorek> then I would get a error on usage of my module. For example applying it to some functor.
<Drup> wieczorek: tests are fine for that too
<wieczorek> I would prefer to get error on definition of my module, not when applying functor to my module.
<Drup> huum
<wieczorek> No, because I would be able to compile tests after refactoring
<wieczorek> then I dont need this test.
<wieczorek> of course I can do some hack
<wieczorek> that after each definition I have some dummy definitions which includes my definition
<wieczorek> and truncates the signature
<wieczorek> but it is a bit ugly.
<Drup> and I don't see why the test could not "test" the types too
pango has quit [Ping timeout: 260 seconds]
<wieczorek> Maybe my english is too weak to do well description, I would give a example why tests does not satisfy me here.
maattdd has quit [Ping timeout: 245 seconds]
<def`> wieczorek: you would like to make sure that a module satisfy a signature ?
<wieczorek> def`: I would like to move error-places to definition from the usage.
<wieczorek> Because it is a bit harder to do refactoring when I have error when applying functor to my module.
<wieczorek> My example:
NoNNaN has joined #ocaml
<wieczorek> I have a library and I have unit tests for checking that module LambdaAstDriver meets the signature AstDriver.
<wieczorek> But tests are compiled with my library, so tests are compiled when my library can be compiled.
<def`> module type SIG = sig module type T end;;
<wieczorek> When I am doing some refactoring I can break a code.
<def`> module Is_instance_of (S : SIG) (M : S.T) = struct end;;
<wieczorek> and I cannot run my tests until I finish my refactoring, because library does not compile.
zpe has quit [Remote host closed the connection]
<wieczorek> Yes, it is a solution, but seems to be a bit tricky.
<def`> include Is_instance_of (struct module type T = Ast_driver end) (LambdaAstDriver);;
<def`> As elegant as C++ ;)
<wieczorek> hehe
zpe has joined #ocaml
<wieczorek> Ok
<wieczorek> thanks for discussion
<wieczorek> and supporting me with ocaml module system.
drewolson has quit [Read error: Connection reset by peer]
drewolson has joined #ocaml
<wieczorek> I am going to sleep, I want to go to job at early morning.
<wieczorek> work&
<wieczorek> work*
<def`> wieczorek: I agree this feature is desirable
<def`> good night
wieczorek has quit [Quit: leaving]
<def`> wieczorek: you can also do include ((LambdAAstDriver : AstDriver) : sig end);;
<def`> oops
<def`> too late :)
<Drup> so pretty =')
<def`> module type unit = sig end;;
zpe has quit [Ping timeout: 245 seconds]
<def`> include (LambdaAstDriver : AstDriver) : unit);;
<def`> to makes things really confusing ;)
<Drup> Unit* ?
<def`> no no, unit
drewolson has quit [Read error: Connection reset by peer]
<def`> module types live in a separate namespace
<Drup> :O
drewolson has joined #ocaml
<def`> you can use lowercase identifier
<def`> <3
* Drup feels dirty.
pango has joined #ocaml
<rks`> :D
sheijk_ has joined #ocaml
drewolson has left #ocaml [#ocaml]
sheijk has quit [Ping timeout: 260 seconds]
teiresias has joined #ocaml
englishm_ has quit [Remote host closed the connection]
englishm has quit [Quit: Leaving.]
englishm has joined #ocaml
englishm_ has joined #ocaml
englishm_ has quit [Remote host closed the connection]
englishm has quit [Client Quit]
englishm has joined #ocaml
BitPuffin has quit [Ping timeout: 255 seconds]
englishm has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
izaak has quit [Ping timeout: 264 seconds]
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 250 seconds]
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
<sheijk_> anyone having experience with ocaml native code debugging in gdb on osx? from what i can see in real world ocaml + the net it does not work, although all the info i could find seems to be outdated..
<sheijk_> in my small test program it seems to work partially (can break on functions, only and listing current source does not work). see https://github.com/sheijk/ocaml-gdb-debug
<sheijk_> are there any known fixes? :)
mort___ has joined #ocaml
<whitequark> on linux it is able to find the source
<whitequark> also, breaking on source lines shouldn't depend on availability of the source
<whitequark> you just need to pass -g
<whitequark> I suspect the reason is that OS X has a different debug info format