<ebzzry>
smondet: it was build with 'corebuild test.native'
<smondet>
ok, so first, if you use Core say so on IRC
<smondet>
then
manud has quit [Quit: manud]
<smondet>
you're hitting a common problem, a value cannot have a polymorphic type like that at the toplevel of a module
kyun has joined #ocaml
<smondet>
let () = let s = Stack.create () in Stack.push s 42
<smondet>
and so on
manud has joined #ocaml
<smondet>
try in the toplevel, let s = Stack.create (), you'll see the '_a type which kind of means "polymorphic until next time it's used"
<ebzzry>
smondet: let me try that
simulacrum has quit [Quit: No Ping reply in 180 seconds.]
simulacrum has joined #ocaml
larhat has quit [Quit: Leaving.]
manizzle has quit [Ping timeout: 246 seconds]
manud has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
siddharthv_away is now known as siddharthv
zpe has quit [Ping timeout: 246 seconds]
taion809 has quit [Quit: Leaving]
tnguyen has joined #ocaml
koderok has joined #ocaml
koderok has quit [Client Quit]
c74d has quit [Remote host closed the connection]
axiles has joined #ocaml
<ebzzry>
smondet: what is the difference between "let () = let s = Stack.create ..." and "let s = Stack.create ..." when it is in a file?
c74d has joined #ocaml
tnguyen has quit [Quit: tnguyen]
zpe has joined #ocaml
tnguyen has joined #ocaml
zpe has quit [Ping timeout: 258 seconds]
rwmjones has quit [Ping timeout: 245 seconds]
rwmjones has joined #ocaml
tnguyen1 has joined #ocaml
tnguyen has quit [Ping timeout: 272 seconds]
<ebzzry>
def`: ping
<def`>
pong
ygrek has quit [Ping timeout: 260 seconds]
tnguyen has joined #ocaml
tnguyen1 has quit [Ping timeout: 250 seconds]
<ebzzry>
def`: How can I make merlin-locate work. It says: Needed cmt file of module 'Core' to locate 'Stack.create' but it is not present
<Unhammer>
ebzzry, using opam?
<def`>
ebzzry: you need to produce cmt files. I guess you are using opam, there is a trick I don't know to do so :)
<Unhammer>
you might have to
<Unhammer>
$ export OPAMKEEPBUILDDIR=true
<Unhammer>
$ export OCAMLPARAM="_,bin-annot=1"
<Unhammer>
$ opam reinstall core # or whatever package has stack
<def`>
cool thanks Unhammer \o/
<Unhammer>
heh np
<Unhammer>
(I have those exports in my .bashrc; probably makes opam install a bit slower and .opam a lot bigger but it seems worth it to have the source available)
<ebzzry>
Unhammer: Yes, I'm using opam
<ebzzry>
let me try that.
<ebzzry>
btw, is there a way to create new # directives in the toplevel?
<flux>
yes, ocamlfind does it (#require)
<Unhammer>
also ebzzry you'll need to add the path to your .merlin
<flux>
ebzzry, regarding the 'what is the difference question', the first one surely reads let () = let s = Stack.create .. in
<flux>
ebzzry, or actually in <expr> and it significies 's' is accessible only within that expression
<flux>
ebzzry, when it's a top-level statement (ie. in a file) it means that it's a global and is visible for all statements (and expressions) after that
<ebzzry>
flux: yes, and that since let also pattern matches, the () will match a function that returns unit.
<ebzzry>
Unhammer: how do I add that path to the .merlin file?
<flux>
ebzzry, yes, finally the <expr> needs to return () (or not return at all)
<flux>
ah, I missed your actualy problem
<ebzzry>
flux: the real question that i'm too shy to ask is that how can i create a stack (with Stack.create ()) at the "global" level that expressions in the file can later use.
<flux>
so the let s = Stack.create () will work if you say what its type is or have the interference decide it for you
zpe has joined #ocaml
<flux>
ebzzry, the reason why let s = Stack.create () cannot have type 'a and compile is that let's say you compile that, and then you compile a.ml and b.ml which both use stack.ml
<flux>
now because thet type is 'a stack, a.ml can choose to put integers in and b.ml can choose to put strings in
<flux>
all stack.ml, a.ml and b.ml are separately compiled, so they don't know what choices other modules took
<flux>
therefore the exported type from stack.ml must be fixed when it is compiled
<ebzzry>
flux: how can i fix it?
<flux>
well, do you know what kind of elements you will put in?
<ebzzry>
let presume i'm going to use ints
<flux>
let s : int stack = Stack.create ()
<flux>
alternatively:
<flux>
let s = Stack.create ()
<flux>
, but, within the same file
<flux>
let add_42 () = Stack.push s 42
<flux>
then the type interference will the type of 's' and it compiles as well
<flux>
if the 's' does not need to be shared between difference modules, ie. they can each have their own stack and then just pass it as argument, you can also have let s () = Stack.create ()
<flux>
of course, then whenever s () is called a new instance is created and the caller needs to hold on to it..
<flux>
I think in general perhaps it doesn't sound the best idea to have a global stack variable, especially one shared by multiple modules, but perhaps you have a case ;)
<flux>
(ie. in general global variables are not a modern approach, but at some situations they can be useful)
<ebzzry>
ok. btw, why won't 'let s : int stack = Stack.create ()' work?
<flux>
it will?
<ebzzry>
I get: Error: Unbound type constructor stack
<flux>
well I was just making that up
<flux>
I don't know what is a Stack module
<flux>
perhaps replace stack with Stack.t
<ebzzry>
ah, yes. it works with that
<Unhammer>
ebzzry, this is e.g. what I had to put in the .merlin to get batteries in there:
<Unhammer>
B /home/me/.opam/system/build/batteries.2.3.1/_build/src/
<Unhammer>
S /home/me/.opam/system/build/batteries.2.3.1/_build/src/
<ebzzry>
where keyword should I search in the manual regarding a statement like 'let s : int stack = Stack.create ()', wherein there's the use of :
<adrien>
gasche: XL said at last OUPS that he wasn't opposed to moving ocamlbuild out of the repo provided there was for sure a team of maintainer that would keep developing it
<gasche>
thanks for the info; that's a difficult condition to satisfy right now
tane has quit [Quit: Verlassend]
<adrien>
I think it can be fine and that you asked about it is great
<adrien>
an answer on mantis is valuable
<adrien>
I dunno if I'll have time for ocamlbuild myself, too much stuff on win-builds and then the cross-compilatio
igstan has quit [Quit: igstan]
larhat has quit [Quit: Leaving.]
cago has left #ocaml [#ocaml]
dubst3pp4 has quit [Quit: Ĝis la revido!]
yomimono has joined #ocaml
<gasche>
(my mantis remark initially started to as an email to the three self-designated volunteers, but I'm wary of private discussions)
Thooms has quit [Quit: WeeChat 0.4.3]
<avsm>
adrien: any opinions on that Appveyor thing?
<avsm>
adrien: would be really nice to start upstreaming some of the WODI patches so that it just works (e.g. for Lwt) on Cygwin at least
<avsm>
that seems to be a good stepping stone to MinGW
<adrien>
appveyor?
<gasche>
"travis that works on Windows"
<adrien>
ok
<adrien>
well, obviously, no opinion on it since I didn't know what it was
<adrien>
hmmm
<adrien>
but is it even free software?
<adrien>
i.e. can it be used for anything?
bezirg has quit [Ping timeout: 250 seconds]
<MercurialAlchemi>
I don't know about Travis, but Jenkins can have Windows slaves
<MercurialAlchemi>
so I'm not sure why you'd want a "Travis that can run on Windows"
<adrien>
I don't get the link between appveyor and wodi patches =/
<avsm>
adrien: wodi seems to have a lot of local patches for packages; if those were upstreamed (or ported to opam), then we can keep packages working via appveyor builds
<adrien>
ah
<adrien>
but it looks like appveyor is for .net
<adrien>
don't know how it accepts other things
<adrien>
especially with the ocaml setup which is a bit uncommon
<Drup>
(avsm: It's mostly for showcasing reasons btw, you stream music in a typesafe way, I want to write statically checked blogs :D)
<avsm>
yep, no objection there!
bytbox has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 245 seconds]
ccmaru has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
marynate has joined #ocaml
* nicoo
will need to play with the OCaml sound streaming thing, at some point.
eikke has quit [Ping timeout: 240 seconds]
ccmaru has quit [Ping timeout: 244 seconds]
ollehar has quit [Ping timeout: 272 seconds]
rand000 has quit [Ping timeout: 244 seconds]
yomimono has quit [Ping timeout: 258 seconds]
ollehar has joined #ocaml
bezirg has quit [Quit: Leaving.]
SethTIsue has quit [Quit: SethTIsue]
SethTIsue has joined #ocaml
SethTIsue has quit [Ping timeout: 244 seconds]
vogler has quit [Ping timeout: 245 seconds]
eugene_klm has joined #ocaml
tizoc has quit [Changing host]
tizoc has joined #ocaml
ccmaru has joined #ocaml
ccmaru has left #ocaml [#ocaml]
jwatzman|work has joined #ocaml
Anarchos has joined #ocaml
manizzle has quit [Ping timeout: 272 seconds]
fraggle-boate has joined #ocaml
koderok has joined #ocaml
q66 has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
cago has quit [Quit: cago]
boogie has joined #ocaml
octachron has quit [Quit: Leaving]
jonludlam has quit [Quit: Coyote finally caught me]
zpe has quit [Remote host closed the connection]
rand000 has joined #ocaml
Kakadu has quit [Quit: Page closed]
SethTIsue has joined #ocaml
SethTIsue has quit [Client Quit]
SethTIsue has joined #ocaml
nojb has joined #ocaml
avsm has quit [Quit: Leaving.]
dsheets has quit [Ping timeout: 245 seconds]
SethTIsue has quit [Quit: SethTIsue]
nojb1 has joined #ocaml
marynate has quit [Quit: Leaving]
boogie has quit [Remote host closed the connection]
nojb1 has quit [Quit: WeeChat 1.0]
psy has joined #ocaml
psy_ has joined #ocaml
SethTIsue has joined #ocaml
psy has quit [Read error: Connection reset by peer]
jonludlam has joined #ocaml
SethTIsue has quit [Ping timeout: 244 seconds]
tty57 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
boogie has joined #ocaml
seanmcl has joined #ocaml
ontologiae has joined #ocaml
nojb has quit [Quit: nojb]
tnguyen has quit [Quit: tnguyen]
Kakadu has joined #ocaml
nojb has joined #ocaml
nojb has quit [Client Quit]
bytbox has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
nojb has joined #ocaml
<whitequark>
hm
_whitelogger has joined #ocaml
nojb has quit [Client Quit]
nojb has joined #ocaml
hasbrown_delight has joined #ocaml
koderok has quit [Ping timeout: 272 seconds]
<hasbrown_delight>
Hey everyone. I've tried lots of Google-ing, and tried a few different options, but I haven't yet found an editor that suits my needs. Can anyone help? Specifically, my requirements are 1) not Emacs, 2) syntax highlighting, 3) type information display (i.e. in a tooltip or a region of the screen), and 4) works with Mirage projects (not a typical
<hasbrown_delight>
ocamlbuild or Makefile project--kind of both).
<hasbrown_delight>
I've tried Ocaml-Top, OcaIDE (the Eclipse plugin), vim, utop (a top-level, I know), and ocaml top-level, all deficient in different ways
<hasbrown_delight>
The type information display is what is most commonly missing; only Oca IDE even *sometimes* works for my project
slash^ has quit [Read error: Connection reset by peer]
hasbrown_delight has joined #ocaml
bytbox has quit [Remote host closed the connection]
<hasbrown_delight>
well, hallelujah :)
<hasbrown_delight>
seems to work OK
<ousado>
hasbrown_delight: what exactly?
<hasbrown_delight>
vim + merlin
<companion_cube>
\o/
<hasbrown_delight>
with a quick key map to :TypeOf, it's basically perfect
<companion_cube>
hasbrown_delight: you might notice .merlin files in many Ocaml projects
<hasbrown_delight>
thanks, companion_cube
<companion_cube>
the completion is good too, and if you have Syntastic...
<hasbrown_delight>
how can I get completion?
<hasbrown_delight>
sorry, haven't looked over the docs
<hasbrown_delight>
and maybe you can also tell me how to change the highlight color for :TypeOf, since you seem to be familiar with it ;)
<hasbrown_delight>
maybe that's just a standard Vim color
sheijk has joined #ocaml
<hasbrown_delight>
(nevermind, found the docs)
bytbox has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
bytbox has quit [Remote host closed the connection]
ontologiae has joined #ocaml
vincom2 has quit [Ping timeout: 244 seconds]
reventlov has quit [Ping timeout: 258 seconds]
sivoais has quit [Ping timeout: 272 seconds]
diethyl has quit [Remote host closed the connection]
diethyl has joined #ocaml
sivoais has joined #ocaml
reventlov has joined #ocaml
vincom2 has joined #ocaml
bytbox has joined #ocaml
<hasbrown_delight>
companion_cube: sorry to keep bothering you, but do you know how to direct Merlin to find the .cmt files of all the libraries I have installed already?
<companion_cube>
hmmmm it should not be necessary
<companion_cube>
the .cmi should be enough if you add PKG foobar in the .merlin
bytbox has quit [Remote host closed the connection]
<hasbrown_delight>
It doesn't appear to be the case. For example, package mirate-net-xen and mirage-net-unix are both in my .merlin file, but :Locate gives: "Needed cmt file of module 'Ipv4' to locate 'Ipv4.Make' but it is not present"
<hasbrown_delight>
and, FWIW, :locate on the Printf constructor gives "'Printf' seems to originate from 'Printf' which could not be found"
nop0x07bc has joined #ocaml
<smondet>
hasbrown_delight: yes :Locate want to find the source, so it would need more than the .cmi files
<smondet>
s/want/wants/
<hasbrown_delight>
you know, the name Merlin evokes such hope... I assumed everything would just 'magically' work
<hasbrown_delight>
Any idea how to tell it where to find the proper files for all libraries/packages I have installed so it just does?
<ggole>
You should still be able to use completion, error checking etc
<ggole>
But location and opam packages is a bit of a fiddle at the moment
<hasbrown_delight>
Completion seems to work
<hasbrown_delight>
But :Locate definitely does not :-\
<hasbrown_delight>
So I take it that I should not expect it to work right now?
<ggole>
There's an open issue on making that more seamless.
<hasbrown_delight>
hmmm OK
<hasbrown_delight>
ggole: since you seem to be familiar with Merlin, do you know how to change the colors used for TypeOf highlighting? Is it just referencing a standard Vim color?
<ggole>
I'm afraid I'm not sure since I use merlin from emacs ;)
<hasbrown_delight>
Oh no! I'm surrounded by heathens!
<hasbrown_delight>
Who know more than I do! ;)
<hasbrown_delight>
I kid, I kid...
qiukun has quit [Ping timeout: 260 seconds]
<ggole>
It's just customizing a variable here, I suspect it's similarly easy on the dark side.
<ggole>
Don't know the details though. Sorry.
<hasbrown_delight>
OK, I think it's just using the standard color scheme then
<hasbrown_delight>
thanks
<hasbrown_delight>
(for future reference, it is indeed using Vim's highlight color scheme, with the 'EnclosingExpr' highlight group)
ontologiae has quit [Ping timeout: 245 seconds]
<hasbrown_delight>
OK, ggole, one more question: what is the actual command to open type completion? If you know in vim... I'd just like to remap it to some other key sequence
<hasbrown_delight>
(nevermind, one more Vim-specific issue :). Disregard.)
<ggole>
Yeah, no idea on that one.
<hasbrown_delight>
OK, I think I have a reasonable IDE set up for OCaml now. Thanks for Merlin (am I correct in assuming you are the author?).
<Unhammer>
should -1 be the same as (0-1) ?
<Unhammer>
utop[79]> UTF8.look "meh" -1;;
<Unhammer>
Error: This expression has type int -> BatUChar.uchar
<Unhammer>
but an expression was expected of type int
<Unhammer>
as expected
<Unhammer>
but
<Unhammer>
utop[82]> UTF8.look "meh" (0-1);;
<Unhammer>
- : BatUChar.uchar = UChar.of_char '
morphles has quit [Ping timeout: 245 seconds]
<Unhammer>
(that's a NUL, if irc doesn't show it)
<ggole>
Nah, that's mostly def`. I added a few patches for the emacs side of things.
<ggole>
Unhammer: <expr> -1 will unfortunately be parsed as <expr> - 1
<ggole>
You need to parenthesize.
<Unhammer>
utop[87]> UTF8.look "meh" (-1);;
<Unhammer>
- : BatUChar.uchar = UChar.of_char '
<Unhammer>
ok
manud has joined #ocaml
<Unhammer>
ugh that's probably a sign I should get to bed =P
ontologiae has joined #ocaml
oscar_toro has joined #ocaml
tristero has quit [Remote host closed the connection]
oscar_toro has quit [Ping timeout: 258 seconds]
oscar_toro1 has joined #ocaml
nojb has joined #ocaml
mseve has joined #ocaml
<nlucaroni>
it's annoying an upgrade to ocamlfind requires complete rebuild of opam installed packages. Is there any plan to add build tools/dependencies to the opam files to signify they aren't library dependencies?
BitPuffin has quit [Remote host closed the connection]
xs_ has joined #ocaml
bytbox has joined #ocaml
badon_ has joined #ocaml
badon has quit [Ping timeout: 244 seconds]
badon_ is now known as badon
tane has quit [Quit: Verlassend]
<smondet>
nlucaroni: I think I've heard something about that yes, "build-only" dependencies
milosn has quit [Remote host closed the connection]
milosn has joined #ocaml
bytbox has quit [Remote host closed the connection]
bytbox has joined #ocaml
bytbox has quit [Remote host closed the connection]
rand000 has quit [Quit: leaving]
lordkryss has quit [Quit: Connection closed for inactivity]
artagnon has joined #ocaml
<artagnon>
Can I get oasis to build cpp sources independently and link it to the executable?
<artagnon>
There's only a CSources directive; adding a .cc source file there doesn't seem to build it.
Simn has quit [Quit: Leaving]
manud has joined #ocaml
<Drup>
more knowledgeable people will confirm, but afaik, you can't link any C++ with ocaml
<companion_cube>
hasbrown_delight: oh sorry, I don't use :Locate so I thought it would work with only .cmi (as for completion) :/
<hasbrown_delight>
no worries, I got it all sorted out
<companion_cube>
hasbrown_delight: completion should be c-x c-o
<hasbrown_delight>
Drup: for sure oyu can: just export "C" those functions
<companion_cube>
(although I've been using supertab for so long that I just use tab naturally)
<artagnon>
Drup: I don't want to link it with OCaml, but with the generated LLVM.
<Drup>
hasbrown_delight: yeah, ok, you can do that, that's linking through the C API, and OCaml can link with stuff respecting the C api, yes.
<hasbrown_delight>
I realized that Omnicomplete is actually a "legit" feature of Vim and merlin just extends it
<Drup>
that's not exactly the same than linking with C++ directly
<artagnon>
Right.
<Drup>
artagnon: I see, I don't know :(
<hasbrown_delight>
Sure. You might also be able to declare those functions as __cdecl and link directly
<Drup>
as I said, I'm not knowledgeable in these questions
<artagnon>
Hm.
<whitequark>
Drup: you can totally link C++.
<whitequark>
the easiest way is to pass -cc g++ to ocamlopt
hhugo1 has quit [Quit: Leaving.]
<artagnon>
I've done that, but oasis doesn't seem to pick up my .cc files at all.
<Drup>
whitequark: huum, what is impossible with C++ then ?
<whitequark>
Drup: nothing?
<whitequark>
artagnon: maybe use the .cpp extension?
<whitequark>
it may be a problem of OASIS.
* artagnon
nods
<hasbrown_delight>
well, it is Turing-complete, so you're not wrong...
* artagnon
tries
<Drup>
whitequark: no I mean, what's impossible in making OCaml and C++ collaborating
<artagnon>
Nope, it's still not compiling the file.
<Drup>
you can't really bind C++ functions directly, iiuc, you need to go through C
<whitequark>
Drup: oh, sure, you need to declare them as extern "C"
xs_ has quit [Ping timeout: 246 seconds]
<Drup>
whitequark: once, I emitted the idea of writing an LLVM pass in OCaml, and you told me it was crazy and I could never call it back to C++, did I misunderstood ?
<Drup>
(and it was also stupid, because I could just call it from OCaml and be done, but that's another thing)
<artagnon>
I can't seem to make it a library either, because it wants an .ml interface (or something)
<artagnon>
Drup: Objects in OCaml aren't converted to C objects for free.
<whitequark>
Drup: what artagnon says is the culprit.
<Drup>
artagnon: that's obvious
<whitequark>
you'd need to wrap every C++ thing in LLVM-land into something to make it manipulable by your OCaml code
<whitequark>
and existing bindings don't help you much here, as they're centered around IR emission
<whitequark>
not transformations
<artagnon>
Right.
<artagnon>
I'm writing a plugin: a gc.
<whitequark>
indeed, those interfaces aren't exported in LLVM-C at all
MercurialAlchemi has quit [Ping timeout: 260 seconds]
shinnya has joined #ocaml
<artagnon>
I need to write C++ and link it to LLVM libs.
<Drup>
"(12:25:33) whitequark: you do realize you can't make ocaml emit a shared object that clang can load?"
<Drup>
right, so yes, I misunderstood
<artagnon>
I'm trying to emit that shared object.
<Drup>
(note: this is from 4/4/2014 :D)
<artagnon>
Library.
<whitequark>
Drup: actually I now think that is wrong
<artagnon>
Unfortunately, the Library directive demands a Module directive pointing to a .ml file.
<whitequark>
well
<whitequark>
I was tasked with emitting a shared object a C++ library can load :D
<artagnon>
It has nothing to do with ocaml.
eugene_klm has quit [Ping timeout: 258 seconds]
<artagnon>
Oh.
<whitequark>
I believe you can do -output-obj and then cc -shared it.
<whitequark>
however you're left with the data representation problem
<Drup>
whitequark: who gave you such a task and how is it possible you didn't scream in horror ? :D
eugene_klm has joined #ocaml
<Drup>
I just realized I can cut the number of functor by 2 in tyxml, reduce the number of type annotation and make library author happier. What I don't realize is how the fuck I didn't saw it before
oriba_ is now known as oriba
<whitequark>
oh whoa
<artagnon>
To top off my problems, the oasis homepage is down.
<artagnon>
Where can I find llvm/CodeGen/GCStrategy.h other than the sources?
bytbox has joined #ocaml
<artagnon>
Is it in the llvm distribution that comes with `opam install llvm`?