<hcarty>
Wow... Lwt 2.0.0 provides a toplevel with line editing and no ledit or rlwrap required.
2009-10-14
<hcarty>
thelema_: I hope that happens too. There are some very good ideas for restructuring Batteries on the list. I hope to be able to contribute to that effort soon.
<Camarade_Tux>
hcarty: I haven't changed anything, but I think I have one other package that is non-godi and has no problem, so pretty weird (and I haven't spent much time on that)
<hcarty>
My hope is still for success on the monolithic Batteries front though. I think that its improvements to OCaml are very important.
<hcarty>
thelema_: I'm happy to test it out, though it will likely be a few days before I get a chance.
<hcarty>
thelema: Does it work alongside Batteries?
<hcarty>
Camarade_Tux: I use lots of non-GODI libraries with GODI, including React, and I haven't had any trouble with ocamlfind looking in the right place. Is it possible something got mixed up in the installation?
2009-10-12
<hcarty>
IIRC, this is one of the ambiguities the revised syntax is/was meant to address.
<hcarty>
It seems to work for the "else" portion as well.
<hcarty>
thelema: That is rather strange.
2009-10-09
<hcarty>
flux: CIL has an ugly build system from what I remember. It seemed very fragile.
<hcarty>
mfp: Frontc perhaps... I think that builds on top of CIL but I'm not sure.
<mfp>
hcarty: 2 more, one which is in GODI (don't remember the name) and Yacfe
<Camarade_Tux>
hcarty: not really, it's pretty hard to use
<hcarty>
CIL, Frama-C and I think at least one other.
<hcarty>
CIL seems like it would be a good base for a FFI generator. But I thought the same about Frama-C and was told otherwise by folks who know more about this than me.
<hcarty>
Camarade_Tux: So it works well for this particular library. I've used it for HDF4 as well, and it was helpful there but I had to manually wrap more since it uses a lot of void*
<hcarty>
Camarade_Tux: Almost everything in PLplot is one of : string, int, double or a pointer to one of these
<hcarty>
flux: Much better than not having camlidl
<Camarade_Tux>
hcarty: I've tried camlidl and I think there were some types it didn't play nicely with
<hcarty>
flux: Ack... small keyboard! I've been happy with it overall.
<hcarty>
flux: No, I
<flux>
hcarty, and that's not that big a complaint IMO
<hcarty>
Camarade_Tux: I don't think it handles (void *) very well
<hcarty>
flux: My biggest complaint at this point is that it imposes an extra compile-time requirement
<Camarade_Tux>
hcarty: aren't there some cases you can't use it?
<hcarty>
flux: And it's easy enough to wrap the problem functions by hand
<hcarty>
flux: It saves me a huge amount of time
<Camarade_Tux>
hcarty: yeah, I've been there too ;)
<flux>
hcarty, so you use camlidl for plplot? how was that?
<hcarty>
Camarade_Tux: You should see the evil code used to prep the PLplot headers for consumption by camlidl - handling things like two-word types makes for some ugly regexps.
<hcarty>
Though it can be forced
<hcarty>
typing
<hcarty>
No, no strong tying
<hcarty>
mfp: It's superficially similar to Haskell, but from my limited experience it seems equidistant from both Haskell or OCaml
<hcarty>
mfp: It's based on... I think term rewriting is the name
<mfp>
hcarty: pure is like a simplified Haskell with a diff evaluation discipline and macros?
<hcarty>
Although they "cheat" and let LLVM do the work.
<orbitz>
hcarty: same, i prefer to explitily be able to ignore an error via a | _ -> then to not know that i am wtih an exception
<hcarty>
orbitz: It brought me around to making my code "exceptionless" and I've been quite happy with the results
<orbitz>
hcarty: cool
<hcarty>
orbitz: All or almost all of the modules in Batteries have an "Exceptionless" sub-module which can be used to remove non-fatal exceptions from the module
<hcarty>
I do not know how well it works for huge libraries with complex C-types though.
<hcarty>
've seen
<hcarty>
The Pure FFI is one of the simplest I
<hcarty>
Pure lets you call C directly from an interpreter session
<flux>
hcarty, but when you hit the wall, you hit the wall hard
<hcarty>
For (simple) C, camlidl produces fairly nice results.
2009-10-08
<hcarty>
I have found the back traces in OCaml to be very useful.
<hcarty>
dodek_: You may be able to catch the exception and print the backtrace, but I don't think that would work here. Recent OCaml versions added support from printing backtraces from within a running OCaml program but I haven't used that functionality.
<hcarty>
dodek_: There is a patch to enable this though.
<hcarty>
dodek_: As far as I know, it's not possible. The toplevel does not produce debug symbols.
<hcarty>
It's a very nice stdlib supplement/replacement
<hcarty>
Whistles that is.
<hcarty>
Now with Bells _and_ Whistes.
<hcarty>
A super-duper library for OCaml
<hcarty>
dodek_: Batteries has ( -- )
<hcarty>
dodek_: I ran up against this recently. And the error message isn't very helpful when you don't understand the float * float vs (float * float) distinction.
<dodek_>
hcarty: that's interesting
<hcarty>
dodek_: "type t = A of (int * int) match A (1, 2) with A x -> ..." will work
<hcarty>
dodek_: "type t = A of int * int match A (1, 2) with A x -> ..." won't work
<hcarty>
dodek_: It matters when pattern matching
<hcarty>
palomer: The LTU example I linked uses FRP for input
<hcarty>
palomer: I used it, for example, to tie a slider to a map (Cairo canvas drawn with PLplot). The slider affects how the map zooms in and out.
<palomer>
hcarty, so let's say a widget changes size, then the whole widget structure needs to be updated, right?
<hcarty>
A second to kaustuv_'s recommendation. That's an excellent book.
<hcarty>
palomer: Both. I've used it for propagating signals between widgets, which then determine the size/zoom/etc.
<palomer>
hcarty, but in which aspect? signals? deciding the size of the widgets?
<hcarty>
Camarade_Tux: Thought it would likely be a _better_ thing if some support modules were involved to make everyone play nicely together :-)
<hcarty>
Camarade_Tux: For a project which requires/benefits from webkit, dbus, gtk, threading and FRP it probably is a good thing.
<hcarty>
palomer: I'm not deep enough in to the library/libraries or the theory behind them to give a better response yet.
<hcarty>
palomer: Making the code cleaner and easier to follow? I'm not sure how else to say it.
<hcarty>
In my specific experience, of course.
<hcarty>
palomer: I think the results of stringing multiple GUI elements together with FRP is cleaner than without.
<hcarty>
palomer: Yes, I've found it to be very useful in GUIs in particular. I haven't had a need for it elsewhere.
<hcarty>
palomer: Chris King did some very interesting work.
<hcarty>
palomer: Which one? I agree on both :-)
<hcarty>
The LTU one uses some camlp4 magic, but it's pretty cool even without it.
<rwmjones>
hcarty, do you have any example code using react / lablgtk etc?
<hcarty>
Is readline the hip new thing in OCaml-land?? :-)
<Camarade_Tux>
hcarty: check your inbox ;)
<hcarty>
Camarade_Tux: core? Jane St. core?
<hcarty>
I'm sure I'm not using the terminology correctly as my experience with FRP is entirely as a user and not a theorist.
<hcarty>
So any call to "x ()" may set off a chain of other events, which result in the proper value of x being returned
<hcarty>
But there is more magic going on ... 1 is mutable or somesuch.
<hcarty>
My (very) limited understanding is that it's kind of like hiding a variable in a function ... "let x () = 1" rather than "let x = 1"
<hcarty>
rwmjones: You can do this without FRP/React, but I've found the FRP approach to be cleaner
<hcarty>
rwmjones: It's useful for sending signals between widgets, so that, for example, the slider can tell the text box and the Cairo widgets to update based on its value
<hcarty>
rwmjones: A plot output window which would automatically adjust based on signals from other inputs (mouse clicks, resize the window, etc)
<hcarty>
rwmjones: My most recent use was for glorified mutability
<hcarty>
After being inspired by the FrGui project from Jane St's 2007 projects.
<rwmjones>
hcarty how?
<Camarade_Tux>
hcarty: thanks, I hadn't really looked at lwt before and it looks really nice :)
<hcarty>
The (somewhat) new release candidate for Lwt looks very interesting
2009-10-06
<Alpounet>
hcarty, heh
<hcarty>
Too many degrees with too many egos attached :-)
<Alpounet>
hcarty, it's not really animosity, but people are never nice with eachother :p
<hcarty>
I haven't noticed any animosity on the list recently, but I haven't been following it very closely.
<hcarty>
Alpounet: Which thread?
2009-10-04
<hcarty>
Night
<hcarty>
I've definitely hit some segfaults when working in OCaml, but they have all been due to issues with C.
<hcarty>
Thirded. Whichever is appropriate.
<hcarty>
Seconded!
<hcarty>
And a fantastic rename.
<hcarty>
flux: That seems to be quite a nice description
<flux>
hcarty, I think Obj.magic is more likely "do what I think I mean, and if I don't know what I mean, crash in surprising and spectacular ways"
<flux>
hcarty, yes.. indeed Obj.magic can sometimes fit the "do what I mean"-bill. but. not always..
<hcarty>
flux: So the stigma associated with Obj.magic is a conspiracy.
<hcarty>
It's unit -> 'a at least...
<hcarty>
let f () = failwith "dwim";;
<hcarty>
Alpounet: That's something to look forward to with the combo of OCaml 4.0.0 and PLplot 6.0.0 :-)
<Alpounet>
hcarty, can't it just guess what we want to plot ?
<hcarty>
Camarade_Tux: You would have to do the work to get xs0 and ys0 as float arrays, of course.
<hcarty>
Camarade_Tux: This is a day or several late, but (Quick_plot.lines [(xs0, ys0); (xs1, ys1); ...];) would give you a plot of xsN vs ysN using OCaml + PLplot :-)
2009-10-03
<Alpounet>
hcarty needed testers, I volunteered.
<flux>
camarade_tux, did you look at hcarty's plplot bindings?
2009-10-01
<hcarty>
I'm hoping to get Gtk_light to the point where it is useful for small projects. It will have to wait until I need it though, which will likely be a few weeks or months from now.
<hcarty>
I'm quite content with lablgtk though
<hcarty>
Camarade_Tux: Yes, there seems to be some activity now and then with that project. Hopefully it will see eventually be reasonably complete and see a proper release.
<hcarty>
No maintained Qt or wx bindings though.
<hcarty>
lablgtk2 provides fairly complete access to Gtk+ 2
<hcarty>
Yaron Minsky, one of the Jane St. folks, called OCaml comically unpopular in one of his talks. Or something close to that.
<hcarty>
But it is used outside of France. I know there are at users in the US and Japan (Jane St. operates in both locations IIRC, and there are other folks who are not Jane St. related)
<hcarty>
BigJ2: Just print the value returned - something like "print_endline (display (1.0, 0.0))"
2009-09-30
<hcarty>
BigJ2: Where do you define the function "direction"?
<BigJ2>
hcarty: I think I figured out pattern matching but I can't figure out how to print the return value I am guessing I need to store it in a variable?
<hcarty>
BigJ2: Someone else may be able to help if you have a question
<Alpounet>
Good night and cheers hcarty
<hcarty>
Thanks again for the testing
<hcarty>
Good night
<hcarty>
Oh no - that's quite unfortunate.
<hcarty>
My apologies!
<hcarty>
Alpounet: Ah, of course :-)
<hcarty>
I remember rwmjones had xavierbot
<hcarty>
Alpounet: Indeed - who was working on that?
<Alpounet>
hcarty, good luck, doesn't look like an easy task !
<hcarty>
Alpounet: http://plplot.sf.net is the one to track long-term. I'm hoping to find a way to include the ocamldoc-generated documentation in the general PLplot documentation build process.
<hcarty>
Alpounet: You're quite welcome, and thank you as well. You got mention in the commit message with the spelling error fixes :-)
<Alpounet>
hcarty, this is a bit late for tonight, but I should play a bit with it. It could be fun actually, for my articles/college reports/etc
<hcarty>
Alpounet: (not that you have to read it! Just in case you have an interest in the library beyond testing :-))
<hcarty>
I'm on 64bit. I wouldn't expect any trouble from that, but it's nice to know that there really isn't any.
<hcarty>
:-)
<hcarty>
Ok, thanks
<hcarty>
Alpounet: Out of curiosity - are running a 32 or 64bit kernel?
<Alpounet>
okay, then hcarty's way is fine
<Alpounet>
or, if you're really really sure the list will have a size of 3, and that the program hasn't any sense if not, then do like hcarty tells you
<hcarty>
^^^^ that should be "Bad list!" I suppose.
<hcarty>
derdon: "let (a, b, c) = match l with | [a;b;c] -> (a, b, c) | _ -> failwith "Bad array!""
<hcarty>
Yes, I want to the latest documentation and the ocamldoc reference online before I post to the list.
<hcarty>
I have the start of a simple tutorial in the documentation
<hcarty>
Just the documentation and examples for now.
<hcarty>
Thank you! I think I'll post it to the list soon for a general request for testing and comments on the API.
<hcarty>
All the OCaml prerequisites are there in GODI now, thankfully.
<hcarty>
Yes, the GODI package will likely not be for a while:-)
<hcarty>
At some point when I'm feeling adventurous I'll try to add a GODI package for PLplot.
<hcarty>
I may do that, though I don't know if they'd want to add the dependency :-)
<hcarty>
Thank you again for the testing. I'm happy to hear that it works somewhere other than on my system :-)
<hcarty>
And it plays nicely with the toplevel, which is handy.
<hcarty>
xplot01.ml and xgtk_interface.ml should be a bit better
<hcarty>
The examples are not the most idiomatic OCaml. They are converted directly from the C examples, so they have a very C-like flavor.
<hcarty>
Thanks. PLplot has been around for a while, at least 1992. I provided the OCaml portion (bindings, examples, etc) and have contributed other pieces to the core of the library.
<hcarty>
The "closing the xcairo window crashes the plot/application" is a bug that is on the TODO list... I'm not very familiar with the internals of X.
<hcarty>
Ah, that happens if you close the window rather than pressing enter or right-clicking on the plot.