2008-01-07

<hcarty> I grabber the entire aerosol trunk, then built it from the Chipmunk/ directory. I think it built cleanly
<hcarty> If I remember correctly
<hcarty> cmake . && make
<hcarty> It uses cmake to build
<hcarty> Ah
<hcarty> sorry, .tgz
<hcarty> There should be a makefile in the .tar.gz
<hcarty> I was able to build them, and I created a few items to make sure it didn't segfault
<hcarty> They really have been busy
<hcarty> I looked at it earlier today, I think it's the same...
<hcarty> Allegro bindings too I think
<hcarty> Hahaha.. oh yes, I suppose that makes sense
<hcarty> My apologies on the mixup - irc nicks don't always map easily to real-world names (or email addresses...)
<hcarty> flux: It was on the beginners list... one moment
<hcarty> flux: Yep. Someone else must have then I guess?
<hcarty> I haven't compiled+installed the require GL module for the demo though, so I have not tested that yet
<hcarty> With a little editing I was able to compile it, and it looks quite nice
<hcarty> flux: I downloaded and built (what I think is) your Chipmunk wrapper linked from the mailing list
<flux> hcarty, guess what I'm doing.. ;-) The problem appears to be that Chipmunk returns cpShape* which can be casted to cpCirleShape* or cpSegmentShape*; I think the only reasonable way to handle that would be to view cpShape* as an abstract type and provide accessors

2008-01-06

<hcarty> flux: Nevermind... I just saw your list post
<hcarty> It seems like it should not be too difficult though with the proper know-how
<hcarty> After seeing your conversation about Chipmunk the other day I tried to use camlidl to wrap that ... and it turns out that I don't know enough to make that happen quickly + easily yet
<hcarty> It applies some patches to add ocamlfind support. Those patches are not there (yet) in Debian or the original source code.
<hcarty> flux: camlidl only has ocamlfind support in the Godi version

2008-01-05

<hcarty> maayhem: y would be an exception type I think?
<hcarty> With "let rec foo" it would be, but I /think/ something like you showed would still mask it
<hcarty> With "let foo = ... in", 'foo' is not visible in the ...
<hcarty> maayhem: correct
<hcarty> maayhem: "with x -> x" : those two 'x' refer to the same thing (the exception)
<hcarty> AxleLonghorn: You're quite welcome
<AxleLonghorn> thanks hcarty, it works now
<hcarty> let terrain = Array2.create float64 c_layout 10 10;;
<hcarty> AxleLonghorn: I had some confusion with that when starting with the Bigarray module
<hcarty> Use float64 rather than float64_elt
<hcarty> Ah
<hcarty> AxleLonghorn: What is the error you are getting?

2008-01-04

<hcarty> OCaml is generally pretty quick
<hcarty> middayc-: Depends on your definition of efficiently :-)
<hcarty> But it's a style choice, and OCaml lets you have it both ways
<hcarty> For the velocity vector example - one way to think about it would be to have your update function return a new "bullet" rather than modifying the old one.
<hcarty> middayc-: I've been playing with the Objective part of OCaml recently, and it seems to integrate nicely with the rest

2007-12-31

<hcarty> I could not agree more
<hcarty> s

2007-12-30

<Smerdyakov> hcarty, we had a suggestion to get professors are mentors.
<hcarty> The student could still keep the money, do the presentation, etc. Just someone else with a direct interest.
<hcarty> Smerdyakov: Encouraging outside collaboration/sponsorship may help long(er) term upkeep of OSP code
<hcarty> "rename" is not the correct word/terminology...
<hcarty> But that does not work - syntax error on "module"
<hcarty> ex. class c = let module L = List in object val it = [] method get = L.hd it end;;
<hcarty> Is there a way to do locally rename a module in a class?

2007-12-28

<hcarty> Proteus: To answer your question from a day or two ago - I have not tried the JoCaml network setup, just for one system

2007-12-27

<Proteus> hcarty, did you try jocaml's network capabilities?
<hcarty> For what that's worth
<hcarty> Proteus: I tested one of the example programs they have on their site on a 8 processor system, and it was ~5-6x faster (if I remember correctly) when using all 8 processors than when using just one

2007-12-25

<hcarty> bluestorm: That looks quite handy

2007-12-23

<hcarty> So if naming by purpose seems more appealing to you then you can start with that and change later if you choose
<hcarty> The code changes required to go from "by purpose" naming to "by type" naming would be similar (I think?) to those required to change the type when naming by type
<hcarty> But tsuyoshi's response is perhaps more generally applicable and future-safe
<hcarty> orbitz: I've done both in the case of Map - if I'll use it for different purposes then I use the type, otherwise the purpose

2007-12-22

<hcarty> Glad to help
<hcarty> If that makes any sense... it's an associativity thing, but I don't remember the proper name. Unary operator perhaps?
<hcarty> It lets you type (foo ~-1) rather than (foo (-1))
<hcarty> It is also combined with - and -. for negative numbers, ex: ~-1 and ~-.1.0
<hcarty> foo ~arg:1 ;; calls foo with named argument arg set to the value 1
<hcarty> orbitz: You can mess with camlp4 to get .[] .() .{} etc to do different things. They are all defined in the OCaml sources as sugar for the matching *.get functions
<hcarty> Yes, pastebin.com seems to be broken here as well
<hcarty> http://ocaml.pastewith.us/ - this one seems to be working
<munga_> hcarty: is broken atm or it's just me ?
<hcarty> munga_: pastebin.com has OCaml highlighting, several have been used here though. There does not seem to be one that is official.
<hcarty> orbitz: As long as the first letter is capitalized, the remaining can be written however you'd like. But the filename may have to match - I am not certain.
<hcarty> Jeff_123: It's all satellite data, so no physical modeling at this point
<hcarty> What else?
<hcarty> Jeff_123: Plotting rainfall!

2007-12-21

<hcarty> What does $ do? I use (|>) : 'a -> ('a -> 'b) -> 'b fairly often, but I don't know if they are similar - I'm an OCaml consumer, not a pure CS person
<hcarty> Though that conflicts with JoCaml
<hcarty> I saw & recommended on the mailing list as another option for a $ replacement

2007-12-17

<hcarty> flux: Sure thing. Feel free to ask if any of it is unclear
<flux> hcarty, thanks
<hcarty> The "Source" tab has the SVN repo if you don't want to download the .tar.gz
<hcarty> It's on Google Code, and it's fairly short overall
<hcarty> I do that with the PLplot code if you want to take a look
<hcarty> They more or less have to be wrapped manually, I think
<hcarty> The biggest issue I've had has been with void* types
<hcarty> I used camlidl to create bindings for the PLplot and HDF C libraries
<hcarty> flux: Aside from SWIG, there is camlidl which takes a (slightly) modified .h and generates OCaml bindings

2007-12-15

<montoya> hcarty: convert... how to convert expression into string?
<hcarty> f and g would not be strings, so they still have to be converted
<hcarty> montoya: I think you'd want something like ... | Sum (f, g) -> "(" ^ string_of_expression f ^ ... and so on
<hcarty> But yes, there is apparently some sort of similar support in emacs
<hcarty> rlwrap does have the benefit of being /slightly/ lighter
<hcarty> context: If you're looking for readline support for the OCaml toplevel, try rlwrap

2007-12-14

<hcarty> Then my apologies - I don't know enough about the OCaml build process or internals to help. Hopefully someone else can.
<hcarty> And then make world?
<Anarchos> hcarty i used ./configure --prefix ~/config -no-shared-libs
<hcarty> Ah, ok
<hcarty> That bit me when I first tried to build from source directly
<hcarty> Not to sound condescending, but have you followed each of the steps in the INSTALL file? There are a few items beyond the normal ./configure && make && make install
<hcarty> I haven't worked under BeOS before, and I don't know what the OCaml support is like
<Anarchos> hcarty : BeOS
<hcarty> Anarchos: What OS?

2007-12-13

<hcarty> Then ask the author
<hcarty> jcpiza: Not really too much paranoia
<hcarty> I think rwnjones said this at some point in the past
<hcarty> I think Gc and Unix are two of the blocked modules on xavierbot
<hcarty> jcpiza: Please read the documentation, or ask, rather than flooding
<hcarty> And the function still is not tail recursive
<hcarty> Jeff_123: A cruel fate for such a noble bot
<hcarty> mbishop: Exactly :-)
<hcarty> jcpiza: We get the point
<hcarty> jcpiza: Anything recursive function which is not tail recursive can cause problems with large enough values
<jcpiza> hcarty, iterative succ is not valid, i want recursive succ
<hcarty> Yeah, just one more would do it
<hcarty> - : int = 1073741823
<hcarty> # max_int;;
<hcarty> # succ(1000000000);;
<hcarty> - : int = 1000000001
<hcarty> The toplevel still says it is type int
<hcarty> On 32bit OCaml 3.10.0
<hcarty> That one works for me as well
<jcpiza> hcarty: and succ(1000000000) ; ?
<hcarty> Same + 1
<jcpiza> hcarty: and succ(10000000) ; ?
<hcarty> - : int = 100001
<hcarty> # succ(100000);;
<jcpiza> hcarty: what says this command succ(100000) ; ?
<hcarty> jcpiza: I run OCaml programs quite regularly which us 600-700megabytes of RAM
<hcarty> OCaml uses 31bit integers on 32bit systems, or 63 for 64 bit systems

2007-12-11

<hcarty> Then doubly nice :-)
<hcarty> Do ranges and comprehensions work together?
<hcarty> Yoric[DT]: Looks very nice

2007-12-10

<hcarty> It takes care of many of the details
<hcarty> madroach: I've found using OCamlMakefile with C library bindings very helpful
<Yoric[DT]> hcarty: actually, I guess I'm going to make use of SdFlow.
<unfo-> hcarty, thanks for link
<hcarty> There is a Cal Tech book in PDF format
<hcarty> context: Definitely, no doubt
<hcarty> I don't particularly like the use of #, but the implementation seems interesting
<context> hcarty: its the # obviously :p
<hcarty> Actually - Is there a list of reasons why the OO parts of OCaml are so looked down on?
<hcarty> The license issue may be worth bringing up on the mailing list. I'm sure it will affect other extensions in the future as well.
<hcarty> putting in the effort, that is
<hcarty> That makes sense. Thank you for putting the effort, however it works out
<Yoric[DT]> hcarty: I'm actually planning to make it available.
<hcarty> Yoric[DT]: Would you be willing to make the code available? Another set of examples on the Campl4 wiki would be handy.
<Yoric[DT]> hcarty: I actually haven't.
<hcarty> Sdflow.dup looks like it may provide a workaround for that
<hcarty> The stream performance is lost in the noise
<hcarty> flux: I don't know what performance is like... I've only used streams (via Sdflow) to iterate over relatively computationally intensive code
<hcarty> Yoric[DT]: Have you looked at Sdflow http://www.pps.jussieu.fr/~li/software/sdflow/doc/html/Sdflow.html for your Stream work? I don't remember if you said you have or not
<Yoric[DT]> hcarty: Work is progressing well on stream comprehension.

2007-12-07

<hcarty> It all seems to work now. Thanks very much for the help.
<hcarty> The values are always used as floats in the C function. But as long as it's safe to treat an unboxed float tuple in the same way as a boxed othertype tuple I'll just leave the code as is
<hcarty> Yoric[DT]: I'm working on a C library wrapper which needs callbacks in a few places
<Yoric[DT]> hcarty: what do you mean ?
<hcarty> "it" being the function passed to set_callback
<hcarty> If I create a set_callback callback function which takes a (float -> float -> (float * float)) argument and sets that up as the callback - is it still treated like a polymorphic function here?
<hcarty> Using Double_field() on a return value from a polymorphic function seems to cause a segfault
<hcarty> Is there any harm in using Double_val(Field(foo, n)) for tuples of doubles?

2007-12-05

<hcarty> I get the following error on the second #use: "I/O error: Bad file descriptor"
<hcarty> Is there a way to #use "foo.ml" multiple times in the toplevel when using a syntax extension?
<hcarty> Yoric[DT]: Very cool!
<hcarty> But I think that will have to wait until the documentation is a little more complete
<hcarty> I'd like to learn enough Camlp4 to eventually override the .{} syntax for Bigarrays so that the .{} is always used with Bigarray.Genarray.t, rather than the type being determined by the number of dimensions used
<hcarty> Yoric[DT]: I think that would be pretty ideal
<hcarty> And being able to use something like [1 .. 100] as proper syntax would be quite nice
<hcarty> Yoric[DT]: I'd be interested in such an extension. I'm using Sdflow at the moment for ~similar purposes
<hcarty> Array.init dim1 (Array.make_matrix dim2 dim3 0.0) did the trick - any suggestions for a wiki where this information might be useful?
<hcarty> The docs explain it
<hcarty> Ah, nevermind
<hcarty> Any ideas on why this odd (to my eyes) result comes from this array manipulation? http://pastebin.com/m1fb248db

2007-12-04

<hcarty> Yoric[DT]: Thanks. I was unclear on that after reading the docs.
<hcarty> Do you need to use the ; in revised syntax in .ml files, or only the toplevel?
<hcarty> I'm not completely happy with vim+omlet, emacs+tuareg or eclipse+ocaide. But emacs+tuareg seems to work the best for my uses for the time being.
<hcarty> I used indentation based folding for a short while
<hcarty> If I tried to autoindent a section of code, it would take ~30+ seconds per 50 lines of code, if not more
<hcarty> I was using omlet
<hcarty> kmeyer: I think the folding was what slowed things down so much, but I could be wrong
<hcarty> tuareg is the only reason I started using emacs - the vim OCaml mode was really slow
<hcarty> As I said, I'm far from an expert... it's pieced together over time
<hcarty> cygnus_: http://pastebin.com/m250f5d6 -- This is my init.el/.emacs file
<hcarty> Ah, ok
<hcarty> I just added those lines to the end of my .emacs
<hcarty> append-tuareg.el
<hcarty> There is a file in the tuareg .tar.gz...
<hcarty> cygnus_: I've only used it with emacs22 and CVS, but have you modified your .emacs file?

2007-12-02

<hcarty> bluestorm: Thanks
<hcarty> What are "private abbreviation types"? They are listed in the OCaml CVS changelog as a new feature
<hcarty> I hope JoCaml sticks around as it seems quite useful
<hcarty> Is metaocaml still alive?
<hcarty> But I haven't gone through the process of compiling and testing it
<hcarty> Smerdyakov: According to the website it does
<Smerdyakov> hcarty, if not, then you can't really call it another implementation, since 'ocamlc' defines the language.
<Smerdyakov> hcarty, but do they yet cover all features of the regular ocaml compiler?
<Smerdyakov> hcarty, my page certainly has it.
<bluestorm> hcarty: right
<hcarty> You could list/link the ocamljava project as another implementation
<hcarty> bluestorm: True, but to a non-CS person that's quite opaque :-)
<bluestorm> hcarty: "-no ad-hoc polymorphism" seems the right place to say that
<hcarty> bluestorm: As a specific, the + vs +. is a common complaint

2007-11-28

<hcarty> Feel free to write it and submit the patch :-) I'm sure others would find use for it.
<hcarty> JohnnyL: The ocaml repl state is not saved between runs

2007-11-26

<hcarty> jburd: There's a thread on the beginner's list where someone asked for library bindings requests... I don't have a link, but you could put in a request there

2007-11-21

<jeffwheeler> hcarty: thanks
<hcarty> jeffwheeler: http://wiki.cocan.org/training has some more links
<hcarty> But some other simple extras would be nice
<hcarty> Sdflow is a nice library for some similar things, without needing camlp4
<hcarty> Ah, I remember seeing that. I was hoping for something like [1..100]
<hcarty> Jeff_123: Cool, thanks
<hcarty> I don't know the syntax to actually /use/ the extension :-) But I was poking through the source the other day and noticed that

2007-11-20

<hcarty> Should be in there, or the equivalent file in the source .tar.gz

2007-11-19

<hcarty> apastinen: I think there's a camlannot.vim or something along those lines available
<hcarty> But it's not "in code" as you said
<hcarty> You can #use "foo.ml";; if that helps
<hcarty> I don't think the compiler keeps type information around for long enough to do such a thing
<hcarty> apastinen: I think you may have to use the toplevel, or the compiler -i option if I understand correctly
<hcarty> http://ocaml-plplot.googlecode.com/ if anyone is interested in PLplot bindings for OCaml

2007-11-17

<hcarty> al___: I'll second the Pcre over Str recommendation. It's a much nicer module to work with.

2007-11-15

<jburd> hcarty: Using autotools for the building would have helped with distributed compiles as well. The current build system doesn't respect CC shell variables.
<hcarty> As long as $PATH has the correct order it should work properly
<hcarty> jburd: I have the same setup here using godi - I just set the install prefix to a directory under ~
<jburd> hcarty: My Linux distribution's package management system already has a package for Ocaml in place. However, I wanted to check whether I can use an updated version from another directory so it doesn't conflict with the system package.
<hcarty> jburd: I'm not sure, but if you want to build from source, have you tried godi?
<hcarty> The functions map more or less directly to their C counterparts though
<hcarty> And with the exception of one or two functions, if a function takes a "sometype option" parameter it probably isn't wrapped properly yet
<hcarty> A lot of the type definitions are rather ugly, and likely not needed. I haven't made much effort to clean that up yet
<hcarty> flux: http://0ok.org/code/ocaml/plplot/plplot.mli if you're still interested
<flux> hcarty, not really, but I'd like to see the .mli-files, are they online?

2007-11-14

<hcarty> It is in a reasonably usable state for 2D and 3D plots. The only external dependencies are camlidl and plplot 5.7.3 or newer
<hcarty> Anyone here interested in using/testing a plplot OCaml binding?
<hcarty> But it may make life a little easier for a toy project
<hcarty> I may be assaulted for suggesting such a thing...
<hcarty> mbishop: Would it be too much of a problem to (locally) redefine (+) etc?

2007-11-13

<hcarty> There may be something in there indicating where it comes from
<hcarty> chris2: I think there is some 3.10.0 metaocaml stuff in the Debian subversion repository
<hcarty> Thank you again
<hcarty> rwmjones: I just gave it a quick test, and it works beautifully for what I currently need
<hcarty> The header file I'm working with at the moment is 812 lines, so I think non-tailrecursive is ok for the time being
<hcarty> rwmjones: Yes, I've seen perl4caml. I may end up using that if something is too hairy in OCaml.
<rwmjones> hcarty, also did you know about perl4caml?
<rwmjones> hcarty, that input_all_lines function will probably blow the stack if you call it on a large file
<hcarty> Some slightly-automated camlidl binding generation. The code is currently in quickly-hacked Perl.
<hcarty> I just want to catch output from cpp at the moment
<hcarty> That should work for what I need now though, so thank you very much
<hcarty> rwmjones: Excellent, thanks!
<rwmjones> hcarty, but also try this ...
<rwmjones> hcarty, Unix.open_process_in
<hcarty> What is the equivalent of the Perl $output = `some_program` in OCaml? The Unix module seems to have functions which run some_program in parallel, but I just want to wait for the output

2007-11-06

<hcarty> mbishop: I think there was, but I don't remember the difference(s) between them
<mbishop> hcarty: wasn't there another one?
<hcarty> loufoque: Aside from extlib, there is Vec http://www.dealfaro.com/home/vec.html

2007-11-05

<hcarty> My understanding is that is what (foo : type) does
<hcarty> That's uglier than it should be... but shows the problem somewhat
<hcarty> kazzmir_: http://pastebin.com/mcf9a7ed
<hcarty> kazzmir_: It's an easy pitfall when starting out with OCaml records

2007-11-02

<hcarty> zbrown: Thanks, will do
<zbrown> hcarty: same for you
<hcarty> zbrown: Thanks, that sounds pretty cool
<zbrown> hcarty: our CS program includes mostly functional programming, we do very little outside of functional programming
<zbrown> hcarty: I work for IMACS (Institute for Math and Comp Sci)
<zbrown> hcarty: we base our material off of "The Little Schemer" book
<hcarty> zbrown: What setup do you use to teach Scheme to them? My brother isa bit older than that, but looking to learn to program
<hcarty> http://ocaml.cn/planet - that's the one I was thinking of
<hcarty> bluestorm_: I think there is an OCaml planet site
<hcarty> bluestorm_: I've looked at it, but building it is not well documented
<det> hcarty, Yeah, I am going that route
<hcarty> det: I think you'd have to backport Debian Sid packages yourself

2007-10-31

<hcarty> salierix: There is also the Vec library (which I have not used) - http://www.dealfaro.com/home/vec.html
<hcarty> rwmjones: libunbin looks very useful. Thanks for putting it out.
<hcarty> tristram: ocaml-gsl may have something you can use

2007-10-28

<hcarty> salierix: It's somewhat of a personal choice. The original syntax is used more often, but there are tools to automatically convert the syntaxes back and forth
<hcarty> Which makes testing things in the toplevel a pain
<hcarty> A first #use works ok, but a second gives "I/O error: Bad file descriptor"
<hcarty> Is there a way to #use multiple files in the toplevel after loading a camlp4 extension?

2007-10-20

<hcarty> ex. ocaml and friends installed under /usr/... and some libraries installed in $HOME/...
<hcarty> Is there a way to tell findlib to install to and look for packages in a specific location?

2007-10-19

<hcarty> loufoque: Functors might do what you want as well
<hcarty> Just use ./bootstrap --section 3.10 (+ whatever other options you want)
<hcarty> Yes, I don't think the site has been updated, but the installer does support it
<hcarty> DT: Godi does have 3.10 support, you just have to specify that you want it during the bootstrap process

2007-10-18

<hcarty> Thanks! The more examples, the better
<hcarty> Or http://brion.inria.fr/gallium/index.php/Camlp4 which seems to be collect 3.10-specific information
<hcarty> Yoric[DT]: What is the extension for? And any chance you'd be willing to add your findings to the wiki?

2007-10-17

<DT> hcarty: spent a few hours on it...

2007-10-12

<hcarty> For simple cases at least...
<hcarty> It seems like it should be a fairly straightforward process
<hcarty> If I get the time I'd like to make a simple FrontC-based program to parse a .h file and add appropriate camlidl attributes
<hcarty> flux: The FrontC library looks like it would be a decent start for an interface generator - combined with camlidl

2007-10-10

<hcarty> flux-_: Thanks for the information
<hcarty> I've wondered for a while what the '%' implies and how it should be used
<hcarty> flux-_: Is this documented somewhere? I don't see it in the C-interface portion of the manual
<hcarty> munga: I'm not sure re: the "%identity" portion, but (for example) you can use external definitions to define the types for C function calls

2007-10-01

<hcarty> Tac-Tics: postgres interface for OCaml - http://caml.inria.fr/cgi-bin/hump.en.cgi?contrib=501
<hcarty> But I only toyed with it for ~20 minutes, and that was a while ago