<Alpounet>
hcarty, you just want people to check if things compile & run well ?
<hcarty>
Alpounet: The new bits are a more OCaml-like and high-level set of plotting interfaces and the ability to provide your own Cairo surface to plot on, and with that embed plots in lablgtk apps.
<hcarty>
The requirements are: CMake 2.6.0 or later, OCaml 3.x (tested with 3.10.x and 3.11.x, should work with earlier) and lablgtk2 + Cairo-OCaml if you want the GUI goodness.
<Alpounet>
hcarty, what's new ?
<hcarty>
I would like to request testers for the latest PLplot Subversion revision, now with Super OCaml Gtk+ Powers (tm)
<hcarty>
albacker: Perhaps not less memory, but less time.
<hcarty>
BigJ2: That can be a huge help in tracking down type issues
<hcarty>
BigJ2: For issues like this, try typing each part individually in to the toplevel to see the types
<Camarade_Tux>
it's as hcarty told you: print_string writes to the terminal, it doesn't return a string
<hcarty>
Right
<hcarty>
Homework?
<hcarty>
Camarade_Tux: :-)
<hcarty>
BigJ2: print_stringis string -> unit, so you are not returning a string here even if you get rid of the inner "let .. ="
<kaustuv>
hcarty: I think the 'P' in the acronym and Yoric's background suggests that it might be more than just a type system. Possibly involves process/pi-calculus in some way
<hcarty>
kaustuv: I'm not a CS person, so I don't know the details of what would make up a "more advanced type system" :-)
<hcarty>
kaustuv: It sounds like the language is similar to OCaml, but with a more advanced type system.
<kaustuv>
hcarty: I inferred as much, but I am curious what it is. MLState's web-site does not explain much about exactly what they do.
<hcarty>
kaustuv: A language Yoric[DT] is working on at his new place of employment
2009-09-29
<hcarty>
Alpounet: Indeed to both comments :-)
<hcarty>
Alpounet: Indeed :-)
<Alpounet>
hcarty, like, say, a Batteries one :p
<hcarty>
Similar to what thelema started
<hcarty>
A Community OCaml distribution would be one way to work around this.
<hcarty>
Which is what they want to avoid
<hcarty>
Alpounet: Their argument is that they then become the maintainers of those modules
<hcarty>
I'll admit they have something of an odd attitude when it comes to the guts of the compiler. But there has been repeated noise that they are in favor of the community defining what makes up a "standard" OCaml installation (libraries, tools, etc)
<hcarty>
They want to minimize their load and leave it to the community to supplement the library as we need.
<orbitz>
hcarty: Leroy too concerend with this Coq?
<hcarty>
orbitz: According to the OCaml devs, that is by design.
<hcarty>
I suppose that's why we have PCRE
<hcarty>
Why is that?
<orbitz>
hcarty: I take that back, the Arrays module is realtively complete
<hcarty>
orbitz: Why do you say arrays are second-class citizens in OCaml?
<hcarty>
thelema: I imagine it would be more work to maintain. But it would also throw away a lot less work that has already been completed.
<hcarty>
thelema: What is the reason for not using DT's proposal - keep Batteries as "Batteries Full" but remove the module hierarchy and make "AAA" a subset of "Batteries Full"?
<thelema>
hcarty: If you look in the batteries list, there's a post where I give my manifesto -- basically: smaller, easier to install, less invasive
<hcarty>
thelema: I suppose, ideally, "Batteries Full" would sit on top of "AAA"
<hcarty>
thelema: Ok, will do. It's unfortunately a little unclear at this point how the two projects relate.
<hcarty>
Perhaps I misunderstand the current restructuring plan. Is there a list of the code which will be kept, won't be kept and might be kept in the new Batteries?
<thelema>
hcarty: I think taking batteries and integrating it into core would be... difficult.
<hcarty>
thelema: Would it be better to work from a base like Core if you are going for something more bare-bones than Batteries in its current state?
<hcarty>
very _nice_ that is
<hcarty>
The ability to transparently gzip/gunzip a stream of data is a very aspect of Batteries.
<hcarty>
thelema: Keeping the IO system, I hope?
<hcarty>
thelema: Ok, that sounds reasonable. So something along the lines of "Batteries - The Library" and "Batteries - The camlp4"
<thelema>
hcarty: I'm working to advance aaa, which will be a minimal subset of batteries. The direction I'm currently going, full batteries (with syntax extensions) will either diverge completely or will have to be re-architected on top of batteries.
<hcarty>
While they are by no means needed, "open Foo, Bar, Baz" and ther rest are quite useful and they make for cleaner code.
<hcarty>
thelema: I'm still a little confused as to the future of Batteries. Will the syntax extensions be dropped?
<orbitz>
hcarty: ohh sexified!
<hcarty>
orbitz: Batteries one-ups that with '#browse "SomeModule";;' :-)
<hcarty>
mfp: With Batteries, Enum.fold matches the signature for List.fold_left.
<hcarty>
thelema: Good points. Core does strike me as "stdlib++", while Batteries adds a lot more depth.
<thelema>
hcarty: batteries wins in having more high-level features
<thelema>
hcarty: core definitely beats batteries in consistency and lots of labeled arguments (which really seems a substitute for intellisense-like IDEs)
<hcarty>
Has anyone here used/tried both Core and Batteries? I'm curious to hear how they compare.
2009-09-27
<hyperboreean>
hcarty: yes, I know, I've previously used printf. Thanks
<hcarty>
hyperboreean: For reference - In the code you pasted, you do not need to open the Printf module. print_endline is not part of the Printf module.
<rwmjones_lptp>
hcarty, this is the META file on Fedora:
<hcarty>
But I'd like to be sure.
<hcarty>
I think The Big Three (Debian, Fedora, GODI) all use the same META file, originally provided by Debian.
<hcarty>
Does anyone here know how consistent the findlib name for the Cairo OCaml packages are across various distributions?
2009-09-24
<hcarty>
( * ), ( / ), etc..
<hcarty>
tvn: Any infix operator ( +, -, /, * ) can be used that way. It is generally considered good practice to include a space around the operator to avoid (*) which would act as the start of a comment.
<hcarty>
thelema: That would be very cool
2009-09-23
<hcarty>
flux: That's a pretty cool idea. I think the author of prelude.ml wrote some random test generation code to go along with that module. But I don't know how general it is.
<hcarty>
I don't know how accurate that is though :-)
<hcarty>
flux: On my system it's using a little over 100% CPU, but it is split evenly across cores according to htop
<hcarty>
They may have felt it wasn't worth their time to address 32bit systems, at least at first.
<hcarty>
flux: ia64 or x86_64?
<hcarty>
I downloaded it, but I have not tried it yet.
<hcarty>
Why do the work when the compiler can do it for you?
<hcarty>
flux: Truly :-)
<flux>
hcarty, yei, type safety ftw?
<hcarty>
flux: I think it's a bit clearer that way, and it avoids the risk of exceptions in the plot code due to mismatched X and Y list lengths
<hcarty>
flux: Thank you again for the question/suggestion about changing the parameter organization in PLplot's Quick_plot module from [xs0; xs1;...] [ys0; ys1;...] to [xs0, ys0; xs1, ys1;...]
2009-09-22
<hcarty>
thelema: pcl?
<hcarty>
From what I've seen, it looks like post-2007 projects were mostly hosted on their own sites
<hcarty>
thelema: For the 2007 OSP?
<hcarty>
flux: Yes, that's probably the more likely result :-)
<flux>
hcarty, or ridiculed :)
<hcarty>
flux: It keeps OCaml mysterious
<hcarty>
Camarade_Tux: Ah, of course! I keep forgetting about that web interface.
<hcarty>
I'd like to experiment at some point with dumping a bunch of email in to a Sqlite database and see how the full text search support copes.
<hcarty>
Camarade_Tux: Cool, thanks
<Camarade_Tux>
hcarty: netstring?
<hcarty>
Does anyone here know which of the ocamlnet findlib packages includes Netmime, or where I would look to find out?
<hcarty>
You're welcome. Good luck with it.
<hcarty>
Compiling, you need to tell the compiler which library or libraries to link
<hcarty>
Either way, you need to load the appropriate library. From the toplevel you #load the .cmo/.cma.
<hcarty>
whale: Are you working from the toplevel or compiling code?
2009-09-21
<hcarty>
Good night
<Camarade_Tux>
hcarty: it's mostly good, I'm going to migrate it to use lablgtk's propcc and to use .var files so the generated code is more lablgtk-ish (that's what lablgtk uses) and then I'll have to extensively check I'm always playing as nicely as possible with the gv
<hcarty>
Camarade_Tux: What is the current state of ocaml-gir?
<hcarty>
And, of coure, the OCaml-R interface you were directed to before :-)
<hcarty>
Ok, cool. Just for future reference then, those are both in (OCaml)GSL, along with a number of other mathematically-useful functions.
<tvn2009>
ah ok - thanks hcarty
<hcarty>
tvn2009: Also, if you are still looking for statistics routines - ocamlgsl wraps a large portion of the GSL statistics functions.
<hcarty>
tvn2009: They are both different names for the same function
2009-09-20
<hcarty>
That actually right around the time I decided that I wouldn't be studying CS in college.
<hcarty>
I was graduating from high school/starting college :-) Programming, but certainly with no knowledge of what "functional programming" is.
<hcarty>
Oh, those posts are all WELL before my time with OCaml :-) The funding-explanation post was from 1999 IIRC, and the other discussions I've seen are in the 2000-2001 time frame.
<Camarade_Tux>
hcarty: yeah, definitely, I won't stop using ocaml before long ;)
<hcarty>
That said, it is clearly not enough to keep me from using the language :-)
<hcarty>
But according to posts in the past on the OCaml mailing list, this is all due to funding issues or something along those lines - if other people use it for other things, then the OCaml project can lose funding.
<hcarty>
I'd be happy with GPL - at least then the rights to code changes are not so one-sided, and modified versions can be distributed without jumping through hoops.
<hcarty>
Certainly not ALL others though.
<hcarty>
The QPL + closed development makes that less appealing that it would be for many other languages.
<hcarty>
If this were language developed with a more "open" mindset, I would put some effort in to tracking down the issue.
<hcarty>
Ah, that :-)
<hcarty>
And the { x } shorthand is nice.
<hcarty>
Though I do like the addition of extra checks on pattern matching for records.
<hcarty>
No, the 3.11.2 changelog is almost as impressive.
<Camarade_Tux>
hcarty: doesn't seem very impressive yet :P
<hcarty>
Yes, it does as long as I don't try to do anything that uses toplevel-specific functionality.
<hcarty>
I can build and use ocamlnat for simple tests, but that's as far as I've gone. It isn't of much use to me if I can't use findlib with it.
<hcarty>
Ah. That's the problem I'm having on 3.11.1.
<hcarty>
Camarade_Tux: Really? That's good news. findlib worked with ocamlnat in 3.11.0?
<hcarty>
It would be wonderful if it were fixed though.
<hcarty>
The bug report I posted was responded to with "it's a hack and an experiment, of course it doesn't work" so I don't have particularly high hopes that it will be fixed.
<hcarty>
Camarade_Tux: If only ocamlnat worked properly...
<hcarty>
Psilab does not support native-code compilation, so I guess it doesn't worry about such things.
<hcarty>
I don't know if that is accurate or not though.
<hcarty>
I don't think floats are ever unboxed for bytecode'd OCaml.
<hcarty>
Same for -, *, /
<hcarty>
( + ) becomes 'a -> 'a -> 'a, but fails if 'a is not int, float or complex.
<hcarty>
The uni* functions. It checks to see if the value is a block. If not, it assumes int. If so, then it checks if it's a float. If not, then it checks if it is a complex. Otherwise it fails out.
<hcarty>
If you have the for Psilab 2.0 available, it's in $BASE/math/math.c
<hcarty>
No, it uses some C tricks
<Camarade_Tux>
hcarty: hmmm, how does it work? object?
<hcarty>
And complex values
<hcarty>
Camarade_Tux: Another interesting twist Psilab uses is to make ( + ) work on both integers and floating point values.
<hcarty>
I have ocamlc-compiled executables with the runtime embedded, but they were compiled without the "-custom" argument.
<hcarty>
Does using the "-custom" flag when compiling a .cma propagate to the compilation of executables using that library's .cma?
<hcarty>
Camarade_Tux: Let me know how it goes for you. And you should definitely work with the latest Subversion rather than an official release. I've pushed a number of a updates to the OCaml bindings since the last dev .tar.gz.
<Camarade_Tux>
hcarty: looks nice, I definitely have to try that next week :)
<hcarty>
Cairo can also be used to draw directly on the plot canvas if extra details or options are needed.
<hcarty>
And if you are feeling super-fancy, you can wrap it all in a lablgtk2 GUI.
<hcarty>
Each call to plottable_checker would create a checker element. Then those could be put on the board with "P.plot list_of_all_the_checkers".
<Camarade_Tux>
hcarty: I really need to try plplot :)
<hcarty>
Camarade_Tux: But using custom symbols for each grid is possible as well.
<hcarty>
Camarade_Tux: Plotting something like that using PLplot is possible. A simple color-coded matrix would be the easiest, taking the fewest lines.
<Camarade_Tux>
hcarty: also, I was wondering if I could easily plot a game of checkers (matrix of 0/1, with maybe custom image on each cell), we should be able to do it with only a few lines of code
<Camarade_Tux>
hcarty: psilab integrated camlimages too and that sounded nice
<Camarade_Tux>
hcarty: thanks for the infos :)
<hcarty>
At this point, though, I think using PLplot, Lacaml, ocamlgsl and maybe pa_do directly from the toplevel will provide a better experience.
<hcarty>
I have a tarball of the Psilab 2.0 sources which build with a modern GCC somewhere, but I've been unable to find it. I'll have to start digging through backups.
<hcarty>
Camarade_Tux: And I have toyed with Psilab before. It's a neat program, but I have unfortunately been unable to get in touch with the author.
<hcarty>
Camarade_Tux: The latest GODI release defaults to 3.11.x and has some updated GODI tools with it.
<hcarty>
Camarade_Tux: pong
2009-09-19
<Camarade_Tux>
hcarty: I saw in irc log that you had probably used psilab, any comment about it?
2009-09-18
<Camarade_Tux>
hcarty: sure, I just need to find a way to torture gobject-introspection developpers for being that useless :)
<hcarty>
Camarade_Tux: Ok, let me know when you have both the interest and the time :-)
<Camarade_Tux>
hcarty: ocamlmakefile definitely works well but I'd like to test what you have (not today though, it's getting a bit late ;) )
<hcarty>
Camarade_Tux: I have some myocamlbuild.ml magic for working with C stubs and camlidl if you have any interest. Sticking with OCamlMakefile is probably easier though since it seems to be much better at Just Working.
<hcarty>
I agree it can be awkward.
<hcarty>
det: How does passing functions break code a lot?
<hcarty>
det: Generic in what way?
<hcarty>
That automatically loses because it's camelCase, so it's automatically wrong :-)
<hcarty>
det: Yes, the relatively rigid definition of a list in OCaml when compared with the relaxed definition in Perl or Python takes a bit of adjustment.
<hcarty>
At which point the applicability of pattern matching starts to become more apparent, along with the benefits of OCaml's safer/better checked approaches to code.
<hcarty>
det: Coming from a background of non-listy languages, List.nth can seem like the natural solution when you want the nth element of a list. Until the code grows, the exceptions start flying, and everything just gets ugly :-)
<hcarty>
albacker: I still have code floating around which uses List.nth because I haven't had a need to change it. As you will likely learn, though, it can make code more fragile.
<albacker>
hcarty, det thanks for the help :)
<hcarty>
albacker: Starting out with OCaml, using List.nth to get the second element in the list is not such a bad thing. But you may want to look in to either using an array or pattern matching (like det just pasted).
2009-09-17
<hcarty>
Apparently a patch was submitted but has not been applied yet.
<hcarty>
You're quite welcome
<hcarty>
The AUR web site also seems to have a comment about the missing native code build for camlzip.
<hcarty>
robocop: I've used that on a few installs, and it works well.
<hcarty>
There is a version available which defaults to 3.11.x, but it is not officially released yet.
<hcarty>
You currently need to specify it yourself though, as it defaults to 3.10.x
<hcarty>
Yes, it does.
<hcarty>
Ah, sorry. I thought you'd mentioned something a day or two ago about having trouble with 3.11 on GODI
<hcarty>
robocop: Did you get 3.11.x working under GODI?
2009-09-16
<hcarty>
Happy to help
<blackdog>
thanks hcarty, that's much nicer than replacing the init
<hcarty>
blackdog: or #load "file.cmo";; (or .cma) for compiled bytecode files.
<hcarty>
blackdog: #use "file.ml";;
2009-09-15
<Camarade_Tux>
hcarty: sure, the trouble is that it's definitely far from easy ;)
<f[x]>
hcarty, yes, of course.
<hcarty>
If they don't use Windows and don't receive contributions for making things work on Windows, there isn't a lot of incentive to work on such issues.
<hcarty>
If there are fixes for building on Windows, the upstream authors would probably like to hear about them.
<hcarty>
mbishop: Indeed.
<hcarty>
He stated that he can work on Batteries, but not take the lead any longer due to time constraints.
<hcarty>
New job
<hcarty>
mbishop: Unfortunately, the departure of David Teller threw things off balance a bit.
<hcarty>
flux: Community OCaml would be a nice thing to have.
<hcarty>
tvn2009: You're welcome, and good luck with it.
<tvn2009>
thanks hcarty , the search_forward works perfectly -- I think I'll stick with it
<hcarty>
There are Debian/Ubuntu/Fedora/GODI packages for it though.
<hcarty>
No, it is not
<hcarty>
The Pcre library is much nicer to work with in my experience.
<hcarty>
Str.search_forward may give you what you want. Or Pcre.pmatch.
<hcarty>
tvn2009: According to the Str docs, it is searching for ss at position 0 in ls
<hcarty>
tvn2009: The problem is the "0"
<hcarty>
Smerdyakov, tvn2009: Yes, my apologies. I apparently do not currently understand the meaning of "and" in OCaml.
<Smerdyakov>
hcarty, I think it has no effect here.
<hcarty>
Smerdyakov: Is my understanding incorrect here? I haven't had a need to use "and" so my understanding of its meaning may be incorrect.
<Smerdyakov>
hcarty, why?
<hcarty>
You want to define ss then define ls.
<hcarty>
"and", as I understand it, defines ss and ls together.
<hcarty>
That said, I haven't used Str in a long time. I use Pcre when I need regexps.
<hcarty>
If so, you should not as it would be using an older definition of "ss".
<hcarty>
Are you literally using "and"?
<hcarty>
So you generally need to double instances of \ to \\
<hcarty>
print_endline "\%" also works, but gives a warning since "\" is used for escaping special characters.
<hcarty>
print_endline "\\%"
<hcarty>
tvn2009: What special character is "\%"?
<hcarty>
A fellow developer is trying to clean up all of the missing symbols (according to "ldd -r") and I'm not sure if all of they should be cleared up as I think they are somehow provided by the OCaml runtime.
<hcarty>
I haven't found any documentation to say one way or the other.
<hcarty>
Are missing symbols caml_* in dll_*.so files in OCaml C bindings normal? I've asked this before, but I want to double-check.
2009-09-14
<hcarty>
It may be found automatically since it is included with OCaml? I'm not sure.
<hcarty>
For example, "ocamlfind ocamlopt -package str -linkpkg foo.ml" would produce a.out from foo.ml, linking in the items required for the str package.
<hcarty>
"ocamlfind" command to get similar features.
<hcarty>
When compiling, you can use the
<hcarty>
Yes
<hcarty>
You're welcome. #require "some-library";; is quite a useful thing to have around :-)
<hcarty>
One way to check is to type "#use "topfind";;" in the toplevel. If you get an error then it is not installed. If you get a bunch of non-error output then it is installed.
<hcarty>
How did you install OCaml?
<hcarty>
You may or may not need the #directory command. It has been a long time since I have used a toplevel without findlib or the Str module.
<hcarty>
#load "str.cma";;
<hcarty>
Otherwise, I think the steps are something like "#directory "+str";;"
<hcarty>
You should install findlib
<hcarty>
Simply using "Str.foo" is generally enough. Some modules are designed to be used with open (ex. Bigarray).
<hcarty>
It can make things easier, but it also leads to name clashes.
<hcarty>
"open Str" allows you to use any type or value in the Str module without needing the "Str." prefix.
<hcarty>
You shouldn't, under most circumstances :-)
<hcarty>
You don't need to, and probably should not, have an "open Str" line
<hcarty>
I highly recommend installing it.
<hcarty>
If not, then other steps are required which I don't remember :-)
<hcarty>
If so, then "#use "topfind";;", "#require "str";;"
<hcarty>
tvn2009: Do you have findlib installed?
<hcarty>
tvn2009: It does have to be linked/loaded separately, but it is included as part of the official OCaml distribution.
<hcarty>
tvn2009: Str may have something, and if not then the PCRE bindings would certainly allow checking for this.
<hcarty>
robocop: It makes it much easier to keep the base OCaml install in order.
<hcarty>
robocop: I would recommend using GODI.
<hcarty>
robocop: It sounds like a path was set incorrectly somewhere, either at build or install time. I'm not sure how or why that would happen though.
<hcarty>
And then, stacked underneath, the same with time spent on one axis and characters/sec on the other.
<hcarty>
flux: :-) high score on one vertical axis, number of errors on the other.
<hcarty>
I plan/hope to fix up a few consistency issues (order of function parameters mainly) and then make a general announcement/RFC.
<flux>
hcarty, ooh
<hcarty>
flux: If it is of interest, I added function plotting (f(x)) to the Quick_plot module :-)
<flux>
hcarty, happy to be of help :)
<hcarty>
flux: Thank you very much!
<hcarty>
It does on my system (Ubuntu 9.04, OCaml 3.11.1).
<hcarty>
Ideally, "ldd -r" should show the build-tree dllplplot_stubs.so looking for the build-tree libplplotd.so.9
<hcarty>
flux: Definitely. Thanks.
<hcarty>
There seems to be some error/problem with rpath and ocamlmklib 3.10.x
<hcarty>
flux: Ok, thanks
<flux>
hcarty, modeemi.fi/~flux/foo
<hcarty>
Could you pastebin the output from "ldd -r dllplplot_stubs.so" from plplot-source-dir/build-dir/bindings/ocaml/_build/?
<hcarty>
flux: Do you still have your PLplot build tree around?
<hcarty>
flux: ping
2009-09-12
<f[x]>
hcarty, I understand that. It is awful.
<hcarty>
f[x]: It is currently up to the library authors to provide a link to the git repo, if they have one.
<hcarty>
f[x]: It is not built in to the forge software (yet).
2009-09-11
<hcarty>
Sedrikov: The GODI Cairo package should not depend on lablgtk, only lablgtk2.
2009-09-10
<hcarty>
Sedrikov: Very interesting... and the sqlite3 package provides a configuration option in the godi-sqlite3 package for where to look for the headers and library.
<Sedrikov>
hcarty: sqlite3 has no conf, but postgre has
<hcarty>
Sedrikov: But conf- packages seem to be the standard GODI way.
<hcarty>
Sedrikov: It may not require a conf- package, as these items could be made in to configuration options for the godi- packages themselves.
<hcarty>
Sedrikov: I'll try to do so as well. I would like ocamlgsl to play nicely.
<hcarty>
Camarade_Tux: Indeed :-) I have a RHEL 4.x system I use at work for number crunching which needed a similar stack of hand-compiled libraries.
<hcarty>
That may not be the case on a server though, if someone has a custom build of Cairo. Then it may not be a matter of two versions of Cairo, but rather a non-standard location for the library.
<hcarty>
No, I think Cairo is generally pretty safe as long as the dev package/files are available.
<hcarty>
I don't know if it is the right way to do it. One could argue, I suppose, that a conf- package is generally very small so there is very little cost in time or transmitted bits relative to downloading the full godi- package, only to have it fail.
<hcarty>
It's useful to, for example, have the system library available for system applications and the latest git/svn/etc. for testing.
<hcarty>
Sedrikov: I think it's more for "do I use the system version in /usr or the custom version in /usr/local (or $HOME/..., etc.)"
<hcarty>
As far as I know, ocamlgsl is the only package which has been made fully available so far, out of the packages worked on yesterday.
<hcarty>
Sedrikov: No, I am waiting to hear from Hans to see if he wants me to commit the package or if he is getting a GODI account.