gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
oriba_ has joined #ocaml
oriba has quit [Read error: Operation timed out]
oriba_ is now known as oriba
cdidd has joined #ocaml
ankit9 has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
WoosterB2 has joined #ocaml
WoosterB2 has left #ocaml []
andreypopp has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
ankit9 has quit [Ping timeout: 246 seconds]
eni has joined #ocaml
<Ptival> what are the compiler options to use with Graphics?
andreypopp has quit [Quit: Quit]
ankit9 has joined #ocaml
zorun has quit [Quit: leaving]
silver has joined #ocaml
andreypopp has joined #ocaml
ggherdov has joined #ocaml
ggherdov has left #ocaml []
snearch has joined #ocaml
<adrien> Ptival: graphics.cmxa or graphics.cma
<adrien> nothing particular
Zedrikov has joined #ocaml
snearch has quit [Quit: Verlassend]
zorun has joined #ocaml
xlq has joined #ocaml
avsm has quit [Quit: Leaving.]
<adrien> oasis only installs libraries through findlib, right?
avsm has joined #ocaml
datkin has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
endre_ has joined #ocaml
endre_ has left #ocaml []
avsm has joined #ocaml
ankit9 has quit [Read error: Connection reset by peer]
william3 has joined #ocaml
ankit9 has joined #ocaml
<william3> Hello,
<william3> I am developing a cross toolchain that compiles windows binaries from linux. For the experts, it is mingw-cross-env,
<william3> based on mingw-w64, with gtk2, ocaml, and lablgtk2 cross-compiled. With this, that should be easy (sic) to compile
<william3> ocaml programs that use c libraries both for linux and windows. So far, I have managed to compile every components, but
<william3> when I try to compile a lablgtk2 program, I get :
<william3> i686-w64-mingw32-ocamlfind opt -o out.native -linkpkg -package lablgtk2 hello.cmx
<william3> ** Fatal error: Cannot resolve symbols for /home/performance/src/mingw-cross-env-i686/usr/i686-w64-mingw32/lib/libgtk-win32-2.0.a(gtkimcontextime.o/
<william3> libstatic_im_multipress_la-gtkimcontextmultipress.o/
<william3> libstatic_im_multipress_la-immultipress.o/
<william3> gtkimcontextthai.o/
<william3> ):
<william3> _ImmGetCompositionStringW@16
<william3> _ImmGetContext@4
<william3> _ImmGetConversionStatus@12
<william3> _ImmGetOpenStatus@4
<william3> _ImmNotifyIME@16
<william3> _ImmReleaseContext@8
<william3> _ImmSetCandidateWindow@8
<william3> _ImmSetCompositionFontA@8
<william3> _ImmSetCompositionStringW@24
<william3> _ImmSetCompositionWindow@8
<william3> _ImmSetConversionStatus@12
<william3> _ImmSetOpenStatus@8
<william3> File "caml_startup", line 1, characters 0-1:
<william3> Error: Error during linking
<william3> is there an expert on this subject ? where does that come from ? ocaml, lablgtk2, gcc? gtk2? mingw-w64?
_andre has joined #ocaml
<f[x]> therse are windows functions
<william3> yes, I have just found this out. So, anyone has an idea how to fix this?
<f[x]> search what library in mingw provides them
<f[x]> should be smth like imm32.lib
<f[x]> and find out why it was not included at linking step
william3 has quit [Ping timeout: 252 seconds]
lihaitao has joined #ocaml
lihaitao has quit [Remote host closed the connection]
ankit9 has quit [Quit: Leaving]
william3 has joined #ocaml
Kakadu has joined #ocaml
<william3> @ f[x] : thanks
lihaitao has joined #ocaml
<william3> Hello,
<william3> I am developing a cross toolchain that compiles windows binaries from linux. For the experts, it is mingw-cross-env,
<william3> based on mingw-w64, with gtk2, ocaml, and lablgtk2 cross-compiled. With this, that should be easy (sic) to compile
<william3> ocaml programs that use c libraries both for linux and windows. So far, I have managed to compile every components, but
<william3> when I try to compile a lablgtk2 program, I get :
<william3> i686-w64-mingw32-ocamlfind opt -o out.native -linkpkg -package lablgtk2 hello.cmx 01:12:38 PM
<william3> ** Fatal error: Cannot resolve symbols for /home/performance/src/mingw-cross-env-i686/usr/i686-w64-mingw32/lib/libgtk-win32-2.0.a(gtkimcontextime.o/
<william3> libstatic_im_multipress_la-gtkimcontextmultipress.o/
<william3> libstatic_im_multipress_la-immultipress.o/
<william3> gtkimcontextthai.o/
<william3> ):
<william3> _ImmGetCompositionStringW@16
<william3> _ImmGetContext@4
<william3> _ImmGetConversionStatus@12
<william3> _ImmGetOpenStatus@4
<william3> _ImmNotifyIME@16
<william3> _ImmReleaseContext@8
<william3> _ImmSetCandidateWindow@8
<william3> _ImmSetCompositionFontA@8
<william3> _ImmSetCompositionStringW@24
<william3> _ImmSetCompositionWindow@8
<william3> _ImmSetConversionStatus@12
<william3> _ImmSetOpenStatus@8
<william3> File "caml_startup", line 1, characters 0-1:
<william3> Error: Error during linking 01:12:49 PM
<william3> is there an expert on this subject ? where does that come from ? ocaml, lablgtk2, gcc? gtk2? mingw-w64?
<william3> f[x] gave me an aswer, but just asking again, if someone had further explanations.
<thelema_> william3: the error message says that gtkimcontextime.o is missing some symbols.
<thelema_> this file seems to be a part of gtk2 (libgtk-win32-2.0.a)
<adrien> you'd have to add the right library to the list of libraries being linked in
<adrien> not sure if the .pc file for gtk+ shouldn't already do that
<adrien> which version of gtk+ is it btw?
<xlq> How fast is OCaml's exception handling?
<xlq> With zero-cost unwinding exception handling, as commonly used in C++, is very expensive if an exception is thrown, meaning in C++ exceptions tend to be used only for actual failures.
<xlq> In a language like Python, on the other hand, exceptions are very cheap, so they're used during normal execution.
<pippijn> in ocaml, they tend to be used for more than actual failures
<adrien> xlq: I don't have hard numbers but ocaml exceptions are *WAY* cheaper than C++ ones
<xlq> Yeah, like Not_found
<xlq> So it's OK to write code that uses exceptions during normal execution? OK.
<thelema_> ocaml's try registers an exception handler, and throw is little more than a jump and a stack pointer adjustment
<xlq> OK. Ahh the wonders of garbage collection ;)
william3 has quit [Ping timeout: 264 seconds]
<thelema_> xlq: and a very well implemented runtime
<Kakadu> btw, Who knows why development of https://github.com/OCamlPro/ocaml-reentrant was paused?
<thelema_> Kakadu: probably higher priorities or more interesting projects for the ocamlpro team
zorun has quit [Quit: leaving]
avsm has quit [Quit: Leaving.]
thelema_ has quit [Read error: Connection reset by peer]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
oriba has quit [Quit: oriba]
eikke has joined #ocaml
lihaitao has quit [Quit: Ex-Chat]
<adrien> you really only start loving OCaml after you've been prevented from using it
thelema has joined #ocaml
<NaCl> adrien: yes
<xlq> I still don't love it. I keep getting caught out by the grammar's lack of delimiters.
<thelema> xlq: add ( ) or begin/end
<pippijn> adrien: I disagree
<xlq> thelema: I know, but it's easy to forget.
<pippijn> adrien: that's the kind of "you don't know what you've got until it's gone" that does not apply to me
<adrien> I had been doing C++ before and didn't really feel it
<Qrntz> the «grammar's lack of delimiters» is a real pleasure for me compared to C++
<adrien> but today, I got back to ocaml
<pippijn> adrien: I have done C++ for years
<adrien> everything was working the first time and things were simple to do
<NaCl> And adrien was happy once again
<pippijn> adrien: when I started with ocaml, everything was working the first time and things were simple to do
<xlq> And, uh, "while !changed do" .. I read it as "while not changed" :(
<pippijn> </quote>
Tobu has quit [Ping timeout: 260 seconds]
<pippijn> adrien: and I cherished this fact from the second or third day I used ocaml
<Qrntz> xlq, excuse me, but isn't that how it should be read?
<xlq> Qrntz: No, it's "while changed". "!" in Caml is dereference, not "not".
<Qrntz> oh right, never mind
<Qrntz> I've been getting too little sleep lately
<xlq> It's not just me who reads it wrongly then :)
<Qrntz> «while changed.contents do»
<Qrntz> :-p
<adrien> pippijn: you mean that you haven't had to stop using ocaml for some time before loving it?
<pippijn> correct
<adrien> ah :-)
<pippijn> I loved it once I finished learning the basic syntax
<adrien> well, I meant: you really really really really really love ocaml only once you had to give it up a bit ;-)
<pippijn> I can't disagree lacking experience
<pippijn> but I have my doubts
<pippijn> for me, personally
<pippijn> maybe generally that's true
emmanuelux has joined #ocaml
Tobu has joined #ocaml
<adrien> lwt (version: 2.3.2)
<adrien> erf
<Qrntz> just in case anyone knows, is there any development going on behind jocaml?
<Qrntz> e. g. will it be updated to match ocaml 3.13 (aka 4.0), etc
<pippijn> what will be new in 3.13?
<adrien> pippijn: I've fought C++ and it took me hours to do some simple things last month; but maybe you already had that feeling well deep in your head ;-)
<adrien> pippijn: 4.00
<adrien> as for jocaml, it's updated albeit a bit slowly
<adrien> but I don't think it'd need a lot of work to be updated
<Qrntz> GADTs? lightweight first-class modules?
<Qrntz> I don't know really
<pippijn> what's new is 4.00?
<adrien> pippijn: read the changelog
<Qrntz> I'm just wondering if I can use jocaml in my further endeavors without fear of getting obsolete.
<pippijn> adrien: I know C++ fairly well and I have digged into some of its darkest corners
<adrien> it's really the only way to "know"
<adrien> too many things to mention
<Qrntz> it's still my favourite way for implementing concurrency
<adrien> Qrntz: there's not a huge amount of work behind jocaml but I don't think it'll die easily
<adrien> it might not get new shiny stuff but stop working? I don't think so
<Qrntz> adrien, thanks, that matters a lot to me
<Qrntz> the issue here is not it «stopping working», rather it getting unsupported; e. g. even now, you can't use topfind in the jocaml toplevel and nobody seems interested in fixing that
<adrien> well
<adrien> with the current situation, you pretty much know what to expect
<Qrntz> more or less.
<adrien> you won't get hand-holding; if that's fine with you, the situation probably won't get worse any time soon
<Qrntz> not interested in hand-holding; merely a language that's not considered a stale project :-p
<hcarty> Qrntz: I've emailed the authors with the same question in the past. They were honest and quick with their answer (at the time - it will lag official releases somewhat, but at the time there was no plan to stop development)
<hcarty> Qrntz: This was a year or two ago.
<Qrntz> hcarty, thank you
Kakadu has quit [Quit: Page closed]
<hcarty> Qrntz: You're welcome. If you ask again, please share the response :-)
<Qrntz> will do.
rwmjones has quit [Ping timeout: 256 seconds]
<xlq> May a record pattern list only some fields to match?
<hcarty> xlq: Yes. If you are using 3.12.0 or later you can be explicit about it.
<hcarty> let { x; y; _ } = it_has_xyz
<xlq> Hmm, perhaps I was using an older version before, because I couldn't get it to work.
<hcarty> Pre-3.12: let { x; y } = it_has_xyz (* May trigger a warning in 3.12+ *)
<hcarty> I think the warning is disabled by default in 3.12.x but may be enabled by default in later versions.
silver has quit [Ping timeout: 246 seconds]
william3 has joined #ocaml
xlq has quit [Ping timeout: 260 seconds]
silver_ has joined #ocaml
silver_ has quit [Remote host closed the connection]
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
<william3> thelema, adrien : thanks . I am using gtk2.14.2.
Anarchos has joined #ocaml
<adrien> where are the binaries from?
<william3> I am cross compiling lablgtk2, from the source code
<Anarchos> Where can i find an example on how to use marshalling ?
lorill has joined #ocaml
<adrien> william3: I mean: the gtk+2 binaries, where are they from? did you build them or are you reusing them?
<adrien> Anarchos: the Marshal module?
<william3> I am building them from the source repository
<adrien> can you pastebin the gtk+-2.0.pc file?
<Anarchos> adrien yes
<adrien> Anarchos: nothing besides the official doc; it's really very very "simple"
<adrien> and unsafe
<Anarchos> adrien i need to communicate with an ocaml application. For now, i just launch the toplevel in a process and redirect the stdin/stdout.... It is not very efficient !
<adrien> Marshal.from/to_channel, but the binary format is not usable from another language
<adrien> (or ocaml version)
<william3> adrien : http://pastebin.com/8BSqjL3P
<adrien> and do you know which object/library should be giving these functions on windows?
<william3> I have been told it was imm32.dll
<william3> and I am sure gtk2 works in the cross compilation environment, as I have already made a C test program
<Anarchos> adrien the compativility is not an issue for me.
<adrien> try editing the .pc file and add -limm32 after 'lgtk-${target}-2.0'
<adrien> Anarchos: your two apps are ocaml?
<william3> actually, there is no "gtk-${target}-2.0", and -limm32 is already after gdk-${target}-2.0
<adrien> hah, right, blind me =)
<adrien> hmmm, you have libimm32.a; use objdump or nm to get a list of the symbols there
* adrien has to go for now, be back in roughly one hour
<Anarchos> adrien no one is C++ (graphical interface)
<adrien> don't use Marshal then
<adrien> you'll die painfully
<adrien> try JSON (yojson) or XML (pxp, xmlm, tyxml maybe)
william3 has quit [Read error: Operation timed out]
zorun has joined #ocaml
william3 has joined #ocaml
xlq has joined #ocaml
<william3> adrien : thanks for your help. libimm32.a had all the symbols. But you were right to look into .pc files. Actually, they kept an old installation path,
<william3> but it has changed since. So when I told you gtk2 worked with a C program, I guess it would not now. I am going to changes the paths. Hope
<william3> this is it. Thanks
william3 has left #ocaml []
gnuvince has joined #ocaml
Tobu has quit [Quit: No Ping reply in 180 seconds.]
Tobu_ has joined #ocaml
ulfdoz has joined #ocaml
<adrien> always put ae'verything in /opt/something
<adrien> and not put that in your PATH by default but only on-demand
ggherdov has joined #ocaml
avsm has joined #ocaml
lorill has quit [Quit: Ex-Chat]
Tobu_ has quit [Ping timeout: 260 seconds]
ftrvxmtrx has joined #ocaml
Tobu has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 246 seconds]
ftrvxmtrx_ has quit [Ping timeout: 250 seconds]
Submarine has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 250 seconds]
_andre has quit [Quit: leaving]
Zedrikov has quit [Quit: Bye all, see you next time!]
<xlq> Are there eagerly evaluated boolean operators?
<thelema> xlq: let (||) x y = x || y
<pippijn> what about let (||) = (||)
<pippijn> or is that too transparent?
<thelema> at least "let eager_or x y = x || y"
<adrien> # let (||) = (||);;
<adrien> val ( || ) : bool -> bool -> bool = <fun>
<adrien> # true || (print_endline "pouet"; true);;
<adrien> pouet
<adrien> - : bool = true
<adrien> actually, I've failed :P
<adrien> I should go to bed, good night ;p
<adrien> unrelated to this: what non-ocamlfind-enabled libraries can you think of?
<adrien> lablgtk2, what else?
<xlq> thelema: How does that work?
<xlq> Why does redefining || to be the same thing suddenly make it eager? O_o
<thelema> xlq: it just makes a user function with the same name as || but since user defined functions can't short-circuit, it's eager
<pippijn> because then || is no longer built-in
<xlq> Oh, of course :D
<xlq> Yeah, the parameters are bound first.
<adrien> (I was curious, and no, I haven't failed in my example but I've failed on something else I haven't shown; so time to go to bed anyway ;p )
<thelema> adrien: good night
<adrien> thanks =)
ggherdov has quit [Read error: Connection reset by peer]
ggherdov has joined #ocaml
Anarchos has quit [Read error: No route to host]
kish has joined #ocaml
kish has left #ocaml []
Anarchos has joined #ocaml
gnuvince has quit [Ping timeout: 250 seconds]
<nimred> what's wrong when getting: http://sprunge.us/DOVE
<nimred> ?
<thelema> missing a -lX?
<xlq> -lXlib
<xlq> or -lX11?
<mrvn> +1
<xlq> pkg-config --libs x11
jave has quit [Ping timeout: 245 seconds]
smerz has joined #ocaml
jave has joined #ocaml
gnuvince has joined #ocaml
ggherdov has quit [Read error: Connection reset by peer]
nimred has quit [Quit: leaving]
nimred has joined #ocaml
cdidd has quit [Remote host closed the connection]
alxbl has joined #ocaml
alxbl has quit [Changing host]
alxbl has joined #ocaml
eni has quit [Quit: .]
xlq has quit [Ping timeout: 260 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]