2011-12-21

<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
<thelema> hcarty: looking now
<hcarty> https://github.com/hcarty/odb/blob/master/getting-started.md -- If anyone wants to take a look. It is a (hopefully) simple/minimal outline of the steps required to build a usable OCaml toolchain from source.
<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> s44nder: There is a library for OCaml/R communication - http://home.gna.org/ocaml-r/
<hcarty> sgnb: Thanks for the link
<hcarty> s44nder: OCaml and R are both nice. I wouldn't want to write applications in R, but it does have a lot of nice tools for data exploration.
<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.

2011-12-13

<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> I have an implementation with BatResult
<hcarty> with_first f l calls f with each element in l, returning the resulting value from the first call that doesn't raise an exception.
<hcarty> Yes
<hcarty> Used as: with_first int_of_string ["a"; "b"; "c"; "1"] --> 1
<hcarty> Any suggestions on a function like this: val with_first : ('a -> 'b) -> 'a list -> 'b

2011-12-08

<thelema> batprint is used for a different kind of printing that iirc, hcarty can tell you more about.
<hcarty> thelema: I'm off, but best of luck. Thanks for running those benchmarks!
<hcarty> But it was not immediately obvious
<hcarty> Knowing how to read it now I can follow it
<hcarty> It looked like the output was broken the first time I read it because the grammar is so unexpected
<hcarty> That's the piece I had the most trouble mentally parsing
<hcarty> (... which is l% faster than Horrendous)
<hcarty> Specialized is n% faster than BatInt.Compare which is m% faster than Polymorphic
<hcarty> thelema: Maybe the second item on could have "which is n% faster than"
<hcarty> thelema: That is easier to read
<thelema> hcarty: does this look better? http://pastebin.com/5GAyrUAv
<hcarty> Yes, () seems like it could be more usable
<hcarty> Once I figured out what it was saying (chained comparison) it makes sense
<hcarty> thelema: It takes a bit to parse initially
<hcarty> That pokes some significant holes in speed-based arguments against functors
<hcarty> thelema: That's an impressively small difference between lt3 and lt1
<thelema> hcarty: It seems that the functorized compare is still much faster than polymorphic compare for Ints
<roha> hcarty: I'll check it out if I won my current battle with the type checking system :). Thanks
<hcarty> roha: That, of course, requires significantly more up-front effort than thelema's solution :-)
<hcarty> "
<hcarty> roha: Or use my xstprp4 fork and use "${array, Array.print String.print}
<hcarty> thelema: Infix.( < ) == ( < )
<hcarty> thelema: Without <., you have that performance hit anyway
<thelema> hcarty: it doesn't have to, and if it does, I'll fix that now.
<hcarty> <. has a small performance hit due to its functor origin
<hcarty> I'm not convinced 1 < 2 is slower than 1 <. 2
<hcarty> Int.( ... 1 <. 2 .. ) is slightly more distinct and requires typing an extra character when one wants to be explicit
<hcarty> But Int.( ... 1 < 2 .. ) is not very visually distinct from 1 < 2
<hcarty> If performance is an issue then the functorization can be pulled out
<hcarty> thelema: But ( < ) becomes visually and functionally distinct from Int.( <. )
<thelema> hcarty: using < instead of Int.(<)
<hcarty> I'm not sure which direction the performance loss would go.
<thelema> hcarty: I don't want to encourage mixing of > with >.
<hcarty> thelema: It provides a single-type comparison which could be handy
<thelema> hcarty: hmm, and maybe chars (although I don't think we have this atm)
<thelema> hcarty: I don't like it so much for ints
<hcarty> roha, thelema: Or the same function in Sys
<hcarty> thelema: For any module with comparison functions
<thelema> hcarty: only for float, or for all numerics?
<hcarty> That avoids clobbering the default comparison functions
<hcarty> thelema: What do you think of using <., >., =. for the generated comparison functions? Core does this for type-specific comparison functions.
<hcarty> Since it will only work for larger numbers
<hcarty> The epsilon should probably be mentioned explicitly in the ( =~ ) documentation
<hcarty> The same error I get with my earlier example
<hcarty> The last y is marked with the error above
<hcarty> let x = 1.0 and y = 1.0 -. 1e-5 in x =~ y ~epsilon:epsilon_float
<hcarty> Yep, caught that one :-)
<hcarty> The last y
<hcarty> Error: This expression is not a function; it cannot be applied -- on y
<hcarty> thelema: Same error
<hcarty> thelema: I think something was lost in the paste
<hcarty> thelema: Yes, otherwise (1.0 -. 1e-5) is interpreted as a function taking a labeled argument
<hcarty> The inner () grouping is not required
<hcarty> But that doesn't seem very useful
<hcarty> Well, this works: (1.0 =~ (1.0 -. 1e-5)) ~epsilon:epsilon_float
<hcarty> It doesn't look like it's possible
<hcarty> If not, is 1e-5 a reasonable epsilon?
<hcarty> Is it possible to use optional parameters with an infix operator?
<hcarty> Oh, if it's in Float.Infix then I withdraw my request
<hcarty> Not =~ because I use that for regex checks :-)
<hcarty> If you do include the operator that is...
<thelema> hcarty: what name do you like?
<hcarty> thelema: Can we call it something other than ( =~ ) if you do include it in Batteries?

2011-12-06

<adrien> hcarty: last commits are quite old
<hcarty> I'll do my part hoping :-)
<hcarty> A recent mailing list post re-affirmed that completing the feature is on ocamlpro's TODO list
<hcarty> adrien: I don't remember, but there is/was a README in the SVN branch that outlined what was not complete
<hcarty> Namespace support like ocamlpro's branch provides will be Really Quite Nice to have.
<hcarty> Yes, I don't think I'm going to try ocamlpro's additions than ocp-pack (if I go that far) until they are supported/integrated somewhere
<hcarty> Yes
<hcarty> Incomplete, but getting closer
<hcarty> adrien: There is a branch in SVN and on github
<hcarty> But as I understand from the page, ocp-pack takes a list of source files and builds a big .ml out of them
<hcarty> adrien: Nope, this one isn't a patch. The packed functors part is available as a patch.
<hcarty> adrien: Me too. It seems like a potentially nice holdover until namespaces are implemented.
<hcarty> http://www.ocamlpro.com/code/2011-08-10-ocaml-pack-functors.html -- a bit more than half way down the page
<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
<yezariaely> hcarty: thank you, that's it?
<hcarty> yezariaely: http://www.ocaml.info/home/ocaml_sources.html -- The vim configuration files here are a nice alternative to omlet
<hcarty> yezariaely: I don't remember what factors cause the poor performance, but I stopped using omlet with vim for that reason.
<hcarty> yezariaely: omlet's indentation can become very slow

2011-11-23

<hcarty> gildor: Do you expect that patch to go into the next release?
<gildor> hcarty: stop
<hcarty> gildor: :-)
<gildor> hcarty: and complement it with InternalModules
<gildor> hcarty: I recommend you to have a look at how it is done for .cmi
<hcarty> gildor: Ok thanks, I'll take a look.
<gildor> hcarty: you'll have to patch setup.ml to do that
<gildor> hcarty: not sure
<hcarty> There may be a syntax extension somewhere that provides shorthand syntax like that
<hcarty> I may be wrong about that.
<hcarty> #method means something else I think...
<hcarty> ijp: List.map (fun x -> x#method) ls
<hcarty> gildor: Is there a way to manually indicate which .cmx files should be installed?
<hcarty> gildor: Ah, ok
<gildor> hcarty: err, I plan to do but have only worked on a proto a long time ago
<gildor> hcarty: as far as I know it should be automatically installed
<hcarty> Is it possible to tell oasis to install .cmx files?
<hcarty> thelema: I don't know if [group ~by l] would be general enough to include in Batteries
<hcarty> thelema: I think that BatList.group is close enough to break that they are effectively the same
<hcarty> thelema: I have a few list splitting/grouping functions which may be useful - http://vpaste.net/72pjg
<reynir> hcarty: thanks, that sounds interesting :)
<hcarty> reynir: Combined with the appropriate libraries it can be very useful.
<hcarty> reynir: See odb as an example, or you can use ocamlscript for automatically compiled scripts/programs
<hcarty> reynir: Yes, although the ease depends on the scripting you are trying to do

2011-11-22

<thelema> hcarty: but don't know how to do it.
<thelema> hcarty: yes, I've thought about that.
<hcarty> thelema: Clearly the most significant missing functionality in odb is bash completion!