gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
mjonsson has joined #ocaml
cthuluh has quit [Remote host closed the connection]
<_y_> k, in case anyone was curious, those exceptions were thrown as a result of the code that was running inside of the interpreter, and the exit(2) was called because my Toploop.read_interactive_wait replacement was returning (_,false) when it was done running... I fixed the latter by declaring and registering an exception in the OCaml code, RolfQuitInterpreter, and had my readerwait callback raise the named exception when it was done
<_y_> as for the former, evidently I can not use the standard output functions (e.g. Printf.printf) inside of this application, or perhaps I need to do some more digging to enable this, but at any rate I'll just declare a new Ida pervasive module that has replacements for these things that route through my custom formatter
<_y_> to summarize: I have now watched it work! thanks for the occasional bit of advice, and mostly for allowing me to ramble
<_y_> one more question I guess ... I notice that if I spawn my plugin, unload it, spawn it again, unload it again, ... that IDA's memory consumption count grows, which implies that the memory associated with the OCaml interpreter is not being freed... I probably forgot to call some C function after the interpreter was finished executing that would take care of cleanup; some function that's the opposite of caml_startup_code
<_y_> anyone know such a function
<orbitz> wall of text!
<_y_> indeed; apologies for my verbose questions
<orbitz> i do not have answers for you, soryr. i'm relativly new to ocaml
verte has joined #ocaml
verte has left #ocaml []
ldunn has joined #ocaml
ldunn has quit [Changing host]
ldunn has joined #ocaml
dark has joined #ocaml
_y_ has quit []
_andre has quit [Quit: leaving]
solidus-river has joined #ocaml
<solidus-river> i've never written a program using multiple languages, how would i go about writing a mainly C++ program witch some functions written in OCAML, i know this is done with bindings but i'm not sure beyond that
<orbitz> solidus-river: WHy not just write all of i tin ocaml?
<solidus-river> orbitz: i'm in the very early stages of planning a game engine, there are some aspects of it that i think would be much easier to write in c++ and have been proven to work, if i go for doing the whole thing in ocaml i'm afraid it will blow up in my face, i'm not confident enough in my knowledge of the languages to do that
<orbitz> solidus-river: from what I udnerstand teh C interface is a bitch in ocaml
<solidus-river> orbitz: damn :\
<orbitz> writing yoru entire game engine in Ocaml shoudl be possible
<orbitz> migth be a bit much for a first project thouhg
xcthulhu has joined #ocaml
<solidus-river> well i was planing on doing it in SDL but i can only find OPENGL and alsa bindings for ocaml
<orbitz> GUI's in Ocaml are generally consiered a bitch too
<orbitz> might want to go with Haskell or some kidn of lisp
<solidus-river> haskell seems to work well but i woudl have preferred an object oriented language
xcthulhu has quit [Quit: Ex-Chat]
xcthulhu has joined #ocaml
<thelema> orbitz: the C interface isn't so bad from the ocaml side, but I just wrestled with it from the C side (specifically C++) and couldn't get it to work...
<thelema> so I gave up and have main() in ocaml
<solidus-river> i'm reading up on ocaml's sdl implementation, i'm thinking it might be good to do all implementation in ocaml
<solidus-river> however there are problems with ocamls sdl implementation and compiling it on windows
ulfdoz has joined #ocaml
avsm has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
avsm has quit [Client Quit]
joewilliams is now known as joewilliams_away
<adrien> solidus-river: how could you do it all in ocaml? :o
mjuad has quit [Ping timeout: 240 seconds]
mjuad has joined #ocaml
verte has joined #ocaml
verte has left #ocaml []
iratsu has quit [Ping timeout: 265 seconds]
ldunn has quit [Read error: Connection reset by peer]
ldunn has joined #ocaml
Yoric has joined #ocaml
xcthulhu has quit [Quit: Ex-Chat]
Gooffy has joined #ocaml
iratsu has joined #ocaml
CoryDambach has quit [Quit: Leaving]
ulfdoz has quit [Ping timeout: 265 seconds]
ygrek has joined #ocaml
ttamttam has joined #ocaml
Yoric has quit [Quit: Yoric]
strlen has quit [Ping timeout: 265 seconds]
strlen has joined #ocaml
verte has joined #ocaml
verte has left #ocaml []
sohum_ has joined #ocaml
sohum_ has quit [Changing host]
sohum_ has joined #ocaml
solidus-river has left #ocaml []
Gooffy has quit [*.net *.split]
hto has quit [*.net *.split]
npouillard has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
LionMadeOfLions has quit [*.net *.split]
rwmjones has quit [*.net *.split]
sohum has quit [*.net *.split]
brendan has quit [*.net *.split]
noj has quit [*.net *.split]
ttamttam has quit [*.net *.split]
mjonsson has quit [*.net *.split]
kaustuv has quit [*.net *.split]
f[x] has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
init_ has quit [*.net *.split]
rudi_s has quit [*.net *.split]
Fullma has quit [*.net *.split]
tmaeda has quit [*.net *.split]
MarcWeber has quit [*.net *.split]
svenl_ has quit [*.net *.split]
ttamttam has joined #ocaml
mjonsson has joined #ocaml
kaustuv has joined #ocaml
f[x] has joined #ocaml
hyperboreean has joined #ocaml
init_ has joined #ocaml
rudi_s has joined #ocaml
Fullma has joined #ocaml
tmaeda has joined #ocaml
MarcWeber has joined #ocaml
svenl_ has joined #ocaml
Gooffy has joined #ocaml
hto has joined #ocaml
npouillard has joined #ocaml
Asmadeus has joined #ocaml
rwmjones has joined #ocaml
noj has joined #ocaml
brendan has joined #ocaml
LionMadeOfLions has joined #ocaml
ikaros has joined #ocaml
eldragon has quit [Read error: Connection reset by peer]
eldragon has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
eldragon has quit [Read error: Connection reset by peer]
banisterfiend has joined #ocaml
banisterfiend has left #ocaml []
dark has left #ocaml []
eldragon has joined #ocaml
oriba has joined #ocaml
fabjan has joined #ocaml
ldunn has quit [Remote host closed the connection]
<kaustuv> f[x]: the tests you(?) wrote for signalfd in extunix don't respect the semantics of signalfds, which don't guarantee that signals are delivered in the same order as they are sent.
<f[x]> kaustuv, hm, yes, there is nothing about order in signalfd man page..
<f[x]> it mentions something about queueingm but anyway this is a test for the binding, not for the signalfd itself, so I will fix it now
<kaustuv> The test itself might be OK because the signals are being sent from a single thread. However, in my own use of signalfds, if the signals come from different processes then the order is unpredictable even if the procs don't send the signals simultaneously.
<f[x]> oh, and this reminds of forgotten blocking_section, thanks again :)
<kaustuv> It makes the flags parameter less opaque
<f[x]> why not reuse flags from Unix?
<kaustuv> Because not all fd flags are valid, but that's a possibility too
<f[x]> ouch, it doesn't support CLOEXEC
sohum_ is now known as sohum
<f[x]> but it can be set with ordinary set_close_on_exec
<kaustuv> Right, the point of these flags is to prevent one ioctl(), but frankly, I doubt the usefulness of counting system calls for application code.
<kaustuv> err, s/ioctl/fcntl/
<f[x]> this can be important, but less so for ocaml, and especially for creating signalfds
* f[x] thinks maybe it is better to raise Unix_error(EINVAL) instead of Failure in unlikely case that signalfd_read fails with less then SSI_SIZE bytes read?
<kaustuv> That situation would mean a probably kernel bug, so it hardly matters what failure condition is used.
<f[x]> or passed fd was not signalfd :)
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 255 seconds]
Yoric has joined #ocaml
th5 has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
ftrvxmtrx has joined #ocaml
Fullma has quit [Ping timeout: 276 seconds]
stdDoubt has joined #ocaml
Fullma has joined #ocaml
<stdDoubt> how to create a class that has a reference to an element of the same type (without the value escaping the class) - for instance a node of a linked list that has to fields the object that contains and a link to the next node -> basically my doubt is how to create it in ocaml without the self value escaping the class
<flux> stddoubt, maybe this helps: you can, before the class definition, define a type like type 'a generic_list = End | Value of ('a * 'a object_list) and use that polymorphic type to refer to itself in a polymorphic manner. afterwards you can define type object_list = my_class generic_list
<stdDoubt> thanks. So in this cases where there are references to the same class we should use an hybrid solution by using types?
<flux> hmm.. I'm not sure what you mean. were you aware of syntax: class foo = object (self : 'self) .. (* 'self now refers to the object's type *)
<stdDoubt> yes I am... I am using as toy problem a construction of simple interpreter to get acquainted with ocaml oo functionalities. I am creating an environment and I need to define the current parent level
<stdDoubt> the code that is giving me a hard time is
<stdDoubt> class ['a] environment parent =
<stdDoubt> object (self:'self)
<stdDoubt> val mutable currentLevel: (string*'a) list = []
<stdDoubt> val parent:'self = parent
<stdDoubt> ...
<stdDoubt> method beginScope = new environment self
<stdDoubt> ... end;;
<stdDoubt> because in the beginScope primitive when I try to return the new environment level the compiler complains self can escape its class
<stdDoubt> my doubt is how to avoid this situation...I have been reading the manual ... coercions here dont make any sense...I would like an elegant solution (like almost everything I have learned about ocaml so far)...thanks
<flux> well, for that particular case, wouldn't method beginscope = {< parent = self >} work?
<flux> I'm sure there is another way but I don't recall it :)
<stdDoubt> but in that case we also need a new current level
ikaros has quit [Quit: Leave the magic to Houdini]
<flux> well, works the same way, yes?
<stdDoubt> method beginScope = {< parent = self; currentLevel = [] >}
<flux> yes
<stdDoubt> is it possible to do it imperatively?
<flux> hm, I don't think so
<flux> you need {< >} to create a new cloned instance
<flux> and you cannot modify another instance's attributes (there is no syntax for that)
<flux> (anyone, feel free to correct my if I'm wrong ;-))
<stdDoubt> then the only way would be to create the parent instance variable as a ref?
<flux> well, as said, I'm (relatively) sure there's a way to do it with new, given some type annotations..
<flux> but other than that, yes
rgrig has joined #ocaml
mikemc has joined #ocaml
rgrig has quit [Quit: Leaving]
heller has left #ocaml []
ygrek has joined #ocaml
Asmadeus has quit [Remote host closed the connection]
Asmadeus has joined #ocaml
Fullma has quit [Quit: Fullma]
stdDoubt has quit [Ping timeout: 240 seconds]
oriba_ has joined #ocaml
oriba has quit [Read error: Operation timed out]
Amorphous has quit [Ping timeout: 265 seconds]
Amorphous has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
stdDoubt has joined #ocaml
oriba_ is now known as oriba
Oddmonger has joined #ocaml
<Oddmonger> hello
boscop has quit [Ping timeout: 245 seconds]
<Oddmonger> i come back here with my unison problem. I think i've found what's wrong
<Oddmonger> it seems to have an issue with ocmal gtk2 wrapper
boscop has joined #ocaml
<Oddmonger> unison (whatever version i use : 2.27, 2.32 ..) doesn't succeed in redirecting term output
<Oddmonger> the "Password:" prompt of an interactive ssh transaction
<Oddmonger> so it gets stuck on the dialog box which tell that a connexion is on the way
<Oddmonger> if you use "ltrace" with unison, the "Password:" prompt appears in the term, and you can enter your password (of course)
<Oddmonger> so i think i's an issue with lablgtk2
<Oddmonger> so i tried to recompile lablgtk2
<Oddmonger> and (that why i'm here) , all i got was a lousy
<Oddmonger> ml_gobject.c:292:14: erreur: conflicting types for ‘g_value_get_variant’
<Oddmonger> /usr/include/glib-2.0/gobject/gvaluetypes.h:230:17: note: previous declaration of ‘g_value_get_variant’ was here
<Oddmonger> ml_gobject.c:380:13: erreur: conflicting types for ‘g_value_set_variant’
<Oddmonger> /usr/include/glib-2.0/gobject/gvaluetypes.h:226:13: note: previous declaration of ‘g_value_set_variant’ was here
<Oddmonger> (nobody care on google)
<flux> oddmonger, to me it looks like either ml_gobject.c is generated (in a buggy fashion) or that ml_gobject.c must match a certain version of glib..
<flux> (disclaimer: I didn't look at the source ;-))
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
<Oddmonger> it seems to have a lot of problems with latest versions of ocaml compiler
<Oddmonger> i did'nt understand how Arch-Linux mainteners manage to compile their lablgtk2 though
Yoric has quit [Client Quit]
Yoric has joined #ocaml
<Oddmonger> i think i will stuck to "ltrace" warkaround, or i will disable interactive mode, just using keys on restricted profile
<flux> maybe they have patches?
<Oddmonger> flux: i use "ABS" system for compile, which should put me in same conditions than Arch mainteners, so patches should be applied
<adrien> Oddmonger: the lablgtk error is fixed in recent versions
<Oddmonger> i verified , there is a patch for ocaml3-12 in the source tree
<adrien> lablgtk used a name that is now used by glib/gtk iirc
<Oddmonger> adrien: ah, good new
<Oddmonger> i'll try to get it on official site then
<adrien> there was also a bug which appeared with ocaml 3.12 and which required a snapshot of lablgtk2 for some time but now the latest version available solves both issues
<Oddmonger> in Arch, it's version 2.14.1
<Oddmonger> and on official website it 2.14.2
<Oddmonger> so 2.14.2 is ok , and not 2.14.1 ?
<Oddmonger> well i give a try
<Oddmonger> ok it seems to work
<adrien> =)
mjonsson has quit [Remote host closed the connection]
<flux> quite an unfortunate naming convention, g_xxx, given glib uses it..
<Oddmonger> i make a package for Arch, it could be useful for others
<Oddmonger> i'll put it on AUR
<Oddmonger> thank for helping
<flux> no problem! although my pieces of advice were mostly misleading ;)
<adrien> flux: someone forgot to prefix the functio name ;-)
<adrien> Oddmonger: :-)
<stdDoubt> Is there any graphical debugger for ocaml (for instance like ddd)?
<flux> I don't think so
<flux> there is one memory debugging tool with graphical visualization, ocamlviz
<adrien> not aware of something as comprehensive as ddd, however (* trying to remember some names *)
<flux> ocaml-mode comes with camldebug for emacs as well. doesn't look very visual to me (just tried it).
<flux> also buggy in the caml-debugger buffer
tseno has joined #ocaml
<adrien> ah, wanted to mention http://ocamlviz.forge.ocamlcore.org/ too, it's not strictly a debugger but it can help
tseno has quit [Client Quit]
cods has joined #ocaml
ikaros has joined #ocaml
macciej has joined #ocaml
<macciej> Hi. I have a question
<macciej> Please, write for me the shortest code for finding how many 0s are in n!
joewilliams_away is now known as joewilliams
Gooffy has quit [Quit: Leaving.]
macciej has quit [Quit: Page closed]
agolsme has quit [Quit: leaving]
ttamttam has quit [Remote host closed the connection]
<manveru> can anybody recommend a small web server i can experiment with?
<hcarty> manveru: For OCaml projects?
<manveru> yeah
<hcarty> ocamlnet has a server framework
<manveru> i tried building ocsigen, but they got tons of dependencies...
<hcarty> GODI should help with that
<manveru> what's that?
<f[x]> manveru, there exist ocaml-http and cohttpserver
<hcarty> It builds OCaml and a large number of OCaml packages from source
<manveru> thanks
<manveru> i tried making packages for some of the ocsigen dependencies and ocigen itself, it just turned out to be a lot of work that i'd like to avoid... just starting to learn ocaml
<hcarty> manveru: GODI is probably your best bet in that case
<hcarty> Ocsigen and its dependencies are among its available packages
<hcarty> among GODI's available packages that is
<manveru> awesome
<manveru> and it builds all into my $HOME, incredible :)
<adrien> btw, I have around 85 packages installed through godi here, it's a nice tool :-)
<manveru> heh
<manveru> i gave up after js_of_ocaml...
<manveru> make OCAMLFIND_LDCONF=ignore OCAMLFIND_DESTDIR="$pkgdir/usr/lib/ocaml/site-lib/" DESTDIR="$pkgdir/" BINDIR="$pkgdir/usr/bin/js_of_ocaml" install
<hcarty> It's a more advanced task, but it's even relatively straightforward to setup your own local packages
<manveru> was just too much
<manveru> yeah
<manveru> i'm using a similar tool for ruby
<manveru> so i really appreciate this... you should see the messy packaging in Go :)
<hcarty> OCaml packaging should become significantly better once OASIS and OASSIS-DB take off
<hcarty> (project by gildor to create an easier OCaml build system and a CPAN-like system for OCaml packages)
asmanur_ has joined #ocaml
asmanur has quit [Ping timeout: 250 seconds]
ftrvxmtrx has quit [Quit: Leaving]
<Oddmonger> good bye!
Oddmonger has left #ocaml []
th5 has quit [Quit: th5]
<flux> how can one contribute?
<flux> (to OASIS & -DB)
<hcarty> flux: It sounds like gildor is getting ready to roll out a new release of OASIS soon
init1 has joined #ocaml
oriba has quit [Quit: Verlassend]
ygrek has joined #ocaml
Yoric has quit [Quit: Yoric]
ulfdoz has joined #ocaml
Edward__ has joined #ocaml
init1 has quit [Quit: Lost terminal]
init1 has joined #ocaml
ftrvxmtrx has joined #ocaml
infoe has joined #ocaml
drunK has joined #ocaml
ulfdoz_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 276 seconds]
ulfdoz has quit [Ping timeout: 265 seconds]
ulfdoz_ is now known as ulfdoz
init1 has quit [Quit: Lost terminal]
dark has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
stdDoubt has quit [Quit: Leaving]
ccasin has quit [Quit: Leaving]
<dark> is there an easy way to do something like sh's `command` in ocaml? (I suppose it's Unix.open_process* family)
<dark> actually what I'm looking is something like realpath(1) or realpath(3) in ocaml
<gildor> dark: Sys.command ?
<dark> I see some ad-hoc things here http://docs.camlcity.org/docs/godisrc/unison-2.27.57.tar.gz/unison-2.27.57/fspath.ml but I really want to call realpath(3)
<dark> problem with Sys.command is, I want the output
<gildor> http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=extunix/extunix.git;a=commit;h=2280a8ead9582cde08d60474a70c6559c36233d5
<gildor> realpath implementation for ocaml
<dark> awesome, thanks
<gildor> or
<dark> thelema: ^^ I vote that for batteries (can be just Unix.realpath)
<gildor> ocaml-fileutils: FileUtil.readlink
<gildor> dark: ^^^
Edward__ has quit []
<dark> well I have readlink already, but realpath is more complex than that
<dark> you need to get the current directory too, and you need to do some normalization stuff
<dark> realpath /home//all/ -> /home/all
<gildor> so have a look at extunix
<dark> I'm interested mostly in the normalization
<gildor> flux: contributing to OASIS -> use it in some of your project and see what is missing for your own use
ulfdoz has quit [Ping timeout: 276 seconds]
roconnor has joined #ocaml
<roconnor> is it just me or is ocaml-tutorial's section on Functors kinda terrible?
<dark> the build system of extunix has no make DESTDIR=.. .., but the setup.ml has some let destdir = ..
<gildor> ;-)
<gildor> ocaml setup.ml -configure --prefix XXX
<dark> ah, hm
<gildor> or maybe ./configure --prefix XXX
<gildor> (./configure seems more common)
<gildor> destdir <> prefix BTW
<dark> has --prefix the same meaning of a DESTDIR? (--prefix usually changes the static computed paths, and DESTDIR usually just changes the installation directory)
<hcarty> roconnor: It is kind of terrible
<dark> maybe ./configure --destdir .. ?
<hcarty> roconnor: IIRC, Jason Hickey's book has a nice section on functors
<gildor> dark: indeed
<gildor> and it is implemented like that in the build system
<gildor> but for library, you want to override OCAMLFIND_DESTDIR
<gildor> make install OCAMLFIND_DESTDIR=XXX
<roconnor> hcarty: thanks
<dark> hmm, o.o yeah.. (I'm trying to create an ebuild for gentoo)
<gildor> OCAMLFIND_DESTDIR is what we used to build Debian package
<dark> and, findlib eclass does that, export OCAMLFIND_DESTDIR=${D}${destdir}..
<gildor> dark: everything explained here
<dark> thanks =)
<gildor> http://oasis.forge.ocamlcore.org/MANUAL.html#building-and-installing is probably the most relevant part for you
<hcarty> gildor: Is there a changelog (WIP or final) for OASIS 0.1 -> 0.2?
<gildor> hcarty: yes
<dark> so there are two package systems, oasis and godi?
<gildor> hcarty: ^^^
<gildor> dark: no, OASIS take care of building a single package
oriba has joined #ocaml
<hcarty> gildor: Thank you!
<dark> godi would be more like hackage?
<gildor> GODI is a distribution system (e.g. it builds a lot of packages, including ocaml itself and C libraries)
<dark> on top of oasis
<roconnor> gildor: how is oasis and ocamlfind related?
<gildor> GODI is older than OASIS, but one day, they will interact
<gildor> and you can use OASIS standard entrypoints to create GODI packages
<gildor> roconnor: oasis relies on ocamlfind for libraries
<gildor> roconnor: and writes META file to create new libraries that will integrate with the other ocamlfind libraries
<gildor> (and use ocamlfind install to install these new libraries)
<roconnor> gildor: I've never seen an oasis package I don't think. What libraries use it?
<hcarty> roconnor: OASIS is rather new
<roconnor> oh good
<hcarty> roconnor: But very promising
<roconnor> I mean good that I didn't miss it or something
<dark> this extunix library is using it, but it was not released yet.. i'm installing from git
* roconnor recently spend many weeks packaging many ocaml libraries for NixOS
<dark> if it delivers something like cabal will be a nice addition =)
<dark> I was to try nixos, but haven't got past the minimal setup
<gildor> roconnor: ounit, ocaml-data-notation, cryptokit...
<roconnor> dark: I've been using NixOS for a year
<gildor> roconnor: I will update this web page ASAP
<gildor> roconnor: ^^^
<dark> the documentation isn't as complete as gentoo's u.u (or I haven't found it)
<roconnor> hmm, ounit was one of the things I had to package
<gildor> the version 1.1.0 use OASIS
<gildor> but you maybe package an older version
<roconnor> hmm
<roconnor> I packaged 1.0.3
<roconnor> I thought that was the latest version
<gildor> roconnor: ^^^
<gildor> (but I release it myself 2 weeks ago)
<roconnor> I did this packageing a month or two ago
<dark> I packaged about 5 ocaml libraries I'm using, with gentoo. It's easy. I know packaging it on nixos is easy too, but I have found too much foreign concepts..
<gildor> dark: one of the point of OASIS is to provide standard entry points to build OCaml project
<roconnor> oh I just copied my ounit package from when Marco packaged it for NixOS
<gildor> (whatever the build system is)
<roconnor> thanks everyone
roconnor has quit [Remote host closed the connection]
<dark> yeah, darcs is at a point where an ebuild can be generated from it
iago has joined #ocaml
<gildor> dark: I think you can use _oasis to generate an ebuild as well
<gildor> dark: an in OASIS v0.2.0 you have an "oasis query Version Package" that can read the _oasis from command line and output whatever field you want
<dark> oasis does not recognize --prefix=.., just --prefix ..
<gildor> dark: indeed
<gildor> it uses OCaml Arg module which doesn't parse thing like getopt
Yoric has joined #ocaml
<adrien> going to bed right now but still wondering if the only way to get a really nice command-line option parsing is to actually create a small language for it
<dark> I dunno, but compatibility with autotools is a must (or at least pseudo-compatibility)
<dark> oasis recognizes more-or-less obscure configures like --mandir dir
<gildor> more or less, I just make it look like, trying to minimize changes
<dark> are you the oasis author?
<gildor> yes
<dark> thing is, gentoo calls econf. econf calls ./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib
<dark> I am trying to figure out what can I do
<dark> I could patch the configure to sed 's/=/ /g' - ugly..
<dark> I could read the docs in order to know how econf get those options :), ..
<gildor> read the doc <- probably best option ;-)
<dark> (and pass them in the correct syntax)
<adrien> Array.from_list (List.flatten (List.map (fun e -> Str.split (Str.regexp "=") e) (Array.to_list Sys.argv)))
* adrien hides
<dark> I'm reading the docs, I wasn't even aware that econf was called
<gildor> dark: submit a feature request here https://forge.ocamlcore.org/tracker/?atid=294&group_id=54&func=browsehttps://forge.ocamlcore.org/tracker/?atid=294&group_id=54&func=browsehttps://forge.ocamlcore.org/tracker/?atid=294&group_id=54&func=browse
<gildor> sorry double paste
<dark> ok=)
<gildor> It won't be in 0.2 but I can think about it for 0.3
<dark> it's harder to do because you can't have some dependency on gnu parsing lib, right?
<gildor> I don't think it is too much work
<dark> i think it's getopt
<gildor> dark: no I will go the Str.split way
<gildor> we cannot load C libraries or thing like that
dcolish has quit [Ping timeout: 252 seconds]
<gildor> or maybe, I will just patch the configure script so that it uses getopt from here
dcolish has joined #ocaml
<dark> can you just use shell script? oasis is supposed to be shellscript-free
<dark> or hm
<gildor> configure is a shell script
<dark> the configure thing is for unix compatibility
<gildor> but it is generated by a plugin, it is not a mandatory script
<gildor> however, having something called configure, we should make it as much as possible autoconf like
<dark> ok. maybe the setup.ml thing isn't supposed to be autotools-compatible anyway.
<gildor> indeed
<dark> to open a new ticket one has to have an account?
<gildor> yes
<gildor> (last time it was open, some spambot open something like 200 tickets)
ikaros has quit [Quit: Leave the magic to Houdini]
ikaros has joined #ocaml
<dark> btw, suppose the oasis package has some C component. is --host=.. passed passed to the C compiler?
<dark> gentoo has issues with nonstandard (i.e. non-autotools) build systems because of its cross-compiling support
<dark> (but this is maybe not relevant, since ocamlopt would have to support it too..)
<gildor> right question and right answer
<gildor> for now cross-compiler using ocaml are not very common
<dark> but with ocamlc, the sole nonportable thing could be some C thing. (But I don't know if something compiled by ocamlc can load native C code..)
<gildor> in the future, if this is an issue, I will pass the option
<gildor> but since this is ocamlopt that called gas, you'll need to patch ocamlopt as well
<gildor> dark: if you have real issues/examples, submit it to the BTS, so that I can have real world example to work on
<dark> ok. (the real issue is that extunix is actually written in C, but I'm not doing cross-compiling right now)
<gildor> you should be able to compile extunix
<dark> I'm! :)
<dark> (after installing ounit)
<gildor> it works ?
<dark> i will pass the configure line explictly
<dark> oh no
<dark> ACCESS DENIED mkdir: /usr/share/doc/extunix during make install
<dark> just because i did make doc
<dark> i.e. the make install for the ocaml findlib part is fine, but for the doc part, it haven't respected my destdir preferences
<dark> and anyway I want to install the doc myself..
<dark> I think I know what I will do. I will do make, then the findlib stuff, then make doc, then install the doc myself
<gildor> yes, you can do that
<gildor> but submit a bug, about the install not respecting the destdir
<dark> making the doc at install phase is ugly, not sure if it will work..
<dark> ocaml-fileutils had a very similar build structure, with a _build directory and a findlib.doc symlink.. maybe it used oasis too and I didn't know?
<dark> but with fileutils I had to patch the Makefile, because it called install without looking for $(DESTDIR)
<dark> - $(INSTALL) -d $(htmldir)/api, + $(INSTALL) -d $(DESTDIR)/$(htmldir)/api etc
<gildor> I am also upstream author of ocaml-fileutils
<dark> oh ok, :) http://paste.pocoo.org/show/278608/ the patch
<gildor> yes, that true
<dark> not sure if it will behave ok without DESTDIR set
<gildor> nevermind, the next version will use oasis
<dark> oh, it uses a kind of proto-oasis?
<gildor> the DESTDIR stuff should be $(INSTALL) -d $(DESTDIR)$(htmldir)/api
<dark> hm yes, htmldir begins with a /.. but on unix //a is /a
<gildor> kind of the start of trying to understand all the issues you can have with a build system ;-)
<gildor> not yet finished
<dark> is you the author of extunix too?
<gildor> basically the DESTDIR is something that you append at the beginning
<dark> are you
<gildor> but append like in text append
<gildor> dark: I have contributed some patches to extunix as well and I am listed in the admin
<dark> hmm. so DESTDIR is supposed to contain an / in the end, if it is a directory?
<gildor> DESTDIR -> I think so
<ezyang> Is there a way to combine ocamlc -c foo.ml and ocaml -o foo foo.cmo ?
<dark> ocaml -o foo foo.cmo..?
<gildor> ezyang: ocaml -o foo foo.ml
<ezyang> According to the OCaml book I'm reading...
<ezyang> that generates the intermediate byte code.
<gildor> ocamlc -o foo foo.ml
<ezyang> But that's good. Thanks!
<hcarty> ezyang: Use ocamlopt in place of ocamlc for native code compilation
<ezyang> Is there a runocaml of some sort?
<hcarty> ezyang: ocamlrun
<ezyang> Cool.
<dark> gildor: can you look this "make doc makes make install want to install at /usr/share without looking for a destdir" at extunix? (or does it look for a destdir? because my configure passes a lot of --*dir options..)
<hcarty> If you look at the first line of the bytecode output, it has a #! line pointing to ocamlrun
<ezyang> I'm working on an "OCaml for Haskellers" cheatsheet.
<dark> ok, actually I pass --datadir=/usr/share, I think it had no way to know.. so, hmm..
<dark> but findlib_src_install sets the OCAMLFIND_DESTDIR variable and calls make DESTDIR="${D}" "$@" install || die "make failed", so yes, it is ignoring the destdir thing for the doc installation (but not for the findlib-aware installation)
<dark> so the makefile should have something to read DESTDIR
<dark> like install: setup.data .. $(SETUP) -install $(INSTALLFLAGS) --destdir $(DESTDIR)
<gildor> make install destdir=XXX
<dark> in lowercase?
<gildor> yes
<dark> again a autotools difference, no? (since make is also supposed to be a compatibility layer)
<gildor> yes, but this one will be fixed in setup.ml
<gildor> and oasis is not really autotool compatible
ikaros has quit [Quit: Leave the magic to Houdini]
<dark> yes
<dark> I will comment this issue on that ticket
_andre has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
cthuluh has joined #ocaml
<dark> btw extunix works =)
<gildor> at least you get something at the end ;-)
<ezyang> If I use let ... and ... can I be assured that all of the values will be updated at once (that is, nothing gets shadowed until the end)
<dark> Error: Variable a is bound several times in this matching
<dark> so, I think yes
<dark> (with let a = 1 and a = a + 1 in a)
<ezyang> Cool.
cthuluh has quit [Read error: Operation timed out]
cthuluh has joined #ocaml
<ezyang> Does 'A' .. 'Z' desugar into something or is it just syntax sugar for match?
<gildor> you can do match x with 'A' .. 'Z' -> ?
<ezyang> According to this book I can... ^_^
<gildor> you make me learn something
<gildor> (and indeed you can)
<ezyang> ha
<ezyang> Meh, I can't do let f 0 = 1 and f 1 = 2. That makes pattern matching args... not so useful.
<gildor> let f = function 0 -> 1 | 1 -> 2
<ezyang> yeah
Yoric has quit [Quit: Yoric]
<ezyang> Hm, Does OCaml do explicit type signatures?
<dark> yes, with .mli files
<hcarty> ezyang: You can (ex: let f (x : int) : int = x + 2)
<dark> or with let a : type = ..
<hcarty> dark's answer is the better way, generally (.mli)
<ezyang> ah, ok. I was wondering if there was a way to do it inline not hcarty's way.
<dark> you can see the most general inferred types with ocamlc -i file.ml
<ezyang> (like the ::). mli sounds god.
<ezyang> *good
<dark> :: from haskell?
<dark> haskell just reversed : and :: roles, against god's will
<ezyang> Yup.
<ezyang> haha
<ezyang> Eta expansion is strange. Does OCaml support polymorphic values (as opposed to functions)?
<ezyang> I guess that's not very interesting if you don't have typeclasses.
<dark> hm, \x . f x <--> f is not always true, even if f is a function o.o (sometimes f will not terminate but fun x -> f x will)
<ezyang> because OCaml is strict, no?
<dark> I suppose yes, but I don't really understand this
<dark> I came to contact with this at fix's definition
<dark> the haskell way has a simpler time but does not terminate in ocaml. or something like that
<dark> simpler type*
<ezyang> Yeah, I'm pretty sure this has to do with strictness versus laziness.
<ezyang> The same way fun () -> x is different from x
<ezyang> (if x is an expression that doesn't terminate)
oriba has quit [Quit: Verlassend]
<ezyang> Are OCaml refs threadsafe?
rmitt_ has joined #ocaml
<rmitt_> my ocaml implementation crashes fatally if I try to access module Lazy. Any reason why? Thx.
<mfp> rmitt_: which OCaml version, on which platform?
<rmitt_> downloaded via Ubuntu's synaptic package manager. Just a sec and I'll check the details...
<rmitt_> actually I'm no longer sure I got it that way
<rmitt_> version 3.11.2
<mfp> I can't see any recent bug involving Lazy in the BTS; the closest one is http://caml.inria.fr/mantis/view.php?id=4141, which was fixed long ago
<rmitt_> I assume that's the right web page to report this new bug, then?
<mfp> FWIW I'm using Debian's 3.11.2 (which is IIRC where ubuntu's taking its OCaml packages from) on linux x86-64 and x86 w/o any problems w/ Lazy
<mfp> yes
<mfp> that's the official BTS
joewilliams is now known as joewilliams_away
rmitt_ has quit [Quit: Page closed]
ftrvxmtrx has joined #ocaml