<hcarty>
That would allow re-use of the odb section and on for any OCaml installation, source, Debian, Fedora, etc.
<hcarty>
I tried to leave it so that odb was installing to its default ~/.odb location
<hcarty>
thelema: The odb configuration is primarily to get CAML_LD_LIBRARY_PATH and friends set
<thelema>
hcarty: yes, deps would be a good idea, but I think it's pretty minimal - mainly a C compiler.
<hcarty>
All of the steps were tested exactly as they are written on a 64bit Ubuntu 11.04 system. System-level dependencies for a few different distributions would be a nice thing to add eventually.
<hcarty>
thelema: I was debating the same thing while writing it. I left it in list form to make it easier to add comments, but # comments in block code should be fine
<thelema>
hcarty: maybe should use block code instead of lists of code
<hcarty>
It can go wherever it will be most helpful after that
<hcarty>
thelema: I'll push it to my odb fork for now for you to take a look at
<hcarty>
thelema: I have a "v1.0beta" version of a getting started guide for OCaml + findlib + odb + oasis, from source, on Linux.
2011-12-20
<Anarchos>
hcarty it seems like a local typing with existential types ?
<hcarty>
Anarchos: I looked through the examples and didn't get much more than "that's how the syntax looks" from them
<hcarty>
float references IIRC
<hcarty>
thelema: There was some mantis activity around that a while ago but it was probably somewhat targeted
<hcarty>
...
<hcarty>
let cont = ref true in while !cont do cont
<hcarty>
Ah, I missed !cont in the while too...
<hcarty>
oops - let cont = ref true in ....
<hcarty>
let cont = true in while cont do cont := false; done; (* Not too terrible, aside from the general pain of mutable state *)
<hcarty>
I wouldn't call it painful, but it is somewhat obvious that references are not the primary focus of the syntax designers.
<hcarty>
Procedural programming is certainly possible in OCaml, and it can be useful and appropriate.
2011-12-19
<thelema>
hcarty: maybe I should bump odb up to default to stable
<hcarty>
thelema_: Ah, I see... it looks like oasis is installable when using --stable
<hcarty>
thelema_: However, oasis doesn't install cleanly from odb at this point, at least not when using the default testing repository
<hcarty>
thelema_: In theory the "getting started" writeup is ready to go, although I would like to wrap it up with a very simple example using oasis + Batteries.
<hcarty>
thelema_: Thank you. I have it complete through OCaml and findlib. I think that should be most of it - odb is easy to get going, and oasis is easy to install once odb is in place.
<hcarty>
s/possible/possibly/
<thelema_>
hcarty: I'll give it a once-over when you're done.
<hcarty>
thelema_: Once it's received a few informal comments I plan to send it to the list and possible bundle into a bash script
<thelema_>
hcarty: there and as many other places as you can think
<hcarty>
thelema_: Nothing particularly new, but a (hopefully) simple aggregation of explicit steps to build and install those items under $HOME. Do you think that odb's wiki would be a reasonable place to put this?
<hcarty>
thelema_: I'm working on a simple writeup for getting started with OCaml + odb + oasis from source on Linux
<hcarty>
Kakadu: It looks like you can combine multiple "when" cases
<hcarty>
Error: Parse error: "->" expected after [opt_when_expr] (in [match_case0])
<hcarty>
Kakadu: If you use camlp4 you'll get a more informative error
<hcarty>
Functional update
<hcarty>
Yep
<hcarty>
companion_cube: Not mutable, but you can return something different than what was passed in
<hcarty>
gnuvince: First class modules also allow you to pass around modules, modify them, etc. You can do some similar things to what OCaml's objects allow.
2011-12-18
<hcarty>
thelema: It doesn't shorten the code but it may make it a bit more readable.
<hcarty>
thelema: I have a patch here to use a string set rather than a manually unique'd list when joining and displaying the package list
<adrien>
hcarty: I had miread Lwt_react.E's doc: Lwt_react's behaviour is actually quite obvious once you look at the function signatures: the function passed to a map operation, for instance, returns an 'a Lwt.t
<hcarty>
thelema: Should I create a new pull request for that one commit? Or is there other work that would be useful to group in with it?
<hcarty>
thelema: Never mind, I see you pulled the changes already.
<hcarty>
If you're happy with that addition I'll see if I can ammend the existing pull request to include the new commit.
<hcarty>
thelema: Hooray for shorter code :-) I pushed a change to my repository if you want to take a look.
<thelema>
hcarty: great
<hcarty>
thelema: Thanks. I'm working on addressing your first comment now.
<hcarty>
s44nder: I'm not even sure R does syntax checking before run-time. If they have introduced, or are going to introduce some form of compilation support then that would be a nice improvement.
<thelema>
hcarty: reviewing your odb push now
<hcarty>
Depending on the task at hand the validity of that assumption can vary wildly :-)
<hcarty>
OCaml development tends to be pretty rapid, assuming the right libraries are available.
<hcarty>
s44nder: Even with all of that, I'm not "anti-R". I am just not personally happy with it as a development platform.
<hcarty>
s44nder: Those features are helpful. But they still only catch errors once that code is run. Even Perl, Ruby and Python catch basic syntax errors before execution begins - R does not in many cases.
<hcarty>
R as an interactive data tool - excellent; R as an application development tool - about as friendly as bash.
<hcarty>
I was bitten by this a few times with R, so at this point I save R for interactive sessions. Even then I will often use OCaml if there are libraries to support what I need to do.
<hcarty>
Errors are generally not detected until a particular piece of code is executed, so little-used cases may be sitting time bombs
<hcarty>
s44nder: It's not the speed that concerns me, but the complete lack of type safety :-)
<hcarty>
sgnb: What was the reason for rejecting the patch?
<hcarty>
Kakadu: You're welcome, I hope it helps
<Kakadu>
hcarty: thanks for your explanation
<hcarty>
Kakadu: In the code you reference it looks like Enum is used as a lazy filter on an array
<hcarty>
Kakadu: So (1 -- 10) returns an enumeration of 1, 2, 3, ..., 10
<hcarty>
Kakadu: Ah, in that case it depends on how they are used. For example, Batteries provide a ( -- ) operator which can be used to create enumerations of integers.
<Kakadu>
hcarty: I'm looking at an example for the article about parser combinators. It is not my code.
<hcarty>
Kakadu: You don't use Extlib.Enum, you use Batteries.Enum :-)
<hcarty>
thelema: Pull request sent. Please let me know if you have any questions or qualms with the patches.
2011-12-17
<hcarty>
thelema: I have some odb commits I need to test and then push for you to look at: Support for ustom build and install directories; Support for custom and multiple package sources
<hcarty>
thelema: Ping
<hcarty>
adrien: odb for react and lwt?
<hcarty>
adrien: I've wondered that too. It wasn't clear in the documentation last time I looked
<hcarty>
The oasis-db "What's new" list has been active. That's promising.
<hcarty>
Drakken: If it's something that Gerd needs to do manually then it could take a little while. He tends to be pretty busy.
<kejoki__>
Drakken yeah. hcarty - thanks. I was almost there. The parens are eating my lunch...too used to lisp.
<hcarty>
kejoki__: For example, let f (y : float) = 1.0
<hcarty>
oriba: Best of luck with it :-)
<oriba>
hcarty, List of t list? ah hmhhh... looks interesting
<hcarty>
kejoki__: You could use (fun (y : float) -> ...)
<oriba>
hcarty, ok, this hint is helpful
<hcarty>
oriba: Or you could have type t = Int of int | String of string | List of t list
<oriba>
hcarty, for parsing it seems to be easier "the flat way"... would it make sense to convert later?
<hcarty>
oriba: Within the last week or two, but I don't remember if it was the main list or the beginners' list
<oriba>
hcarty, aha ok, thanks
<hcarty>
oriba: I think the suggestion was to use something similar to your base_t version
<oriba>
hcarty, aha
<hcarty>
oriba: There was a discussion similar to this on one of the mailing lists
2011-12-16
<hcarty>
I don't know if such a thing exists for oasis or oasis-db
<hcarty>
thelema: If there is developer-level documentation, as opposed to end-user documentation, that may help.
<hcarty>
gildor++ too, for that matter. oasis-db and odb are rather critical tools as I see it.
<hcarty>
thelema++ for the mailing list post on easing dependency management and related actual efforts toward that goal...
2011-12-15
<thelema>
hcarty: yes, I assumed that for a long time, but after lots of tracking of the bug, I found that the linux linker has become much more picky about argument order
<hcarty>
thelema: I ran into that after installing 11.10 on my desktop, but figured that I hadn't installed something properly
<hcarty>
gildor: That is what I expected. Now I just need to find a free week to work on it :-)
<gildor>
hcarty: let says that if you want to do it, you can probably do it just as odb.ml was build, you should have enough information from the _oasis
<gildor>
hcarty: e.g. deciding when to use conf-* package
<gildor>
hcarty: it is feasible, but will require hand editing for some parts
<hcarty>
gildor: Do you think it would be reasonable to provide support for oasis-db acting as a GODI repository?
<gildor>
hcarty, thelema: I think we will build a tool in between oasis2debian and GODIVA
<gildor>
hcarty, thelema: I have studied the various possibility of GODI/oasis
<hcarty>
Extending GODI to support oasis-db/oasis-db to act as a GODI repository is another and possibly better option...
<hcarty>
odb is still a much lower barrier to entry than GODI
<hcarty>
thelema: Once oasis supports generating GODI packages then that may be true
<thelema>
hcarty: on gildor's todo list is generating godi packages from oasis
<hcarty>
thelema: A thought for mixing odb and GODI - it may be worth finding a way to create a GODI package for odb. If the dependencies and build targets are setup properly in GODI, in theory this could be used to at least odb-based package rebuilds to GODI-based OCaml compiler upgrades.
<thelema>
hcarty: let first_ok f xs = List.enum xs |> map (Result.catch f) |> Enum.find Result.is_ok |> Result.get
2011-12-10
<hcarty>
thelema: I'm off for now. I'll ping you or send a pull request when I have something to look at.
<hcarty>
Probably not
<hcarty>
Lots of "module type of"'s
<hcarty>
thelema: I'm planning to use 3.12-isms heavily in the .mli and possibly in the .ml
<thelema>
hcarty: BatteriesNoexn?
<hcarty>
thelema: I'd like to create a BatExceptionless module (or BatteriesExceptionless). It would be equivalent to Batteries with all of the Exceptionless modules in use. Do you have an opinion on the naming or approach?
<hcarty>
Qrntzz: I think there is another library as well... Functory maybe?... which provides similar parallel computing support
<hcarty>
Qrntzz: I had hoped for the same :-) preludeml's functions are as close to "for free" parallelism as OCaml gets
<hcarty>
thelema: If/Where that's possible and reasonable
<hcarty>
thelema: Yes
<Qrntzz>
hcarty: thanks for the info, I just hoped paralellism in JoCaml would be reachable kind of out-of-the-box, using just built-in primitives
<hcarty>
thelema: Sounds good. All I request up-front is function naming and argument ordering consistency between the two
<thelema>
hcarty: I'll probably do the reverse and implement the rest of the option functions myself, if you can give it a review, that'll be great
<hcarty>
Qrntzz: preludeml has some nicely convenient fork-based parallel list and array iter and map functions.
<hcarty>
Qrntzz: invoke/fork, zeromq, MPI, camlp3l are all reasonable options, depending on your specific needs
<hcarty>
thelema: If you merge master into you result-extensions branch I'll try to take a look at it today or tomorrow
<hcarty>
Qrntzz: Probably emailing the maintainers :-)
<Qrntzz>
hcarty: more about how the processes are created
<hcarty>
Qrntzz: Testing which part? How the processes are created, or comparing JoCaml + spawn vs OCaml + invoke?
<Qrntzz>
hcarty: is there any (unbiased) method for testing this?
<hcarty>
I wonder if the separate processes are generated by forking or some other method. If it is built on forking then it may not be much different than using the invoke function floating around.
<hcarty>
Qrntzz: With spawn
<hcarty>
Qrntzz: Looking at the documentation, it certainly seems to say that multiple, parrallel processes are used
<Qrntzz>
hcarty: well, processes (as in syntactic classes) spawned with the spawn keyword itself are shown as child processes (as in scheduled tasks) of the jocaml interpreter in system monitors like htop
<hcarty>
I haven't read the JoCaml documentation in almost a year, so that may have changed.
<hcarty>
Qrntzz: I don't think JoCaml has any builtin support for creating new processes beyond fork
<Qrntzz>
hcarty: so, the JoCaml spawn construct actually yields a process that is similar to a forked one?
<hcarty>
Qrntzz: Some method of communication between processes is still required. JoCaml has some support for this, but I don't think that it is implicit in the fork. If I recall correctly, you need to setup the communication manually.
<hcarty>
Both OCaml and JoCaml allow you to fork processes. In both cases, these proccesses will run on separate cores.
<hcarty>
Qrntzz: It does not unless you run multiple processes
<hcarty>
I don't see an option to receive notifications when a pull request is merged
<hcarty>
thelema: Nothing yet, but that may be a lag in notification and/or something in my github account preferences
<hcarty>
thelema: I agree
<thelema>
hcarty: I have a few batresult functions in a branch
<hcarty>
thelema: Do you think it is worth adding a BatResult.catch_opt(ion) function?
<thelema>
hcarty: awesome
<hcarty>
thelema: Pull request submitted, along with a few other documentation updates.
<thelema>
hcarty: quite true.
<hcarty>
thelema: I can submit a patch/pull request once I figure out the proper way to update my fork...
<hcarty>
thelema: The README.md from Batteries should be updated to OCaml >= 3.12 in master
<hcarty>
adrien: How widely and easily available is pmake?
2011-12-09
<hcarty>
Down with Batteries! Long live Batteries AAA'!
<hcarty>
I've wondered the same :-) Although apparently not enough to file a patch or bug report...
<hcarty>
return 'a option
<hcarty>
thelema: Enum.get
<thelema>
hcarty: no, filter_map unpacks the options
<hcarty>
That would return an option result, so it would come down to wanting 'a option or 'a
<hcarty>
map (Result.catch f |- Result.to_option)
<hcarty>
s/Restult/Result/
<hcarty>
It's missing a cast from Restult -> Option, but it looks workable beyond that
<hcarty>
Not the prettiest. And if no suitable value is found, raising the last raised exception may not be appropriate.
<hcarty>
Has anyone here tried ocp-pack from ocamlpro?
2011-12-05
<roha>
hcarty: true
<hcarty>
roha: There is only one compiler, so that's sort of like having one standard :-)
<hcarty>
beginner: With the possible exception of OCaml for Scientists, which I haven't read but I have heard good things about
<hcarty>
beginner: The only good OCaml books in English are available online
<hcarty>
roha: Including some issues (last I looked) trouble when using ocamlfind to properly infer interfaces
<hcarty>
roha: ocaide is reasonably nice, but it is lacking in some tool integration.
<hcarty>
Drakken: He is asking if the compiled C stubs (*.so for the ocamlc case) are found by findlib/ocamlc
<hcarty>
NaCl: Have fun with it, and feel free to ask if you have any questions
<hcarty>
The functions are there to support this - it's even done in one of the examples - but it's not built in and ready to go
<hcarty>
You can certainly zoom using a drawing area, but if you want to zoom the plot you'll have to do that manually
<hcarty>
NaCl: It has some support, but not to the extent that, say, matplotlib does in Python
<NaCl>
hcarty: is there a gnuplot-like interactive graph feature?
<hcarty>
NaCl, adrien: I think Archimedes has some support for the same thing, but I don't know if the API is available to support it yet
<hcarty>
NaCl, adrien: PLplot allows you to embed plots in lablgtk windows
2011-12-01
<hcarty>
adrien: I think you're correct
<hcarty>
thelema: Also, someone (xleroy?) posted a solution to the >= 3.13 vs < 3.13 Hashtbl module interface difference which may be worth pursuing.
<hcarty>
thelema: I have been and probably will continue to be unavailable to help with Batteries tasks for a while, but this seems like a potentially very good thing
<hcarty>
thelema: Hooray for a move to 3.12+ for Batteries.
2011-11-28
<hcarty>
yezariaely: Ah, that makes more sense :-)
<yezariaely>
hcarty: should have been a "!" not a "?" ;-)
<hcarty>
yezariaely: Those are what I currently use and I don't run into any indentation speed issues