<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)
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.
<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/
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?
<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
<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. :-)
<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]
<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?
<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
<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>
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