<rwmjones>
hcarty, I think he's wrong there .. extending a uint32 to a uint64 also needs to be treated specially
<hcarty>
thelema: I have some extra functions for the Bigarray.Genarray library if you are interested for your community branch. map, fold, unsafe_(get|set), iter and cast. Maybe a few others.
<hcarty>
Does this seem like a reasonable undertaking for a person new to camlp4
<hcarty>
bluestorm: I would like to (try to) make a Bigarray sub and slice extension, something to do the following: http://ocaml.pastewith.us/60
2008-04-09
<hcarty>
git does suffer from a lot of older tutorials now being very out-dated
<ertai>
hcarty: and tags are still the way to depend on everything else
<ertai>
hcarty: about history of changes darcs still have the same model where changes are not fully ordered and only dependencies force some order
<hcarty>
But I use git now because of the painless branching
<hcarty>
I still think darcs has the best UI
<hcarty>
ertai: Does darcs have a way now to keep a clear history of changes without manual tagging? That was the main reason I switched away from it...
<hcarty>
OH, right... I read about that. So a rebase screws up the hash
<thelema>
hcarty: git references objects by SHA1 hash.
<hcarty>
I'm relatively new to git, so I ask out of ignorance
<hcarty>
Why is that?
<thelema>
hcarty: I can't and won't do git-rebase on the public tree.
<hcarty>
thelema: Would something along the lines of a regular "git rebase" make it clearer regarding what is original vs changed? You may do this already...
2008-04-08
<hcarty>
sporkmonger: Will "let round x = int_of_float (x +. 0.5)" do what you need?
<hcarty>
sporkmonger: Yes... replacing floor with int_of_float will give an int rather than float result
<hcarty>
sporkmonger: I was using something along the lines of floor (x +. 0.5) as a rounding function in some relatively recent code
<Jedai>
hcarty: Well option is not very convenient if you don't have good utility function to manipulate it, Haskell has those plus the Maybe Monad which is pretty useful to chain action that can fail without being explicit about it
<hcarty>
ertai: For the web interface, cloning, or writing to the repo?
<thelema>
hcarty: ah. yes, I established both, with help from julien_moutinho in doing the git-cvs migration and needed fixes afterwards
<hcarty>
sanxiyn: It generally takes place on caml-list
<hcarty>
thelema: I mean that you established both repos, not the hosts
<thelema>
hcarty: I doubt the github people have anything to do with repo.or.cz, as the second uses very crude code and interface, and the first is extremely polished. I'd guess very different people.
<thelema>
hcarty: if there is a relationship, I'm not aware of one.
<hcarty>
thelema: Ah, ok. I wondered about the relationship between the githib and repo.or.cz OCaml forks
<thelema>
hcarty: it's clearly not, and I expect them to say "use a different git host" (I have a more complete repo on repo.or.cz with these patches)
<hcarty>
"Is it ok to add these patches, given that github does X?"
<thelema>
hcarty: what's the question?
<hcarty>
thelema: I think the core devs would probably answer your question on the mailing list if you ask there. And I am sure others would be interested in hearing about this as well.
<hcarty>
SML also seems to, unfortunately, lack an C FFI generator like camlidl. And sugar like printf.
2008-04-04
<qwr>
hcarty: haven't used it. probably won't either, if it's so slow.
<hcarty>
qwr: omlet seems to have the best indentation, but once files get over ~100 lines it gets very slow... 10s of seconds to indent a new line in my experience
<hcarty>
alexyk: It's not an OO module
<hcarty>
Otherwise I never would have gone to the Dark Side (emacs)
<hcarty>
qwr: The indenting is slow and/or inaccurate in my experience
<thelema>
hcarty: you pay a CPU/GC penalty for guessing too small, and a RAM penlty for guessing too large. But neither penalty is severe. Order of magnitude guess suffices.
<hcarty>
If you have a reasonable guess for your initial size, then it just means that it has to grow less, or not at all
<hcarty>
alexyk: You can set the initial size to anything - it will grow to be as large as needed
<hcarty>
No one has written one. There is ocaml+twt, but it is a preprocessor separate from camlp4
<hcarty>
s/bugs/typos/
<hcarty>
emacs here as well, because its auto-indent catches bugs for me
<hcarty>
OcaIDE does something similar for OCaml I think, though from what I have heard it is less advanced than the F# support in VS
<hcarty>
I think these are the kinds of APIs the core OCaml folks want to community to put together
<hcarty>
ikatz: If you are still looking for a statistics module, ocamlgsl has some useful functions
2008-03-31
<rwmjones>
hcarty, no problem, but I think the CIL report needs to go upstream. OTOH it requires fixing their build system which is going to be a major effort for anyone who undertakes it
<hcarty>
rwmjones: You are welcome re: the bug reports. Thanks for the quick replies/fixes.
<rwmjones>
hcarty, thanks for those bug reports, I'll take a look at them later today
2008-03-28
<Smerdyakov>
hcarty, everything looks like on big heap.
<hcarty>
Smerdyakov: What would be the method for accessing data, either local or remote?
<hcarty>
Ok, sounds good
<hcarty>
rwmjones: Thanks for the quick Calendar update in Fedora
<hcarty>
match some_list with [] -> "empty" | hd :: [] -> "one" | hd :: tl -> "more" --- There is a lot you can do with match
<hcarty>
I am not sure of the exact restrictions or the implementation
<hcarty>
match works with just about anything
<hcarty>
The | is the separator between cases
<hcarty>
match str with "foo" -> a | "bar" -> b | ...
<hcarty>
let exclamation = match a = b with true -> "Hooray!" | false -> "Nooooo!";;
<hcarty>
Sorry, should start with: match (something) with ...
<hcarty>
palomer: I haven't used it, but I would guess that it is listed somewhere in the GTK documentation. It could be a key code or something similar.
2008-03-21
<hcarty>
I have used class foo x = let ... in object .. end more than initializers directly, but they are both useful
<hcarty>
palomer: The OO chapters in Jason Hickey's book give a nice overview of OCaml's object system
<hcarty>
Swig's bindings are rather thick - they wrap everything to and from C in a big variant type (I think that's the correct name...)
2008-03-20
<hcarty>
Most likely
2008-03-19
<hcarty>
Yoric[DT]: I completely understand. Do you have any pointers on where to start with fixing it? If not, I'll dig through it on my own as I have time
<hcarty>
I think comprehension.cma should include all of these modules (MoreFoo)
<hcarty>
But the MoreArray and MoreList modules still seem to be missing
<hcarty>
seems to get part of it
<hcarty>
Yoric[DT]: What are the proper steps to use your comprehensions extension in the toplevel? #load "camlp4of.cma";; then #require "comprehension";; then #load "pa_comprehension.cma";;
2008-03-18
<RobertFischer>
hcarty: I think you misunderstood. I was trying to reinvent JoCaml *in Java*, and then punted over to just working in JoCaml. :)
<hcarty>
RobertFischer: I don't know how well it would suit your needs, but OCamlp3l compiles cleanly on 3.10.1 if you have not tried it yet
<thelema>
hcarty: as far as I can tell, binaries don't have much restriction on them. There's some language making sure that a fork doesn't claim support from the original authors
<hcarty>
But I think I understand the applicable restrictions now
<hcarty>
thelema: Makes sense. I was unclear if the original + patches restriction was for sources only, or if it also imposed some further restriction on binaries
<thelema>
hcarty: QPL + debian = OK (see above)
<hcarty>
But I had thought it was more restrictive than that
<hcarty>
Ah, ok. Well that seems not so bad then... annoying having to do original + patches as you mentioned
<hcarty>
I am thinking along the lines of modified source -> binary though. I don't know much about the QPL, so I am just curious
<hcarty>
But I could very well be wrong
<hcarty>
I think KDE was always GPL, but Qt was not
<hcarty>
thelema: What about the binaries of those modified sources? Would it make problems for something like Debian?
<thelema>
hcarty: I'm surprised it's showing up in google searches. I guess it's public, but...
<thelema>
hcarty: a branch of the INRIA code with improvements made to the stdlib (mostly list, array and string)
<hcarty>
thelema: What is the purpose for the git repo? I have seen it linked from a few places, and it has popped up on Google searches
2008-03-17
<hcarty>
tsuyoshi: Thanks, seems to be working without it
<tsuyoshi>
hcarty: I don't think it needs to
2008-03-16
<hcarty>
The only purpose of the function is to see if a particular callback has been defined, so I do not think any GC items should be invoked
<hcarty>
Does a function which only calls caml_named_value need to use CAMLparam* and CAMLreturn* ?
2008-03-15
<hcarty>
OCaml is less different from "other" languages (C, Java, etc) than Haskell, but still quite different
<hcarty>
And better will likely depend on what you want to use it for
<hcarty>
Though, to be fair, the opinions in here may be rather biased
<hcarty>
Yes!
2008-03-14
<hcarty>
Unless you use appropriate ((())), but that makes it even more verbose
<hcarty>
You can assign priority with camlp4 though I think
<hcarty>
let (/%) x f = f x and (%/) f x = f x;;
<hcarty>
Thanks... I don't know if I will use it, but it is useful to know
<hcarty>
I was just testing that in the toplevel :-)
<hcarty>
bluestorm: I have not, but that makes sense
<bluestorm>
hcarty: have you seen the "ocaml only" trick for "any function as infix" ?
<hcarty>
flux: I know it exists for camlp4 3.09 (and maybe works with camlp5?). And I think you are correct - each module/file would have to be preprocessed and declare the infix locally
<flux>
hcarty, I think I've seen that..
<hcarty>
If so, we could beat them to it
<hcarty>
Does the "any function as infix" camlp4 extension exist for OCaml 3.10?
<hcarty>
If Perl 6 came along sooner, or if Perl 5 had easier function argument type restrictions, I likely would have stuck with Perl + PDL rather than coming to OCaml
<thelema>
hcarty: yes, I think it still has them.
<hcarty>
Something like <<+>>
<hcarty>
I don't know if it still does, but Perl6 also had "hyperoperators"
<hcarty>
Ah, I see the problem - some of the examples are missing some type casts/converting function calls
<hcarty>
delamarche: If you do give ocamlp3l a try, please post your results. I am trying some of the examples in the manual and not getting the indicated results. Type differences, mainly
<hcarty>
The folks who want to keep everything in their program purely functional, though, tend to not use printf from what I've seen here and on th ML
<hcarty>
bluestorm: Exactly
<bluestorm>
hcarty: you can come up with purely functional printf
<hcarty>
And it does not hurt readability that much IF used carefully
<hcarty>
I use it quite often... along with sprintf. It can save a lot of typing.
<hcarty>
printf is just that darn cool
<hcarty>
That is my understanding
<hcarty>
They are included to have a C-like printf in a language that normally would not support such a thing
<hcarty>
jonafan: The printf family of functions have special handling in OCaml
<hcarty>
"may not be much" and "is no" that is
<hcarty>
But "may not be" and "is no" are two completely different things in this context...
<hcarty>
There may not be much trouble in OSX - it seems to be written entirely in OCaml
<hcarty>
delamarche: For what it's worth, I just downloaded and compiled ocamlp3l. I haven't tested it, but it did "make configure && make compile" cleanly using Debian's OCaml 3.10.1 packages
<hcarty>
It is part of the official OCaml package in 3.10.0+
<hcarty>
Or this may not be an OCaml compiling question...
<hcarty>
letrec: Did you run "make opt" after "make world", or just "make world.opt"? I think the native code compiler is built in a separate step
<hcarty>
That, and relying on godi or Debian to sort out the upgrading details
<hcarty>
I have had good results going from 3.09 to 3.10 with non-camlp4'd things. But I am sure that is largely due to the libraries I use
<hcarty>
Does camlp3l work with OCaml 3.10.x?
<hcarty>
Particularly since OCaml apparently has some level of function on the system
<hcarty>
I am looking forward to being able to afford to spend the money on a PS3 and play around with programming on it
<hcarty>
delamarche: Is camlp3l maintained? Both it and JoCaml look like very cool projects.
2008-03-13
<hcarty>
bluestorm: Hopefully Hickey's book will be around soon. I am looking forward to buying a copy. Maybe more will follow after that?
<hcarty>
You are the first person I've heard any feedback from, so I'm glad to hear someone can at least compile something with it :-)
<hcarty>
You're quite welcome. Please let me know how it goes for you and if you have any further problems
<hcarty>
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH may fix that
<hcarty>
with both, that is
<hcarty>
I had similar trouble with Debian packages and self-compiled plplot installed
<hcarty>
You can try running ldd /usr/local/lib/ocaml/3.09.2/stublibs/dllplplot_stubs.so to see if it is looking at the correct plplot files
<hcarty>
mbishop: Not a problem... sorry that I skipped 5.6.x, but versions 5.7.x+ have a few functions I needed
<mbishop>
hcarty: there?
2008-03-12
<hcarty>
Not as flexible as OUnit, but it works well for its limited domain
<hcarty>
Or # ok (true) "Is true really true?"
<hcarty>
TestSimple has the horrendously complicated syntax of # is 1 1 "Check if 1 = 1";;
<hcarty>
ziph: TestSimple is, as its name suggests, very simple to use
2008-03-11
<hcarty>
Adding array support would open it up a lot, but probably add a significant amount of complexity to the camlp4.
<hcarty>
I see.. automating the call to send_an_int
<thelema>
hcarty: ciml does part of that, yes.
<hcarty>
Isn't that more or less what ciml does?
<hcarty>
The OCaml interface to that code uses that c_obj type to pass values back and forth though
<hcarty>
Every value from C is wrapped in a Swig_C variant type
<hcarty>
Yes, swig seems to do that. But the result is a little ugly
<hcarty>
WatersOfOblivion: I do not think there are any automated tools available for that
<hcarty>
thelema: Forklift is an attempt at doing something similar as well
<thelema>
hcarty: ciml does contain one piece of the puzzle - automatic conversion to/from base data types
<hcarty>
thelema: Hence "kind of" :-) ... it may come down to callbacks, void* and things like that
<thelema>
hcarty: that's still writing C.
<hcarty>
thelema: ciml kind of lets you write them in OCaml
<hcarty>
ocaml-tutorial.org
<hcarty>
ack, actually
<hcarty>
let x = if expr then y else z in ... actualy
<hcarty>
let x = if expr then y else z
<hcarty>
tail is not in scope at that point, unless I am reading this incorrectly
<leiff>
hcarty: yes, i'm using it as a comparison
<hcarty>
"=" is comparison, not assignment, for one
<hcarty>
I don't think it does what you want it to do
<hcarty>
leiff: They are correct. I didn't read over the code properly.
<leiff>
hcarty: i'm still getting syntax error now on this line: in match tail with line
<hcarty>
I'm just looking at the syntax, not what is being done... likely a bad move on my part
<hcarty>
leiff: Try replacing "and" with &&
<hcarty>
I could see a privately funded company feeling differently about their own work though.
<hcarty>
Personally, as someone doing research, the thought of having my publicly funded research turned in to something not publicly beneficial is rather distasteful
<hcarty>
(joking, of course)
<hcarty>
And can't you just share everything you write? :-)
<hcarty>
I respectfully feel the same about the issue of bindings not being worth their own license :-)
<hcarty>
If it were insignificant, then the reimplementation of the binding would not be an issue
<hcarty>
It may significant to the author of the binding
<hcarty>
Work depends on how thin or thick the binding is - there can be a lot of work in writing a clean, high level binding to a low-level C library
<hcarty>
It would be very useful to someone who wants to add a closed modification. Less so for others.
<hcarty>
As flux said, if a user/developer is unhappy with that then they can rewrite the binding themselves
<hcarty>
But the binding author may want that inconvenience to be there... depends on their interests and intentions
<hcarty>
Are there no shared libraries at all with OCaml, or just none for native code? I am unclear on that...
<hcarty>
Most bindings do stick to the original license though, don't they?
<hcarty>
flux: From the perspective of the person writing the binding - the binding code is theirs, not the wrapped library author's. So while I certainly understand your position, I think it can be argued equally effective both ways.
<hcarty>
I think these could be made much easier with the right "camlidl toolkit", but I do not know what pieces should go in to such a thing
<hcarty>
But anything with callbacks and void* in general is wrapped by hand
<hcarty>
In my case most of the functions are similar to f(float* x, int length_of_x) so those are handled by camlidl easily enough
<hcarty>
flux: I think it could be with some extra tools. camlidl is QPL and the libs are LGPL, so it is modifiable.
<hcarty>
rwmjones: Yes, it requires a lot of manual intervention. And if the C library is inconsistent then you lose the benefit of that intervention.
<hcarty>
AND the functions you are wrapping are fairly simple
<hcarty>
I think camlidl's end results tend to do a decent job of hiding the "C-ish-ness" of the original library IF you are very careful with the input to camlidl
<hcarty>
Swig seems like it could be decent, but the interfaces it generates are rather thick and ugly
<hcarty>
I tried getting Forklift to work, but was unable to do so in the time I had
<hcarty>
Sadly I think that is beyond what my (f time know_how) will allow
<rwmjones>
hcarty, it'd be nice to use something like FrontC (CIL) to generate bindings ... I don't think going via camlidl would be worthwhile, maybe not even possible. A major undertaking mind you ...
<hcarty>
It would be nice to generate a tool using FrontC to generate camlidl input
<hcarty>
I think I have gotten off easy ... both PLplot and HDF have fairly simple interfaces so camlidl has handles most of the functions without trouble
<hcarty>
rwmjones: How do you feel about camlidl (for the simple stuff at least) after using it for ocaml-newt?
<hcarty>
stugy: You can try GODI
<stugy>
hcarty: well remembered
<hcarty>
oops, I should look before hitting enter :-)
<hcarty>
stugy: What version of OCaml do you have? If I remember correctly, some C bigarray functions were added/changed around 3.10.0
<hcarty>
letrec: let f x = match x with y when y = Int32.one -> true _ -> false;; should do what you want
<hcarty>
adu: No, but if you want to chat up OCaml some time that's cool
<hcarty>
And then goodnight fellow DC person, as it really it quite late
<adu>
hcarty: do you drink coffee?
<adu>
hcarty: hello
<hcarty>
adu: Hello fellow DC person
<hcarty>
I just need to merge the two
<hcarty>
thelema: I do now - he sent it to me recently by email. I made the changes to 0.01 from the web site though
<thelema>
hcarty: You don't have 0.02?
<hcarty>
pysieved? Something you maintain I'm guessing?
<hcarty>
It does not make a huge difference, but I find it a bit easier to work with
<hcarty>
Stevan Little sent me the updated version and said that he does not have time at the moment to post an update, but I am planning on updating the changes to 0.02 and sending them back to him
<hcarty>
thelema: If you are interested, I have made some changes to TestSimple 0.01 to include findlib support and build with ocamlbuild
2008-03-10
<hcarty>
Yes, what flux said :-)
<hcarty>
val f : int -> int = <fun>
<hcarty>
# let f x : int = x;;
<hcarty>
ziph: let f x : int = ... But that can only make a function type more specific, it will not override the type inference completely
<hcarty>
So it will hopefully be fixed in 3.11 or sooner...
<hcarty>
flux: I was wrong regarding the toplevel bug report. It has been marked as acknowledged
<hcarty>
flux: None yet
<flux>
hcarty, has there been any response?
<hcarty>
flux: I submitted one a week or few ago
<flux>
hcarty, is there a bug open?
<hcarty>
It will work once, but following uses give an I/O error
<hcarty>
evn_: Using camlp4 in a toplevel breaks the #use "foo.ml";; command
<hcarty>
All of these interesting new camlp4 extensions make related toplevel problems even more unfortunate
<hcarty>
Also, if you are doing much script-like work with OCaml then it may be worth looking in to ocamlscript - it does some trickery to compile scripts to native code
<hcarty>
alexyk: The ocaml executable does differentiate between interactive and non-interactive sessions, so it may only use ~/.ocamlinit when the session in interactive
2008-03-09
<bluestorm>
hcarty: lighter lambda expressions
<hcarty>
bluestorm: What is the purpose of the pa_holes extension?
2008-03-06
<stugy>
hcarty: do you know how to print out a matrix?
<hcarty>
Best of luck
<hcarty>
When I get back to the curve fitting problem again, I plan on trying out lacaml
<stugy>
hcarty: thanks. I'll give it a shot
<hcarty>
I have done some simple (and incorrectly implemented on my end) curve fitting, and a lot of statistics using ocamlgsl
<hcarty>
ocamlgsl seems to work well. I have not had any crashes/segfaults or anything of that nature with it.
<hcarty>
RobertFischer: No actual package building or anything of that nature... just a few dependency checks
<hcarty>
#load does not open the module automatically
<hcarty>
AxleLonghorn: Have you used "open Str"?
<hcarty>
AxleLonghorn: If you have findlib, then you can "#use "topfind";;" then "#require "str";;" as well
2008-03-05
<hcarty>
That is where the naming convention would help
<hcarty>
bluestorm_: I agree. And I think the META files may provide enough information to resolve dependencies as well
<hcarty>
ocamlfind is a very nice tool
<hcarty>
+ wget
<hcarty>
I think that, at the start, ocamlfind + make + a META file + a standard naming convention will get things moving
<hcarty>
I have no idea how much I'll actually be able to accomplish ... I need to do my prospectus defense this semester. But a side project can be useful.
<hcarty>
I would be happy to work on this as I am able
<hcarty>
1 through 3 should require much less server-side infrastructure, at least for a CPAN-like system (if I understand correctly)
<hcarty>
Sylvain Le Gall's server may be able to handle 4 if someone writes the infrastructure
<hcarty>
and standard build targets for those points
<hcarty>
RobertFischer: 2 and 4 could be met with a standard build wrapper (make or otherwise)