2010-12-27

<gildor> hcarty: SCM browser on ocamlmpi, that is your problem
<gildor> hcarty: pong
<hcarty> s/parameters/functions/
<hcarty> mbac_: The Gc.get and Gc.set parameters may do what you want
<hcarty> gildor: ping
<hcarty> Unfortunately, the SCM browser on the forge says the ocamlmpi repository is empty
<hcarty> mrvn: There is a Some_val in ocamlmpi I think...
<hcarty> adrien: They do have a C interface. And it seems to use a large number of custom data types/wrappers.
<hcarty> flux: Yes, it would probably take a bit more than a weekend :-)
<flux> hcarty, maybe if the c++ binding generator tols/lins were more complete..
<flux> hcarty, tempting idea, but I sense it'd be a big project ;)
<hcarty> That could be a nice inclusion for Batteries
<hcarty> mrvn: It would be nice to have an option to list the default values, rather than having to update them manually.
<hcarty> mrvn: Ah, I see. Fair point.
<mrvn> hcarty: but it should alos list the default in the usage.
<mrvn> hcarty: if I have a reference
<hcarty> mrvn: Can you initialize a reference with the default value?
<hcarty> flux: opencv OCaml bindings sound like a wonderful project :-)

2010-12-26

<hcarty> thelema: It would be nice to make the process that simple
<hcarty_> thelema: Or possibly using a Perl-based installation script to build OCaml + Batteries
<thelema> hcarty_: I hope so.
<hcarty_> thelema: Pre-installed OCaml + oasis-db may make a Batteries install that easy.

2010-12-23

<notk0> hcarty, some code yes, but I think that most doesn't
<hcarty> notk0: And some code is easier to reason about in recursive form when you come back to it 18 months later :-)
<hcarty> notk0: It doesn't need to be - but it's nice to have a language with strong support for recursion.
<hcarty> notk0: -version
<hcarty> notk0: Also, if you are using OCaml 3.12.0 or later, you can take advantage of the local module open support - http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#toc77
<hcarty> adrien: Or that too :-)
<hcarty> notk0: It allows you to write #! "script"s in OCaml and it will compile silently in the background
<hcarty> notk0: Take a look at ocamlscript
<notk0> hcarty, oh my, I didn't know that
<hcarty> notk0: But in most code that's not an issue.
<hcarty> notk0: You could do "let a, b = 4, 5 in a + b"
<notk0> hcarty, you know what I don't like about ocaml tho?
<hcarty> Then all languages start to look a little more functional
<hcarty> notk0: It definitely is. Until you learn to think in a more OCaml-y way.
<notk0> hcarty, but I find ocaml a rather strange language compared to imperative ones
<hcarty> notk0: Ah, sorry - I'll quiet down :-)
<notk0> hcarty, I forgot to mention, I already use emacs and tuareg, hence my emacs question from before
<hcarty> notk0: There are one or two Eclipse plugins for working with OCaml, but they may not be maintained any more
<hcarty> But my understanding is that emacs is better for "the rest"
<hcarty> I'm not too concerned about the rest
<notk0> hcarty, I see
<hcarty> With the right configuration, both provide good syntax highlighting and indentation support.
<hcarty> notk0: I prefer vim, but emacs + tuareg is probably more complete in its support
<notk0> hcarty, so which is better emacs or vim?
<hcarty> notk0: Geany has passable syntax highlighting support for OCaml, but nothing can compete with the overall support in emacs and vim currently.
<notk0> hcarty, I would have to get the source for that right?
<hcarty> When learning how to properly craft a .mli file
<notk0> hcarty, I may take a look sometimes
<hcarty> notk0: I found the OCaml standard library's .mli files to be a good reference
<hcarty> notk0: And it can be used to restrict types somewhat (ex. 'a -> 'a to int -> int)

2010-12-22

<hcarty> pdhborges: Just for clarification - omake and OCamlMakefile/ocaml-make are two different things.
<hcarty> pdhborges: It really is tricky to get right. OCamlMakefile is quite straightforward to try, and it may help locate the error.
<hcarty> Or what adrien said :-)
<hcarty> oriba: ocurl maybe? I don't know about ocamlnet.
<hcarty> alpounet: Hello
<alpounet> hey hcarty :)
<hcarty> pdhborges: I think it has a "verbose" option, which may help. But I understand wanting to know why things are or are not working.
<hcarty> Example of compiling C bindings with OCamlMakefile, that is
<hcarty> It includes a nice example of C bindings
<hcarty> Particularly during early development
<hcarty> pdhborges: I recommend adrien's suggestion - OCamlMakefile
<hcarty> It has special targets for custom toplevels and lots of other goodies.
<hcarty> pdhborges: http://www.ocaml.info/home/ocaml_sources.html - ocaml-make on that page
<hcarty> adrien: Seconded! I was typing that out when you sent it :-)
<hcarty> pdhborges: I'd offer more direct assistance, but I'm unable to at the moment :-)
<hcarty> pdhborges: Getting linking right for C bindings can be tricky. If you haven't read it yet, this is an excellent reference: http://www.linux-nantes.org/~fmonnier/OCaml/ocaml-wrapping-c.php
<hcarty> pdhborges: The MPI bindings are older-fashioned (not a lot of use of the macros), but they may provide some inspiration - https://forge.ocamlcore.org/scm/browser.php?group_id=135
<hcarty> Ah
<hcarty> thelema: I didn't expect any changes on this front until 2.0
<hcarty> thelema: Has a direction for exception handling in future releases of Batteries been decided on? Exceptionless by default, exceptions by default with Exceptionless modules (like now), or provide both functions (foo and foo_opt or foo_exn depending on default) in the same module?

2010-12-21

<hcarty> opla2: In OCaml, it's "for i = 1 to 10 do"
<hcarty> And there is syntax for list comprehensions
<hcarty> But there is a ( -- ) operator
<hcarty> There is no ".." syntax
<hcarty> al-maisan: You're welcome, have fun :-)
<al-maisan> hcarty, adrien : thank you very much for the explanation!
<hcarty> al-maisan: Yes
<hcarty> al-maisan: It is an almost-synonym for "let () = ... in"
<hcarty> al-maisan: ";" can be used with imperitive code, when you only care about side effects
<hcarty> Not all entry points allow you to provide one
<hcarty> thelema: My concern with polymorphic map is that it seems difficult to use custom comparison functions
<thelema> hcarty: polymorphic map is good. in theory you could functorize, with the parameter being a functor itself. but polymorphism seems easier
<hcarty> I suppose one option is to use the polymorphic Map module.
<hcarty> I would like to create a module which includes functions which return maps keyed on strings. I would like to use the Map.Make functor, but avoid having the user tied to My_module.My_map. Is a functor the right way to go here, or are there other options?
<hcarty> adrien: Ah, ok. That's good to know.
<adrien> hcarty: dunno but type-conv won't build (haven't tried myself: was julm)
<hcarty> adrien: What/where are the incompatible camlp4 changes in 3.13?
<hcarty> adrien: That could be. My view of the issue is colored by being bitten by bugs in each release since the 3.10.0 old-camlp4 to new-camlp4 switch.
<hcarty> flux: Curses! :-)
<hcarty> :-)
<hcarty> I don't personally have any use for camlp5 (over camlp4). I'm just (very very mildly) bitter that I can't use some of the new 3.12 features with camlp4 (new version)
<hcarty> coq is my guess
<hcarty> flux: "let go" of syntax extensions in general?
<hcarty> flux: Indeed. It's just unfortunate that the more actively maintained version is the one which is not part of the core language.
<hcarty> But camlp5 seems to be more actively maintained.
<hcarty> camlp5 is now external to the main OCaml project, while the new camlp4 is internal
<flux> hcarty, internal vs external?
<hcarty> flux: And the internal vs external, from what I've seen regarding upkeep of the two
<hcarty> camlp5 does support the new syntax. That camlp* split is really unfortunate.
<hcarty> The short version is that "module type of ..." does not work under camlp4
<hcarty> Does anyone here know of a work-around for this bug: http://caml.inria.fr/mantis/view.php?id=5172

2010-12-20

<hcarty> blackswan1: You need to either "open Foo" in bar.ml or refer to foo in a fully qualified way - Foo.foo
<hcarty> alexyk: I haven't noticed a difference, but I haven't done any actual tests.
<Smerdyakov> hcarty, there is only Ur/Web now. You probably wouldn't want to try to use it for something else.
<hcarty> Smerdyakov: Is Ur useful outside of web development in its current state?

2010-12-17

<hcarty> sgnb: I think that was part of the problem I ran in to ... the latest Debian packages would build against the dev version of Ubuntu, but needed packaging patches to build against older releases.
<sgnb> hcarty: creating a PPA is indeed easy... mais Ubuntu is quite painful in general because there are multiple "live" versions
<hcarty> From what I recall, it was not terribly difficult
<hcarty> I got part way through setting up an Ubuntu OCaml PPA a while ago, before realizing that GODI was a better fit for what I needed.
<hcarty> avsm2, sgnb: An interested Ubuntu user may be able to create a PPA for the packages. I don't know how easy this is, but it's probably easier than doing everything by hand.
<gildor_> hcarty: what we need is to have access to the socket to call an Lwt_unix.read on it
<gildor_> hcarty: I think it is to transfer data from the socket to the userland
<hcarty> gildor_: I imagine all of the CURL_*FUNCTION portions could be useful
<hcarty> gildor_: CURL_WRITEFUNCTION and CURL_READFUNCTION are probably appropriate

2010-12-14

<hcarty> I'm off for a while, but feel free to leave/PM questions if you are interested.
<hcarty> If anyone here is interested in a US (Maryland/DC area) web development/design position in a relatively OCaml-friendly group: http://mdafederal.hrmdirect.com/employment/view.php?req=57304&

2010-12-13

<hcarty> flux: Nevermind - from the ltu comments it looks like it is
<hcarty> flux: Is the meta-future option the Oleg link you posted?
<hcarty> That's a good question :-)
<hcarty> adrien: My understanding is that most browsers have security layers which prevent that from happening.

2010-12-10

<hcarty> metropolis: Good luck on your quest to escape C++ :-)
<metropolis> hcarty: thanks!
<hcarty> metropolis: There are also JoCaml, camlp3l and ocamlmpi as options for message passing/multi-processing
<adrien> hcarty: yeah, of course, I started this the stupid way , I/O will be limitating anyway
<hcarty> Inset all elements from (1) in to the set, them check each element from (2) against the set
<hcarty> Or a set
<hcarty> adrien: Would a map or hash table work?

2010-12-09

<hcarty> Does Batteries have a string_printer-like function which does not quote strings? I'm looking for an equivalent to "let str_printer tuple out s = IO.nwrite out s"

2010-12-08

<ski> flux,hcarty,(palomer) : the corresponding Haskell of let apply (f : 'a. 'a -> unit) x = ..x.. works (with extensions, in e.g. GHC and Hugs)

2010-12-07

<hcarty> thelema: And thank you :-)
<thelema> hcarty: no problem
<hcarty> thelema: Of course... sorry, that should have been obvious
<thelema> hcarty: the map modules in batteries should order elements by the compare function, least to greatest

2010-12-06

<rixed__> hcarty: thx for remembering me about diml, and thx to him of course.
<hcarty> rixed__: You're welcome for what little I contributed though
<hcarty> rixed__: Glad it works! diml is probably the one who deserves credit though :-)
<rixed__> Ok with latest lwt my program works ! Thank you hcarty!
<palomer> hcarty, as a new feature; I think everything we need is already there
<hcarty> thelema: Each function using the elements from a given map in the same order
<hcarty> thelema: Do you know if all of the Map modules in Batteries order elements the same way when calling the keys, values, map and fold functions?
<hcarty> palomer: It wouldn't be hard to support rank-2 polymorphism with something currently in OCaml, or as a new feature?
<palomer> hcarty, come to think of it, it wouldn't be hard to support rank-2 polymorphism (which is what you're doing)
<rixed__> hcarty: no pb I sshed to a debian box and aptitude installed darcs. Now it's downloading. :)
<hcarty> rixed__: There were darcs binaries provided online at one point. I haven't used darcs in a long while though, so I don't know if they are still around.
<hcarty> rixed__: I haven't tried the latest, but it's on my TODO list.
<rixed__> hcarty: so you recommend using latest code then ? It frightened me at first since they apparently changed the low level part (for libev). Will try to get it from anothermachine because there is no way I install GHC on this host.
<hcarty> s/latest release/latest code/
<hcarty> rixed__: I would like to try the latest release as well though - there are apparently some nice fixes to the lwt-ized toplevel in the latest darcs
<hcarty> rixed__: So it's probably no better
<hcarty> rixed__: It's actually one release behind (2.1.0 instead of 2.1.1)
<rixed__> hcarty: maybe I should go for 3.12 if Lwt is more stable there. Because to access the darcs repo seams a little hard, considering my gentoo want to compile GHC first ;)
<hcarty> rixed__: Ah, ok. Thank you!
<rixed__> hcarty: I have GODI_SECTION = 3.11
<hcarty> rixed__: Rather, what section of GODI packages are you using
<hcarty> rixed__: What version of GODI are you using? I only see 2.1.0 in the OCaml 3.12 release packages
<hcarty> Or, rather, something which appears very close to that
<hcarty> flux: Particularly given that the manual has something VERY close to that as an example
<hcarty> flux: No, sadly not. I tried that before coming here :-)
<hcarty> palomer: Ok, thank you for the explanation! I clearly need to read up on some definitions.
<hcarty> to be able to use "let length x = apply Array.length x"
<hcarty> palomer: Avoid needing records at all
<hcarty> palomer: Thank you for the work-around though!
<hcarty> But sadly, it seems that it does not. At least not how I'm trying to do it :-)
<hcarty> palomer: I was hoping this would help avoid that http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#toc79
<hcarty> palomer: How do you mean? This is a simplified version of what I'm trying to wrap, but if records would help then I'm willing to try
<hcarty> albacker: It's the middle of the day for some of us :-)
<palomer> hcarty, why don't you use records?
<hcarty> albacker: That's an old version
<hcarty> adrien: I think you are correct
<hcarty> albacker: http://cristal.inria.fr/camlimages/eng.html -- there are two sites out there for camlimages, this one seems to be the more recent
<hcarty> It seems like it could be, but I haven't found a way to make it work
<hcarty> Is this possible in some form with the new 3.12 features? http://codepad.org/7upmf8Da

2010-12-02

<hcarty> That's too bad. It would make this (small) piece of code more readable.
<hcarty> With camlp4 in place (no extensions), the error is more explicit. You need a -> after a when
<hcarty> avsm2: I tried, and it still gives a syntax error
<hcarty> flux: A more reasonable example of what I'm trying to do is: match baz with | 1, a when a < 0 | 2, b when b > 0 -> true | _ -> false"
<hcarty> flux: In this case, I think I need to move all checks in to the when portion
<flux> hcarty, so you can do this instead: match baz with a, 0 | 0, a when a > 42 -> ..
<flux> hcarty, the when-statements are share between multiple patterns
<hcarty> That gives a syntax error
<hcarty> It appears you can't - "match (1, 2) with | 1, b when b < 3 | 1, b when b > 5 -> true | _ -> false"
<hcarty> Nevermind, the simplified case was wrong
<hcarty> krktz: Thank you!
<hcarty> krktz: Drat, you're right. I just tried a simplified version and it works.
<hcarty> It looks like you can't
<hcarty> Is it possible to do this in OCaml? "match baz with | foo when some_test | bar when some_test2 -> ..."
<hcarty> kaustuv: I haven't thought of the dangers of the two relative to each other. How is/Is let open Module in less dangerous?
<hcarty> vs f a.Module.x a.Module.y
<hcarty> Module.(f a.x a.y)
<hcarty> palomer: It could help with record fields as well
<hcarty> Or even a + Module.(b + c) + d
<hcarty> let open Module in a;b;c vs Module.(a);b;c
<hcarty> palomer: M.(...) limits the scope more?
<hcarty> Module.( ... ) is nice because it limits the scope
<hcarty> palomer: The utility depends on what you are trying to do
<hcarty> Module.(...) or let open Module in ...
<hcarty> pa-do does a lot more, but the "a lot more" is perhaps not as generally useful as the local open portion
<hcarty> The local open part, specifically
<hcarty> Only some of it
<hcarty> It's a syntax extension + a set of modules for OCaml
<hcarty> local open++ perhaps?
<hcarty> Delimited Overloading
<hcarty> If 3.12 isn't an option, pa-do may be
<hcarty> And I missed the line after that :-)
<hcarty> palomer: Ah, it looked like he wanted to avoid infix - "is there a way to refer to those operators without the ability of using infix syntax with them?"
<palomer> hcarty, he wants infix
<hcarty> Module.(-) doesn't seem that much worse than Module.-

2010-12-01

<hcarty> There is a lot of fun stuff going on in OCaml's experimental branches right now
<gildor> hcarty: thanks, I hope to be able to deliver it before Xmas
<hcarty> oasis-db! Hooray for gildor :-)

2010-11-30

<hcarty> palomer: If you want to toy around and contribute, I'm happy to accept input :-)
<hcarty> Standard OCaml LGPL + linking exception
<hcarty> Oh... I don't think I've added license info.
<hcarty> palomer: Very much a work in progress
<hcarty> palomer: gtk-light.forge.ocamlcore.org
<adrien> hcarty: I shall be progressing slowly but surely :-)
<hcarty> adrien: No rush! I don't know when I will have time to do more with it. But it would be nice to concentrate efforts :-)
<adrien> hcarty: will try to contribute to gtk-light when I have time for it :-)

2010-11-29

<hcarty> adrien: I can't spend a lot of time on this right now, but if you'd like to collaborate a bit on mixing in your tiling code, I think that could work very well with the minimal pieces I currently have.
<hcarty> Gtk-light has now been properly moved to the forge - http://gtk-light.forge.ocamlcore.org/
<hcarty> thelema: Ok, thank you
<hcarty> thelema: Thank you
<thelema> hcarty: not at all.
<hcarty> + CSS from the Batteries main page on the forge?
<hcarty> thelema: Do you mind if I pinch the HTML

2010-11-28

<hcarty> gildor: Thank you!
<gildor> hcarty: done
<hcarty> gildor: Thank you - no rush! But thank you for your time.
<hcarty> gildor: The project unix name is gtk-light
<hcarty> gildor: Sorry, I already submitted it
<gildor> hcarty: just ask in the project submission form
<hcarty> That's the plan
<hcarty> Only two commits, so it's not much of a history
<hcarty> thelema: On my own page, with a private git repository
<hcarty> I'm going to move Gtk-light over, in the hope that someone else will find it useful and possibly help extend it.
<hcarty> What is the process to request a git repository on the forge?

2010-11-24

<hcarty> I had not seen the shootout box plot page before. That's pretty nifty.
<hcarty> flux: Thanks! Looks like it works
<hcarty> OCaml's Pcre bindings that is
<hcarty> Ex. "(?P<long>foo_(?P<short>bar))"
<hcarty> Does Pcre support nested named subpatterns? I haven't found any documentation saying yes or no.

2010-11-23

<hcarty> adrien: It looks like rwmjones pointed that out
<hcarty> Which is the very best kind of allowed :-P
<hcarty> So it's technically allowed
<hcarty> adrien: But's not not tuning the garbage collector!

2010-11-19

<hcarty> _schulte_: If you don't mind signing up for an account, the OCaml forge is probably a good choice: https://forge.ocamlcore.org/snippet/browse.php?by=lang&lang=1
<_schulte_> hcarty: sure, I don't know much about the ocaml ecosystem, but if you can point me towards a url I'm happy to paste this there
<hcarty> _schulte_: Thanks for figuring out and pasting this. Could you add it as a snippet on the forge, or a wiki somewhere?
<adrien> (hcarty: and, yeah, didn't get the joke at first, it's too early in the morning :P )
<adrien> hcarty: week-end is wineconf in paris / people at wineconf in paris :P
<hcarty> adrien: That sounds like a perfectly reasonable plan for your weekend :-)

2010-11-18

<hcarty> adrien: That's understandable - I have a rather huge backlog of PLplot tasks I'd like to accomplish
<hcarty> adrien: Sounds very nice
<adrien> hcarty: completely unrelated: I started working on support for tiling gtk widgets, that is actually a generalization of vertical and horizontal boxes and it should provide support for constructs like window#add `vertical [ menu_bar; toolbar; some_content; status_bar ]
<flux> hcarty, yes :)
<hcarty> Or is that the lack of genericity you're talking about? :-)
<hcarty> Set, List, etc?
<hcarty> flux: I haven't looked at the implementation in detail - how difficult would it be to make this a generic multi-value map?
<hcarty> flux: I'm not sure - I'd probably have to play with it a bit
<flux> hcarty, how do you feel about the lack of full genericity of the module?
<hcarty> useful
<hcarty> flux: That does look usefule

2010-11-16

<rixed> hcarty: The problem refraining me to use it for now is that I'm working mainly on ARM and MIPS platforms, which does not support dynlink for now...
<hcarty> rixed: There isn't much :-) But if you have an interest it wouldn't hurt to make it known.
<rixed> hcarty: Ah, good. I though from this comment that there was no hope whatsoever.
<hcarty> rixed: If enough interest is expressed then it may gain some traction. But in its current state it's not much more than a "oh neat-o" toy
<hcarty> Ah, I think it's "make ocamlnat"
<hcarty> It does not seem intended as anything other than an experiment though - I tried reporting a bug or two against it on Mantis and got a response saying as much.
<hcarty> Or it was with 3.11.x - I haven't tried with 3.12.x
<hcarty> You need to do a separate "make nattop" or similar step
<hcarty> thelema: It's there, just not compiled by default
<rixed> hcarty: It's there ? A native toplevel ? where ?
<hcarty> It sounds like this JIT byte-to-native version would work with findlib
<hcarty> rixed: It's there, it just doesn't play nicely with findlib
<rixed> hcarty: I'd rather like a native-code toplevel.
<hcarty> Ooh, a JIT-compiled toplevel. Nifty.
<hcarty> It does depend on pcre
<hcarty> hcube: ocamlnet has a mixture of high and low level functions

2010-11-05

<hcarty> The nasty part, not the OCaml part
<hcarty> There are some nasty OCaml related comments in that Slashdot thread. But I suppose that's to be expected in any set of Slashdot comments.
<hcarty> kaustuv: Sparked by the F# code release perhaps?
<hcarty> kaustuv: Where is that?

2010-11-04

<hcarty> mfp: It does not appear to be modal out of the box at least
<hcarty> mfp: What sort of vi/emacs keybindings in particular?
<hcarty> mfp: I'm not sure what you mean - I didn't know it supported either :-)
<hcarty> Sadly, it seems to die if the terminal holding the session is resized
<hcarty> And the editing seems on-par with either of those options
<hcarty> The history is far superior to rlwrap/ledit + ocaml
<hcarty> The Lwt toplevel seems cooler and cooler the more I learn about it.
<hcarty> But it's been tempting
<hcarty> I doubt that's a good idea
<hcarty> flux: I've been tempted, when switching between OCaml and C, to let ( =! ) = () so that it always generates type errors :-)
<hcarty> But you can create a string IntMap.t or a int IntMap.t
<hcarty> 'a IntMap.t will always have integers as keys
<hcarty> (value as in "key, value pair")
<hcarty> joko: 'a is the type of the map's value