<gasche>
(I can attest that companion_cube and Drup are not physically the same person)
* adrien
pictures companion_cube and Drup merging like in Dragon Ball
<companion_cube>
eww
<companion_cube>
anyway, this mail has triggered "interesting" discussions before it was even sent, so my wish is fullfilled.
thomasga has joined #ocaml
zRecursive has left #ocaml []
agnoctone has joined #ocaml
_andre has joined #ocaml
Simn has joined #ocaml
nikki93 has quit [Remote host closed the connection]
<rks`>
gasche: question for you
<rks`>
merlin users regularly complain about grammar inconsistencies between camlp4 and ocaml − they complain because they're used to camlp4, and merlin has (more or less) the same parser as the compiler −
maufred has quit [Ping timeout: 264 seconds]
maufred_ has quit [Remote host closed the connection]
maufred has joined #ocaml
<rks`>
so we started a wiki page recensing these inconsistencies
<appleby>
I have ocaml installed on my mac but I cannot find the graphics library
<adrien_oww>
it's not unlikely it's not installed on mac, maybe it's not ported
<adrien_oww>
(it might require X11)
<adrien_oww>
can you find other modules like Unix or Str?
<appleby>
how do I test that
<bernardofpc>
speaking of graphics
<appleby>
I'm running ocaml toplevel in eclipse
<bernardofpc>
what are the usual/useful GUI libraries for OCaml
<bernardofpc>
?
<Drup>
appleby: is "#load "graphics.cma";;" in the repl working ?
<pippijn>
bernardofpc: lablgtk
<appleby>
when I type that I getError: Unbound value load
<pippijn>
appleby: include the #
<Kakadu>
bernardofpc: Also you can consider QtQuick
mmachenry has joined #ocaml
<appleby>
- : string = "#load \"graphics.cma\";;"
<pippijn>
Kakadu: is it usable for medium scale applications, nowadays?
axiles has joined #ocaml
<Drup>
appleby: don't use eclipse.
<appleby>
ok
<Kakadu>
I think so. The problem is that nobody need graphics library for OCaml
<pippijn>
appleby: do not include ""
<appleby>
just terminal?
<Kakadu>
appleby: yep
mmachenry has quit [Client Quit]
<Drup>
appleby: run "ocaml" in your terminal, yes
<pippijn>
rlwrap ocaml
<bernardofpc>
there are no GUI programs in OCaml ?
<appleby>
k
<appleby>
done
<pippijn>
bernardofpc: there are
<appleby>
drup should I not at least use eclipse as an editor
<pippijn>
bernardofpc: most were done with lablgtk
<appleby>
even in terminal I get
<appleby>
Error: Unbound value load
<Kakadu>
appleby: don't forget about #use "topfind";;
<appleby>
I type that and I get Error: Unbound value load
<Drup>
I don't think you need topfind for that
<appleby>
Error: Unbound value use
<bernardofpc>
appleby: use the #
<appleby>
so type a hash after the hash prompt?
<bernardofpc>
yes
<Drup>
yes !
<Drup>
x)
<bernardofpc>
unfortunately, this is a very bad convention for prompt and commands
<appleby>
ok
<appleby>
after the load nothing happens
<Drup>
it's normal
<bernardofpc>
this is probably good sign
<appleby>
after #load "graphics.cma";; nothing happens, is that
<appleby>
ok
<Drup>
then try to use Graphics.open_graph " 640x480";;
<flux>
long tradition of unix to shut up if nothing goes wrong :-)
<appleby>
sweet, I love this irc
<appleby>
so many helpful people
<appleby>
how do I find graphics.mli on my filesystem though
<appleby>
I can't even find it
<Drup>
I know nothing about mac, so can't help you with that part
<flux>
appleby, find / -name graphics.mli should find it..
<flux>
though there are probably other faster ways
dant3 has quit [Remote host closed the connection]
<flux>
technically it's possible you don't have graphics.mli in your mac, depending on how it has been installed. it is not essential for ocaml to function.
<appleby>
even though the load was probably successful, it's possible that I don't have it?
<Drup>
.mli is the source
dant3 has joined #ocaml
<Drup>
you don't need the source, only the compiled file
<appleby>
oh okay
<appleby>
what are .ml then
<appleby>
the compiled files?
<Drup>
another source :)
<flux>
.mli is the interface, .ml is the code
<ggole>
.mli is to .ml roughly as .h is to .c
<flux>
so similar, but completely different ;)
<ggole>
(Except .mli files are compiled, not included.)
<adrien_oww>
Kakadu: it's not that most people don't need GUI stuff written in OCaml
<adrien_oww>
it's that it's a domain most people doing OCaml will do their best to avoid
<flux>
maybe he's using some system that automatically generates the output from his input? and his installation was missing that package..
<appleby>
okay
<adrien_oww>
Drup: errr
kaustuv has joined #ocaml
<adrien_oww>
appleby: no, after '#use "topfind";;', you're supposed to '#require "graphics";;'
<adrien_oww>
appleby: "#require", *not* "#use"
<adrien_oww>
appleby: how did you install?
<appleby>
i got it working a while ago...
<Drup>
adrien_oww: calm down, read everything.
<Drup>
:)
<adrien_oww>
:D
<adrien_oww>
still, it's #require! :D
<bernardofpc>
what's the difference ?
<Drup>
adrien_oww: and look at bernardofpc's link, you are responsible of lablgtk tutorials :p
<adrien_oww>
I'm not!
<adrien_oww>
well
<kaustuv>
Is there a way to check that a source file conforms to the language as of version 3.12.1 without installing 3.12.1 and opam switching? Ideally something that can be added to a commit hook?
<adrien_oww>
I'm supposed to make a new one but time has been scarce; should be during february
<Drup>
bernardofpc: one is using ocamlfind, the other is praying for all the path to be set up correctly
<kaustuv>
Is there a way to get ocamlopt to produce a statically compiled binary, or a Linux tool that turns a dynamically linked program into a static one?
dant3 has joined #ocaml
<adrien_oww>
errr
<adrien_oww>
kaustuv: ocamlopt links statically
<adrien_oww>
at least for OCaml libraries
dant3 has quit [Remote host closed the connection]
<flux>
well, there's statifier but in my experience it doesn't work
<adrien_oww>
and for C libraries it will depend on your C linker flags
<kaustuv>
Right, I meant for non-ocaml dependencies
<flux>
who knows maybe statifier works nowadays
<mfp>
off the top of my head, -cclib -static
<kaustuv>
Thanks, I'll try that
dant3 has joined #ocaml
<mfp>
not 100% effective with libc though
dant3 has quit [Read error: Connection reset by peer]
<flux>
suggested working solution: bundle libraries with your app and either provide a script that sets up LD_LIBRARY_PATH, or use -Wl,-rpath during linking?
dant3 has joined #ocaml
<flux>
I think many apps have ended up with that buindling&script wrapper solution..
<flux>
(ie. games)
<kaustuv>
OK, -ccopt -static worked. Thanks mfp and others.
<flux>
nice
mika1 has quit [Quit: Leaving.]
dant3 has quit [Ping timeout: 260 seconds]
cdidd has joined #ocaml
<kaustuv>
produces lots of scary warnings about functions like gethostbyname()
<mfp>
kaustuv: you might still need to ship libc with the executable and use LD_LIBRARY_PATH or -rpath, though. Some functions (IIRC gethostbyname) need the actual dynlib
<mfp>
righto, /me should read while typing
arjunguh_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dant3 has joined #ocaml
<kaustuv>
It's a simple text muncher that should not need any of the dynamic functions being complained about. It seems to work in a place that has a different C library version from where I compiled it.
<kaustuv>
That's all I needed, basically.
arjunguha has joined #ocaml
dant3 has quit [Ping timeout: 240 seconds]
agnoctone has quit [Quit: Page closed]
axiles has quit [Ping timeout: 272 seconds]
axiles has joined #ocaml
kaustuv has left #ocaml []
lostcuaz has joined #ocaml
mmachenry has quit [Quit: Leaving.]
appleby has joined #ocaml
mmachenry has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
dant3 has joined #ocaml
avsm has quit [Quit: Leaving.]
dant3_ has joined #ocaml
dant3 has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
dant3_ has quit [Ping timeout: 248 seconds]
appleby has quit [Quit: appleby]
mcclurmc has joined #ocaml
appleby has joined #ocaml
watermind has joined #ocaml
ontologiae_ has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
<ygrek>
fwiw, it is possible to link everything statically except glibc, but then one has to take care to link against pretty old glibc version
appleby has quit [Quit: appleby]
mmachenry has quit [Quit: Leaving.]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
mmachenry has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
mchqwerty has quit [Quit: Odcházím]
mort___ has quit [Quit: Leaving.]
jpdeplaix has quit [Ping timeout: 252 seconds]
FreeArtMan has quit [Ping timeout: 245 seconds]
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<caseyjames>
Hi, I recently used opam to install a new version of OCaml, what command do I use to switch the compiler? opam init --comp 4.01.0 is not working
<bernardofpc>
opam switch I gues
<caseyjames>
how do I do that?
<companion_cube>
opam switch 4.01.0
<caseyjames>
oooh. thank you
Thooms has joined #ocaml
<bernardofpc>
anyone has any idea on "removing optional arguments from a function" ?
appleby has quit [Quit: appleby]
<companion_cube>
you can do it by ?foo:None ?bar:None
<companion_cube>
but it's not very handy
<bernardofpc>
yeah
<bernardofpc>
sad that optional arguments don't generate function subtyping
caseyjames has quit [Ping timeout: 245 seconds]
dant3 has joined #ocaml
<companion_cube>
I don't know how tractable that would be
<companion_cube>
but indeed, ?foo:'a -> 'b -> 'c may be a "subtype"(?) of 'b -> 'c
<companion_cube>
well I guess the call convention isn't the same, actually
<adrien>
bernardofpc: it's not a translation of a C tutorial but a from-scratch one which starts with the nice lablgtk API instead of the C one
<adrien>
and you'll soon love GPack.vbox' ~packing argument
<bernardofpc>
adrien: many thanks ;-)
<adrien>
it's 10 minutes roughly :)
<bernardofpc>
well, I'm having problems with it right now
<adrien>
hmm, look at the tutorial and let me know if you're still confused
<bernardofpc>
ok
<bernardofpc>
I'll re-read it
<adrien>
I meant, mine :P
<adrien>
it's mostly done but I've been told that the pony in the background was a bit disturbing ='(
<bernardofpc>
it is
<bernardofpc>
because it's not declared before (at least in an understandable way)
<mmachenry>
adrien: Thanks. Do you use Glade in OCaml at all?
<adrien>
it's not, the poney comes from my ~/.gtkrc
<bernardofpc>
oh dear
<adrien>
I need a visual theme with thick window borders actually
<orbitz>
Hrm, i'm getting a bucnh of these errors
<orbitz>
/tmp/cctsMxHM.o:(.data+0x1498): undefined reference to `mlre2__escape'
<bernardofpc>
adrien: also, you should ignore Gtkinit :D
<adrien>
(otherwise it's difficult to distinguish between the windojws background and the browser background)
<orbitz>
core_extended deepnds on re2, which is a c language bindigns, and it doesn't like me
<orbitz>
anyone expereinced this?
<adrien>
mmachenry: no, I'm not fond of it; I find it doesn't bring much most of the time
<adrien>
mmachenry: at least when you don't derive your GUI from machine-generated data
<adrien>
I think I'm going to try to spend more time on lablgtk during february; depends on what happens during fosdem
<companion_cube>
what a skillfull wheel-crafter this adrien is!
<companion_cube>
he even crafts tutorials with ponies :p
mreca has joined #ocaml
Kakadu has quit [Quit: Page closed]
<adrien>
ponies are awesome!
<bernardofpc>
WinForms^WLablgtk2 -> intended, I presume, but I see no point in fact of remembering it :D
<adrien>
it's merely a string ;-)
<bernardofpc>
adrien: box#coerce -> you probably should explain what that does...
<adrien>
right
<bernardofpc>
(and I see perfectly why you were bothering with tons of arguments to a function :D)
<adrien>
for now, just use it as "copy-paste
<orbitz>
Hrm, how does -lfoo_stubs get added?
<adrien>
(but all it does is give you the underlying gtk object instead of ocaml's and later on in the tutorial, you're encouraged to avoid that)
<adrien>
orbitz: ocamlobjinfo foo.cma
<adrien>
automagic
<orbitz>
argh
<bernardofpc>
adrien: I understood in the toplevel :D
<adrien>
:)
<bernardofpc>
(I wrote the function without the #coerce, bang error)
<bernardofpc>
btw, you should add the #use/#require qvb for toplevel testing while reading :D
<orbitz>
Is there a good standaloen shell interface for ocaml? core_extended is turnign into a bitch
<orbitz>
not sure why it cannot find re2 thouhg...
<bernardofpc>
(dunno how to say "qvb" in english :/)
<bernardofpc>
"appropriate" does not convey the same idea :D
<adrien>
bernardofpc: hmmm, maybe I can #coerce someone like Drup into adding support for GTK+'s HTML5 backend in ocsigen and then use that as inline examples :P
<companion_cube>
there's shcaml, but not sure how good it is
<bernardofpc>
I have managed to make with passing vbox#pack as argumen, but that feels wrong in O
<bernardofpc>
bject Oriented thinking to pass methods instead of the objects
<adrien>
don't focus on object-oriented programming in Lablgtk
<adrien>
do the way you want
<adrien>
and #packing:vbox#pack is a good way to do it
<bernardofpc>
yeah, but this code does not compile
<adrien>
the nicer part is that you can do partial application with ~expand
<bernardofpc>
(this is the code I wanted it worked...)
<adrien>
(checking)
<adrien>
you're going to hate the answer
<bernardofpc>
I know
<adrien>
let build_row (vbox : GPack.box) label initext =
<adrien>
annotation
<bernardofpc>
oh
<bernardofpc>
right
<adrien>
I don't have the issue often
<adrien>
I think it's because I'm using a different style:
<bernardofpc>
that's probably my first needed annotation (other from performance reasons on compare or < )
<adrien>
basbasically:
<adrien>
let build_row ~packing label initext = let hbox = GPack.hbox ~packing () in
<adrien>
argh
<adrien>
basically:
<adrien>
let build_row ~packing label initext =
<bernardofpc>
yeah
<adrien>
let hbox = GPack.hbox ~packing () in
<bernardofpc>
I did notice that if I passed vbox#pack as argument it worked
<bernardofpc>
didn't know that named arguments can be easy to capture-pass
<adrien>
I'm unable to tell you about the theory behind this
<bernardofpc>
(never used optional args 1h before :d)
<adrien>
:)
<bernardofpc>
(make it 1h30, I encoutered the problem 21:43, logs don't lie)
mreca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bernardofpc>
will use that ~packing, seems the best way forward
<companion_cube>
I think the theory is simple: the system needs to be able to make the distinction between "the default value is used" and "this is a partial application"
<companion_cube>
?a:ta -> ?b:tb -> c is mostly useless because it will be a partial application unless all arguments are explicitely provided
<adrien>
companion_cube: hmmm, for requiring type annotations when passing objects in arguments
<bernardofpc>
companion_cube: as I said, the good theory would subtype functions with optional arguments :D
nikki93 has joined #ocaml
<companion_cube>
adrien: I don't think it's ever needed in theory
<companion_cube>
in practice you may want it if you don't want to kill yourself because of error messages
appleby has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
sillyotter has joined #ocaml
<Drup>
"GTK+'s HTML5 backend " <- what ?!
<Drup>
adrien ^
sillyotter has quit [Client Quit]
<def-lkb>
Drup: broadway
appleby has quit [Quit: appleby]
dant3 has joined #ocaml
dant3 has quit [Ping timeout: 252 seconds]
axiles has quit [Quit: Quitte]
Yoric has quit [Ping timeout: 252 seconds]
<adrien>
grrr, lag
<adrien>
companion_cube: hmmm, maybe
malo has quit [Quit: Leaving]
clan has quit [Quit: clan]
saml has quit [Quit: Leaving]
Eyyub has quit [Ping timeout: 264 seconds]
travisbrady has quit [Quit: travisbrady]
nikki93 has quit [Remote host closed the connection]
dsheets has joined #ocaml
mmachenry has quit [Quit: Leaving.]
clan has joined #ocaml
Yoric has joined #ocaml
dant3 has joined #ocaml
clan has quit [Ping timeout: 272 seconds]
thomasga has joined #ocaml
dant3 has quit [Ping timeout: 252 seconds]
sagotch has quit [Quit: Page closed]
darkf has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nlucaroni has quit [Quit: leaving]
manud has quit [Ping timeout: 252 seconds]
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arjunguha has joined #ocaml
Thooms has quit [Ping timeout: 272 seconds]
ollehar has quit [Ping timeout: 265 seconds]
ulfdoz has joined #ocaml
Eyyub has joined #ocaml
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jonludlam has joined #ocaml
Simn has quit [Quit: Leaving]
Qrntz has quit [Ping timeout: 252 seconds]
dant3 has joined #ocaml
mcclurmc has quit [Remote host closed the connection]