Re: [Caml-list] Desktop GUI toolkits - current state of the art?

2010-11-29 Thread Hezekiah M. Carty
On Sun, Nov 28, 2010 at 3:28 AM, bluestorm  wrote:
> There was also a project by Chris King to develop a GUI based on lablgtk in
> a Functional Reactive Programming style.
> http://lambda-the-ultimate.org/node/1918

Chris King's project was a major influence in the syntax I chose.  I
started trying to mix in some FRP with the React module, but never
completed the work.  I moved Gtk-light to the forge if anyone is
interested in working with the code:

http://gtk-light.forge.ocamlcore.org/

Thanks to the thelema folks for allowing me to use some of the
Batteries code for the index page.

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Desktop GUI toolkits - current state of the art?

2010-11-24 Thread Hezekiah M. Carty
On Wed, Nov 24, 2010 at 4:47 AM, Martin DeMello  wrote:
>
> I was surprised not to see much interest in GUI DSLs in OCaml.

It's not complete or a full-blown DSL, but I started a small Gtk-light
module a while ago.  I haven't had the time to complete it, but it
shouldn't be too difficult to modify for your needs:

http://0ok.org/cgit/cgit.cgi/gtk-light/

Here is a brief example (uses the "open Module in" syntax extension):

http://0ok.org/cgit/cgit.cgi/gtk-light/tree/basic_gui_test.ml

With OCaml 3.12 the "open Module in" could be replaced by the new "let
open Module in" or Module.(...) syntax.

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Native toplevel? (was: OCamlJit 2.0)

2010-11-19 Thread Hezekiah M. Carty
On Fri, Nov 19, 2010 at 1:09 PM, David MENTRE  wrote:
> Hello,
>
> 2010/11/18 Ashish Agarwal :
>> Rapid prototyping for me often involves a couple of lines of code that read
>> in a very large file and do something with it. I have to keep compiling
>> these small programs to native code because the performance of the toplevel
>> is too slow. Then, I have to recompile and re-read the whole file for every
>> little additional thing I want to compute. A high-performance toplevel would
>> help in this kind of work.
>
> Or use ocamlscript: http://martin.jambon.free.fr/ocamlscript.html
>

ocamlscript is certainly a wonderful tool, for prototyping and
otherwise.  It unfortunately doesn't help specifically with the "load
a large file and do something with it" case.  A native-code toplevel
allows you to keep the native code speed benefits and load the file
only once.  Interactive experimentation on the file's data then
doesn't require waiting for the data to be read in each time.

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] nan and infinity in C bindings..

2010-11-15 Thread Hezekiah M. Carty
On Sat, Nov 13, 2010 at 10:12 PM, Romain Beauxis  wrote:
>
> I have a code that uses an external C library (fftw3) for float (double)
> computations.
>
> I get nan and infinity values back in OCaml using Store_double_field... Is it
> possible or do I have a problem in my binding code ?
>

If nan and infinity values are possible in fftw3's results then this
is possible.

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] why is the forward pipe operator (>|) so little used?

2010-10-02 Thread Hezekiah M. Carty
On Sat, Oct 2, 2010 at 2:22 PM, ben kuin  wrote:
> hi
> Reading a few introduction F# articles and presentations I made the
> observation that the forward pipe operator is widely popular. Its also
> a language feature that, when it comes  up on blogposts or on
> stackoverflow, its  presented as a special F# feature.
> In the Ocaml world the pipe doesn't have a special place. I doesn't
> come up in any of the Ocaml Books (print or pdf) and hardly any
> internet articles or blog posts. For example Jon Harrop mentions the
> pipe in one of his F# books but not in the Ocaml for Scientists book.
> Looking at the mentioned F# code, I think the usage of the pipe has an
> ( imho positive) impact on the style and the readability of the code.
> But obviously the proficient Ocaml folks don't use it - could someone
> may explain the reason(s)?
> thanks
> ben
>

Ben,

A ( |> ) operator is provided in Batteries.  I use it quite
frequently.  I expect that others do as well.

That said, most books stick to the standard library.  It is therefore
less likely that they would use such an operator unless it is defined
in the text of the book.

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] from if...else to pattern matching

2010-10-02 Thread Hezekiah M. Carty
On Sat, Oct 2, 2010 at 10:47 AM, ben kuin  wrote:
>>
>> # let t x = match x with
>>  a when x<=4 -> true
>>  | _ -> false;;
>>
>
> ok, I had a similar attempt with
>
>    let tt x = function
>    a when x<=4 -> true
>    | _ -> false;;
>
> but that gave me the following (scary  -> 'a -> ) signature
>
>     val tt : int -> 'a -> bool = 
>
> so I stopped
>
> thanks anyway
>

This seems to be a common beginner mistake (hence the reference to the
beginner's list).  You defined tt as a function which takes two
arguments, x and another matched by "function" - which tt ignores the
value of (a when x <= 4).  The pattern-matched value is never used,
therefore it can be any type.

Hope this helps,

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] OCaml 3.12.0+beta1

2010-06-24 Thread Hezekiah M. Carty
On Thu, Jun 24, 2010 at 4:49 PM, Florent Ouchet  wrote:
>
> This specific ( { ; _} ) forward compatibility with ocaml <3.12 is possible
> for a little cost. It's just about removing the extra underscore characters.
> Anyway if the preprocessing script does not come out of the ocaml 3.12 box,
> I will have to do it. Other developers may have to so as well.
> Mainly because this coverage check is a must-do and because I do not want to
> force a general update to OCaml 3.12 when that can be avoided. The coverage
> check has to be done only once, at "developer's" side, using 3.12. Once the
> changes are done, stripped code can easily be compiled using older versions
> of OCaml, at "user's" side.
>

The trailing _ in a record match is not required.  It is allowed in
3.12, and in combination with an optional warning flag it can be used
to check for incomplete record matches.  Why is any preprocessing
needed?  If an application is written to require OCaml 3.12.x or
later, why would you expect it to compile with an earlier version?

How is this a bigger "backward compatibility" break than first-class
modules or the "let open Module in" syntax?

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Static exception analysis or alternative to using exceptions

2010-05-27 Thread Hezekiah M. Carty
On Wed, May 26, 2010 at 11:37 PM, Jacques Le Normand
 wrote:
> Jane Street's Core seems to prefer options to exceptions
>

Batteries also includes a number of Exceptionless modules (ex.
Array.Exceptionless) which wrap exception-raising functions to use
options instead.

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] cmake

2009-12-02 Thread Hezekiah M. Carty
On Wed, Dec 2, 2009 at 4:08 AM, Keyan  wrote:
> hi,
>
> i am currently getting into caml again, and would like to integrate it with 
> my c++ project.
>
> the project i am working on, is completly build with cmake. i tried to search 
> the internet to find ready cmake-scripts or tutorials how to integrate cmake 
> into an exisisting cmake-project, but could not find anything. my question 
> thereore is, how is it done best?
>
> what i want to do is the following:
> in addition to the main-project build, i want to build my own code-analysis 
> tools.
>
> make -> build main project + all ocaml-tools
> make ocaml-tool-1 -> build only cmake-tool-1
> etc.
>
> does anyone have any experience with that?
>

The PLplot project (http://plplot.sf.net/) uses CMake for its build
system, including bindings for OCaml.  The most relevant files for the
OCaml portion are:

http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/cmake/modules/ocaml.cmake?revision=10526&view=markup
http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/bindings/ocaml/CMakeLists.txt?revision=10527&view=markup
http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/bindings/ocaml/plcairo/CMakeLists.txt?revision=10528&view=markup

The first file (ocaml.cmake) performs detects the presence of the
OCaml compiler(s), camlidl and a few libraries.  The two
CMakeLists.txt files define the actual compilation steps for two
separate components of the OCaml bindings (camlidl + C + OCaml).

CMake does not have formal OCaml support, so all of the compilation
commands, outputs and dependencies are specified by hand.

Hope this helps.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Ocamlbuild + unexpected dependency

2009-10-23 Thread Hezekiah M. Carty
On Fri, Oct 23, 2009 at 11:04 AM, Dario Teixeira
 wrote:
>
> I'm using the Xstrp4 syntax extension to include an external
> file "data.txt" inside a "foobar.ml" file.  I'm also using
> ocamlbuild to build the project.  How do I tell ocamlbuild
> that data.txt should be also be copied to the _build directory
> for building?  Ocamlbuild by default has no way of knowing that
> foobar.ml depends on data.txt.  (I am presently using an absolute
> path to get around this, which is not very portable).
>

I'm not sure if there is a better way to do this, but you can add the
dependency in your myocamlbuild.ml file.  Add something along the
lines of this:

---
let xstrp4_includes = "data.txt"

...
| After_rules ->
...

dep ["compile"; "the_xstrp4_tag"] xstrp4_includes;
---

I use this to support external includes with camlidl + ocamlbuild.

Hope this helps,

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


[Caml-list] ocamlfind and GODI packaging sprint summary

2009-09-09 Thread Hezekiah M. Carty
The OCaml packaging sprint is now complete.  It was quite a success!

In total, seven packages were worked on today as part of this effort:

- cairo-ocaml
- bitstring
- mlpost
- ocamlgsl
- Deriving
- coThreads
- Uuidm

Out of these seven packages, the packaging efforts are in several states.

New package available in GODI:
- ocamlgsl

Ready for GODI, pending upload:
- bitstring
- Uuidm

Almost ready, requiring a bit more testing/tweaking:
- Cairo-OCaml
- mlpost

In progress:
- Deriving
- coThreads

So ocamlgsl is out there now and installable in GODI, with the other
packages hopefully following in the next few days.

You can read more, and find some ideas for libraries to package if you
are interested, at the wiki page:

http://ocamlsprint.couch.it/ocamlfind_and_GODI_packaging

Thanks to everyone who was involved in the packaging effort today!

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


[Caml-list] Re: ocamlfind and GODI packaging sprint this Wednesday, 9/9

2009-09-09 Thread Hezekiah M. Carty
This is just a reminder that the packaging sprint is currently in
progress.  For more information or to take part, please drop by #ocaml
on freenode and/or check out the wiki page:

http://ocamlsprint.couch.it/ocamlfind_and_GODI_packaging

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] ocamlfind and GODI packaging sprint this Wednesday, 9/9

2009-09-08 Thread Hezekiah M. Carty
On Tue, Sep 8, 2009 at 7:55 AM, Cedric Auger wrote:
>
> Hezekiah M. Carty a écrit :
>> There will be an informal GODI packaging sprint for OCaml libraries
>> this Wednesday, 9/9, with coordination taking place via IRC (#ocaml on
>> Freenode).  Some information (documentation, ideas for libraries to
>> package) is available here:
>>
>> http://ocamlsprint.couch.it/ocamlfind_and_GODI_packaging
>
> For cairo-ocaml, take a look at http://www.lri.fr/~cauger; there is also a
> package for bitstring and one for mlpost (the latter is partly developped by
> JC Filiâtre).

Thank you for the information and link!  Those packages will be
helpful for the libraries themselves and as examples.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


[Caml-list] ocamlfind and GODI packaging sprint this Wednesday, 9/9

2009-09-07 Thread Hezekiah M. Carty
For any who are interested:

There will be an informal GODI packaging sprint for OCaml libraries
this Wednesday, 9/9, with coordination taking place via IRC (#ocaml on
Freenode).  Some information (documentation, ideas for libraries to
package) is available here:

http://ocamlsprint.couch.it/ocamlfind_and_GODI_packaging

The site is a wiki, so please feel free to add links to packaging
documentation, ideas for libraries to package or other relevant
information.

Everyone is welcome!  The plan is to continue the packaging efforts
throughout the day.  If you are interested, please drop by for as long
or short a time as you like.

Many thanks to bluestorm for suggesting and initiating this effort!

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Why don't you use batteries?

2009-09-04 Thread Hezekiah M. Carty
On Fri, Sep 4, 2009 at 9:10 AM, Richard Jones wrote:
> Give them a live CD.
>
> There are various online projects where you can create live CDs with a
> custom set of packages via a webpage.[1]
>
> A live CD is actually better than relying on them trying to install
> something under Windows, because you're guaranteeing a consistent
> environment.  And you can provide them with customized bits too (like
> the coursework!)
>
> If you provide the live CD as both a physical CD and a downloadable
> ISO, they can even run it virtualized so they don't need to reboot.

This may be a nice longer-term goal for Batteries and/or Community
OCaml.  Providing a livecd or perhaps a ready-to-go virtual machine
image would make it much simpler for folks with problems (4) and (6)
to try out both OCaml and Batteries in a known-functional environment.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Why don't you use batteries?

2009-09-03 Thread Hezekiah M. Carty
(I do not want to derail this thread, just make a small clarification below)

On Thu, Sep 3, 2009 at 11:49 AM, Jake Donham wrote:
> On Thu, Sep 3, 2009 at 6:05 AM, Edgar Friendly  wrote:
>>
>> 8) Other (please explain)
>
> Please take this with the caveat that I have little experience with
> Batteries, but my impression (from following batteries-devel) is that it
> changes OCaml significantly with Camlp4 extensions, and that it is not
> possible to use Batteries without the language changes. If I am wrong on
> these points I would be glad to know it.

This is, I think, a common and unfortunate misunderstanding with
Batteries.  In its current state (and likely in all future
iterations), camlp4 extensions/syntax changes are _not_ required to
use Batteries with your OCaml code.  If you simply link with Batteries
(ex. "-package batteries" using ocamlfind) then there will be no
changes to the syntax.

There are simple mechanisms to make use of the syntax extensions
provided by Batteries, but they are not required for Batteries to work

> I think it is important for adoption of any new thing to give people a
> low-cost way to get started, and an incremental path towards using it fully
> and depending upon it. My impression is that with Batteries you must take or
> leave the whole thing.
>
> A full-featured de facto standard library for OCaml is a great idea, but it
> must be a *library*; you must be able to use only the parts you want to use.

The easiest way to use Batteries is to take or leave the whole thing,
but it is not the only way.  Hopefully some more documentation,
particularly in the form of tutorials for folks new to OCaml as well
as Batteries, will help clarify what Batteries _always_ provides and
what it _can_ provide when desired.

Hope this helps,

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Functional unparsing

2009-04-15 Thread Hezekiah M. Carty
On Wed, Apr 15, 2009 at 4:41 PM, Andrey Riabushenko  wrote:
> Something like that:
>
> Stats.linear_regression "y ~ x1 exp(x2) log(x3) x3^2"
> Returns float -> float -> float -> float -> regression_result = 
...
> 2. The second question regarding function unparsing. I haven't used this
> technique before. Are there some docs, blog articles, descriptions and etc?
> The only relevant documentation I have found is printf.ml :). Might someone
> have a minimal working example to demonstrate?

The Batteries Print module and associated syntax extension may be a
useful base for implementing something similar to what you are
proposing:

http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=batteries/batteries.git;a=blob_plain;f=src/core/extlib/print.ml;hb=HEAD
and
http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=batteries/batteries.git;a=tree;f=src/syntax/pa_strings;hb=HEAD

This allows for syntax like:
Print.printf p"This is a list of integers: %{int list}"
to return:
int list -> unit = 

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] invoke

2009-02-21 Thread Hezekiah M. Carty
On Sat, Feb 21, 2009 at 10:23 AM, Jon Harrop  wrote:
>
> Is the "invoke" function that forks a Unix process to compute a future in
> parallel implemented in any of OCaml's third party libraries?

I think the parallel processing functions in Prelude.ml
(http://github.com/kig/preludeml/tree/master) are built around a
forking invoke function based on one you posted a while ago.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] true parallelism / threads

2009-02-20 Thread Hezekiah M. Carty
2009/2/20 Atmam Ta :
> Hi,
>
> I am trying to evaluate ocaml for a project involving large scale numerical
> calculations. We would need parallel processing, i.e. a library that
> distributes jobs accross multiple processors within a machine and accross
> multiple PCs.
> Speed and easy programability are important. I have tried to search this
> issue first, but the postings I found were usually negative and 4-5 years
> old. On the other hand, I see a number of libraries in the Hump that by now
> might be taking care of these things.
>
> My question is: is ocaml good for parallel processing / hreaded computation,
> are there (mature) libraries or tools that let developers make use of
> multicore and multimachine environments?
>
> cheers,
> Atmam

There are several libraries available which seem to be reasonably
usable in their current state.
Distributed processing across multiple machines:
- OCAMLMPI - http://pauillac.inria.fr/~xleroy/software.html
- OCamlP3l - http://camlp3l.inria.fr/eng.htm
- BSML - http://frederic.loulergue.eu/research/bsmllib/bsml-0.4beta.html

Fork-based parallelism for exploiting multiple cores/processors locally:
- Prelude.ml - http://github.com/kig/preludeml/tree/master

There is also JoCaml (http://jocaml.inria.fr/), which is an extension
of OCaml itself.  JoCaml has examples for various distributed
processing methods.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] ocamlbuild rules generating multiple files

2009-02-10 Thread Hezekiah M. Carty
On Tue, Feb 10, 2009 at 5:39 PM, Daniel Bünzli
 wrote:
>
> Le 10 févr. 09 à 23:33, Hezekiah M. Carty a écrit :
>
>> I've used the following rule under After_rules in myocamlbuild.ml for
>
> [...]
>
> Thanks but my problem is that the generated file do not have the same
> basename as the dep i.e. I cannot specify the ~prods arg, the ~prods are
> going to be discovered while the rule is executed and without going through
> further "build" argument invocations.
>
> Maybe a good example is tar archives. Let's say I have a rule that takes a
> .tgz and produces its files. How do I tell ocamlbuild that these files now
> exist.

Ah, my apologies.  I didn't read your original post carefully enough.
Would it be possible to write a function to read these files in to a
list then use "dep [foo; bar] file_list;"?  This is what I use for
included files in .idl files.  I have only done this with static,
pre-defined lists using 'dep ["compile"; "camlidl"] ["file1.inc;
file2.inc"];'.  I'm not sure how well it would work or if it would
work at all with a dynamic list of files.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] ocamlbuild rules generating multiple files

2009-02-10 Thread Hezekiah M. Carty
On Tue, Feb 10, 2009 at 5:15 PM, Daniel Bünzli
 wrote:
> If in a rule a command generates multiple files (which don't necessary have
> the same basename as the dep), how can I make ocamlbuild understand that
> these files now exist in _build ?

I've used the following rule under After_rules in myocamlbuild.ml for
camlidl .idl files:

  (* Handle *.idl files properly... I think *)
  rule "camlidl processing"
~prods:["%.mli"; "%.ml"; "%_stubs.c"]
~deps:["%.idl"]
begin fun env _build ->
  let idl = env "%.idl" in
  let tags = tags_of_pathname idl++"compile"++"camlidl" in
  let cmd = Cmd(S[camlidl; T tags; P idl]) in
  Seq [cmd]
end;

Then, given foo.idl, "ocamlbuild foo.cma" seems to work properly,
finding the relevant camlidl-output files.

Hope this helps.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] More cores

2008-12-19 Thread Hezekiah M. Carty
On Fri, Dec 19, 2008 at 4:27 PM, Richard Jones  wrote:
> On Fri, Dec 19, 2008 at 09:37:32PM +0100, Oliver Bandel wrote:
> [...]
>> P.S.: During the last multicore discussion, I found that link,
>>   but had not tried OCamlp3l. Now I think I will have more
>>   time and motivation and it could be compiled and installed
>>   without any problems with OCaml 3.10.2.
>
> Has anyone tried it with 3.11?
>
> I had an idea to try out some fork-based OCaml programming to exploit
> the 4 & 8 core machines we have here, but maybe can try this instead.

The prelude.ml project has some fork-based parallel functions for
lists, arrays, strings and bigarrays:

http://github.com/kig/preludeml/tree/master/prelude.ml

While I have not tried OCamlp3l on 3.11 yet, my guess is that it would
work.  It is a pure-OCaml set of libraries along with some helper
scripts/programs and as far as I know there is not any camlp4
involved.  After speaking with the authors, the package does seem to
be more focused on distributed computing than local parallelism.  It
is still possible to use it for local parallelism though.  OCamlp3l is
currently going through a rewrite as Camlp3l though the restructuring
is not complete at this point.  CVS repositories for both are here --
http://camlcvs.inria.fr/cgi-bin/cvsweb/bazar-ocaml/

Please let us know how it goes if you do try one or both of these out.

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Teaching ocaml programming

2008-09-26 Thread Hezekiah M. Carty
On Fri, Sep 26, 2008 at 2:59 PM, Andrej Bauer <[EMAIL PROTECTED]> wrote:
> Yaron Minsky wrote:
>> Have you considered DrOCaml?
>
> Yes, but I am unable to find it. Where is it?

http://planet.plt-scheme.org/display.ss?package=drocaml.plt&owner=abromfie

It works well on my system (64bit Ubuntu, OCaml 3.10.2 from GODI) but
only with DrScheme 3xx.  Using DrScheme 4.x I get a series of errors:

http://planet.plt-scheme.org/trac/ticket/86

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Measures

2008-09-21 Thread Hezekiah M. Carty
On Sun, Sep 21, 2008 at 7:30 PM, Jon Harrop
<[EMAIL PROTECTED]> wrote:
>
> This latest post about statically typing constraints beyond mere
> floating-point values reminds me that the F# programming language just got
> another new feature called "measures" that lets you add phantom types
> representing units of measure and even handles arithmetic over them for you.
>
> I have not used measures yet myself but I was just wondering if the OCaml
> world had already seen anything like this?
>
> I had been under the impression that this could not be made to work but,
> obviously, I was wrong!

Jon,

The OSP Delimited Overloading project has an example which does a very
simple version of something similar to F# measures.  The relevant
example files can be viewed here:

https://forge.ocamlcore.org/plugins/scmsvn/viewcvs.php/trunk/examples/length/?root=pa-do

The underlying Length library code is based on a post by Richard
Jones' (http://camltastic.blogspot.com/2008/05/phantom-types.html) and
the syntactic sugar comes from the work done by the Delimited
Overloading folks.  It does not provide the very cool "x meters per
second times y seconds gives z meters" that the F# feature seems to
provide, but it does provide a start - meters + feet will throw a
compile-time error, for example.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] strange behavior with camlp4 and #use

2008-09-16 Thread Hezekiah M. Carty
On Tue, Sep 16, 2008 at 5:31 PM, Peng Zang <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am running 3.10.2 installed from GODI.  Findlib is similarly installed.  I
> run into the following error
>
>  "I/O error: Bad file descriptor"
>
> when I try to '#use somefile' several times (when camlp4 is turned on).

Yes, this is an unfortunate error which came along with the new camlp4
in OCaml 3.10.x.  The error is reported in the OCaml bug tracker here
(please pardon the strange grammar in the bug title - I don't know
what I was thinking when I wrote it):

http://caml.inria.fr/mantis/view.php?id=4495

This bug may be related as well:

http://caml.inria.fr/mantis/view.php?id=4593

It is marked as "assigned", so hopefully it will be fixed by the time
OCaml 3.11 is released.  As it is, the bug makes using both camlp4 and
#use in the REPL prohibitive.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] thousands of CPU cores

2008-07-10 Thread Hezekiah M. Carty
On Thu, Jul 10, 2008 at 8:47 AM, Oliver Bandel
<[EMAIL PROTECTED]> wrote:
> Is  JoCaml somehow related to Camlp3l?

Camlp3l is a set of libraries and helper tools which are written in
OCaml.  It is not tied to a particular OCaml release.

JoCaml provides a separate compiler and runtime.  It is, at least to
some extent, tied to a specific OCaml release to help ensure binary
compatibility with libraries compiled by the matching official OCaml
compiler.

Both Camlp3l and JoCaml have facilities for distributed computing, and
both seem to be maintained currently.  I don't know how Camlp3l,
JoCaml and MPI for OCaml compare in performance scaling.  They each
certainly have an interesting approach though.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Custom lexer in Camlp4

2008-06-24 Thread Hezekiah M. Carty
I forgot to include the relevant external links in my prior email.
They are included below.

On Tue, Jun 24, 2008 at 11:43 AM, Hezekiah M. Carty
<[EMAIL PROTECTED]> wrote:
> I toyed around with a simple extension to the pa_float example on the
> camlp4 wiki.  The modified version is here:
>
> http://0ok.org/code/ocaml/pa_float.ml

The original pa_float is on the camlp4 wiki:

http://brion.inria.fr/gallium/index.php/Pa_float

> I think Zheng Li released an extension similar to pa_context, but I am
> not sure how similar or different it is in function.

Zheng Li's extension is called pa_scope, and can be found here:

http://www.pps.jussieu.fr/~li/software/index.html#pa_scope

I included the camlp4 + toplevel bug information in a separate email.

Hez

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Custom lexer in Camlp4

2008-06-24 Thread Hezekiah M. Carty
On Tue, Jun 24, 2008 at 11:16 AM, Richard Jones <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 24, 2008 at 03:30:23PM +0100, Jeremy Yallop wrote:
> On a related note I had a crazy brainwave that we could use camlp4 to
> use 'ordinary' operators in an overloaded context.  Something like:
>
>  INT64 (2L * n / 3L)
>
> The INT64(expr) macro would inspect the AST of expr and change + ->
> Int64.add etc.  Of course one can do this using the pa_openin macro
> and a module which overrides (+) etc, but maybe this is better?  I was
> going to try modifying parts of virt-df to use this syntax to see if
> it would be beneficial.

I toyed around with a simple extension to the pa_float example on the
camlp4 wiki.  The modified version is here:

http://0ok.org/code/ocaml/pa_float.ml

With this, Float.(1 + 2) becomes (1.0 +. 2.0).  However, if you used
Foo.(a + b), the result would be (Foo.add a b).  In the Int64 case,
Int64.(1L + 2L) becomes (Int64.add 1L 2L).  Same for (-) -> .sub, ( *
) -> .mul, and (/) -> .div.

This is the result of some chatting on IRC and toying around with the
pa_float example, so I don't know how write or wrong this
implementation is.

Another approach I tried after further IRC discussion (thanks to
bluestorm and David Teller!) is a twist on pa_openin:

http://0ok.org/code/ocaml/pa_context.ml

In this case, Foo.(1 + 2) would use the operator Foo.(+) rather than a
pre-defined transform of (+) -> Foo.add.  This might work well if
Num-like ( +/ ) operators were added to modules, since it would allow
something along the lines of:

Int64.(1L +/ some_int64_value +/ of_int 2 -/ of_float some_float_value)

to work properly.  (+/) may not be very pretty, but it doesn't
conflict with (+) or (+.).  David Teller may be doing something like
this with the Batteries project.

I think Zheng Li released an extension similar to pa_context, but I am
not sure how similar or different it is in function.

Sadly camlp4 3.10+ does not play well with the toplevel, so these are
difficult to work with interactively.  I do use pa_context in several
places though, and it seems to work well.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Should a /\ operator be possible?

2008-05-02 Thread Hezekiah M. Carty
On Fri, May 2, 2008 at 5:23 AM, Alain Frisch <[EMAIL PROTECTED]> wrote:
>  Shouldn't this desire of using mathematical symbols be addressed at the
> level of your editor / IDE instead?

Perhaps this idea should be presented to the ocamlwizard OSP group
[1]?  It may be something that they could integrate in to their IDE
tools.

Hez

[1] - http://osp.janestcapital.com/wordpress/?p=22

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Should a /\ operator be possible?

2008-05-01 Thread Hezekiah M. Carty
On Thu, May 1, 2008 at 5:20 PM, Richard Jones <[EMAIL PROTECTED]> wrote:
> On Thu, May 01, 2008 at 08:41:49PM +0100, Richard Jones wrote:
>  >   let ( /\ ) (a1, a2) (b1, b2) = a2 > b1 || b2 > a1
>
>  I've just reread the Lexical conventions section in the manual.  For
>  some reason when I read it first I thought it said that '\' was
>  allowed, but in fact it's not so this appears to be a bug in camlp4.
>
>  BUT can we permit this?  It's nice to be able to define /\ and \/
>  operators with the obvious meanings :-)
>
>  In fact can we open the discussion about converting OCaml source files
>  into UTF-8 and allow _lots_ more symbols?  eg:
>
>   let (∪) = ...
>   let (⊆) = ...

Did this come up at the OCaml meeting [1]?  I think Xavier Leroy said
something about updating OCaml to allow UTF-x source files, though I
have only read the transcripts and don't know the full context or how
official this is.

Hez

[1] - http://wiki.cocan.org/events/europe/ocamlmeetingparis2008

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science
___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs