German Vidal | 2 Jan 10:04 2008
Picon

SAS 2008 Third Call for Papers

PLEASE POST --> SAS 2008 at the Technical University of Valencia

We are happy to announce that SAS 2008, the Static Analysis Symposium,
will take place at the Technical University of Valencia:

    Submission of abstract:      January 12, 2008
    Submission of full paper:    January 19, 2008
    Notification:                March 7, 2008
    Camera-ready version:        April 5, 2008
    Conference:                  July 16-18, 2008

Please see: http://www.dsic.upv.es/~sas2008/

   ** The submission site is now open **

Maria Alpuente, German Vidal (PC co-chairs)

---------------------------------------------------------------------------
                               Call for papers

                    Static Analysis Symposium - SAS 2008
                     16-18 July 2008, Valencia, Spain
                      (co-located with LOPSTR 2008)

                      url   http://www.dsic.upv.es/~sas2008
                    email   sas2008 <at> dsic.upv.es

Static Analysis is increasingly recognized as a fundamental tool for high
performance implementations and verification of programming languages and
systems. The series of Static Analysis Symposia has served as the primary
(Continue reading)

Daniel de Rauglaudre | 2 Jan 14:38 2008
Picon
Picon

Camlp5 release 5.07

Hello everybody and happy new year !

New release of Camlp5 : 5.07

Changes:
 - Added function [Grammar.Entry.parse_all] returning the list of all
   solutions when using the parsing algorithm [Backtracking].
 - Added "pprintf" statement to use the Camlp5 pretty print system more
   easily and shortly. A chapter of the documentation describes it.

Sources and documentation available at:
   http://pauillac.inria.fr/~ddr/camlp5/

--

-- 
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/

_______________________________________________
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

Damien Doligez | 2 Jan 15:13 2008
Picon
Picon

OCaml 3.10.1 release candidate 2

Dear OCaml users,

I have the pleasure of announcing the second release candidate
of OCaml 3.10.1.

There are only two changes from RC1:

1. The type-checking of recursive modules was too restrictive
    in RC1 (and not restrictive enough in 3.10.0).  (PR#4470)
2. There was a problem with the native port on HPPA. (PR#4339)

As usual, this is a source-only version released for testing
by power users and package managers.

If you are using recursive modules, or if you are running OCaml
on HPPA machines, please download and test this version.  If
you haven't tested RC1 yet, please test RC2 instead.

As usual, you should drop me <damien.doligez <at> inria.fr> a mail
after testing, and tell me about any problem you had.  Don't forget
to tell me also if all goes well.

This release is available, as usual, at
< ftp://ftp.inria.fr/INRIA/cristal/ocaml/ocaml-3.10/ocaml-3.10.1+rc2.tar.bz2 
  >
< ftp://ftp.inria.fr/INRIA/cristal/ocaml/ocaml-3.10/ocaml-3.10.1+rc2.tar.gz 
  >

Happy new year and good health to everyone.

(Continue reading)

Kuba Ober | 2 Jan 17:52 2008
Picon

[NEWBIE] is there an in-place map?

I need functionality of map, but done in such a way that the output array
is given as the argument, not as a return value. The closest I could get was

let inplace_map f a b = Array.blit (map f a) 0 b 0 (Array.length a)

Arrays a and b are of the same size.
This seems very inelegant.

One could use an adapter function and iteri, but that adds very noticeable 
overhead, and doesn't seem too elegant either.

let inplace_map f a b = Array.iteri (fun i src -> b.(i) <- f src; ()) a

There must be a better way of doing it, right? The given here is that the 
arrays a and b are there to stay, so we have to use them in-place.

Cheers, Kuba

_______________________________________________
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

Jean-Christophe Filliâtre | 2 Jan 18:00 2008
Picon

Re: [NEWBIE] is there an in-place map?

Kuba Ober a écrit :
> I need functionality of map, but done in such a way that the output array
> is given as the argument, not as a return value. The closest I could get was
> 
> let inplace_map f a b = Array.blit (map f a) 0 b 0 (Array.length a)
> 
> Arrays a and b are of the same size.
> This seems very inelegant.

I guess you mean Array.map. Indeed, this is not optimal because
Array.map allocates a new array, whose contents is immediately copied
into b.

> One could use an adapter function and iteri, but that adds very noticeable 
> overhead, and doesn't seem too elegant either.
> 
> let inplace_map f a b = Array.iteri (fun i src -> b.(i) <- f src; ()) a

You may find this inelegant too, but it is clearly more efficient than
your previous version using map. Note that "; ()" can be omitted, since
the assignment <- already has type unit.

Equivalently, you could use a for loop instead of Array.iteri.

--

-- 
Jean-Christophe Filliâtre
http://www.lri.fr/~filliatr/

_______________________________________________
Caml-list mailing list. Subscription management:
(Continue reading)

Brian Hurt | 2 Jan 18:06 2008

Re: [NEWBIE] is there an in-place map?

Jean-Christophe Filliâtre wrote:
Kuba Ober a écrit :
I need functionality of map, but done in such a way that the output array is given as the argument, not as a return value. The closest I could get was let inplace_map f a b = Array.blit (map f a) 0 b 0 (Array.length a) Arrays a and b are of the same size. This seems very inelegant.
I guess you mean Array.map. Indeed, this is not optimal because Array.map allocates a new array, whose contents is immediately copied into b.
There's a reason for that...
One could use an adapter function and iteri, but that adds very noticeable overhead, and doesn't seem too elegant either. let inplace_map f a b = Array.iteri (fun i src -> b.(i) <- f src; ()) a
You may find this inelegant too, but it is clearly more efficient than your previous version using map. Note that "; ()" can be omitted, since the assignment <- already has type unit. Equivalently, you could use a for loop instead of Array.iteri.

Both of these maps have the type ('a -> 'a) -> 'a array -> 'a array, as opposed to the normal map, which has the type ('a -> 'b) -> 'a array -> 'b array.  Once you allocate an array, you can't change the type it holds.  So I'd probably give the function some other name, maybe "modify" or similiar.

Brian


_______________________________________________
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
Edgar Friendly | 2 Jan 18:26 2008
Picon

Re: [NEWBIE] is there an in-place map?

Kuba Ober wrote:
> I need functionality of map, but done in such a way that the output array
> is given as the argument, not as a return value. The closest I could get was
> 
> let inplace_map f a b = Array.blit (map f a) 0 b 0 (Array.length a)
> 
> Arrays a and b are of the same size.
> This seems very inelegant.
> 
> One could use an adapter function and iteri, but that adds very noticeable 
> overhead, and doesn't seem too elegant either.
> 
> let inplace_map f a b = Array.iteri (fun i src -> b.(i) <- f src; ()) a
> 
> There must be a better way of doing it, right? The given here is that the 
> arrays a and b are there to stay, so we have to use them in-place.
> 
> Cheers, Kuba
> 

let blit_map f a b =
	for i = 0 to (min (Array.length b) (Array.length a)) - 1 do
		b.(i) <- f a.(i);
	done

I don't see any better way to do this.  I can't see any overhead to
using a for loop like this.  I guess the recursive solution should also
work fast:

let blit_map f a b =
	let rec loop i =
		if i < 0 then ()
		else b.(i) <- f a.(i); loop (i-1)
	in
	let max_i = min (Array.length a) (Array.length b) in
	loop (max_i - 1)

But as I've been finding out in trying to performance tune for the
Shootout, 'for' loops seem faster than even tail-recursion.  I'd say
something about function call overhead, but tail recursion shouldn't
have such.  Maybe the work of updating the loop counter in the recursive
case makes the difference...

E.

_______________________________________________
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

Brian Hurt | 2 Jan 18:36 2008

Re: [NEWBIE] is there an in-place map?

Edgar Friendly wrote:
Kuba Ober wrote:
I need functionality of map, but done in such a way that the output array is given as the argument, not as a return value. The closest I could get was let inplace_map f a b = Array.blit (map f a) 0 b 0 (Array.length a) Arrays a and b are of the same size. This seems very inelegant. One could use an adapter function and iteri, but that adds very noticeable overhead, and doesn't seem too elegant either. let inplace_map f a b = Array.iteri (fun i src -> b.(i) <- f src; ()) a There must be a better way of doing it, right? The given here is that the arrays a and b are there to stay, so we have to use them in-place. Cheers, Kuba
let blit_map f a b = for i = 0 to (min (Array.length b) (Array.length a)) - 1 do b.(i) <- f a.(i); done
I was thinking more like:

let modify f a =
    for i = 0 to (Array.length a) - 1 do
       a.(i) <- f a.(i)
    done;
    a
;;

The OP did say "in place modification.
But as I've been finding out in trying to performance tune for the Shootout, 'for' loops seem faster than even tail-recursion. I'd say something about function call overhead, but tail recursion shouldn't have such. Maybe the work of updating the loop counter in the recursive case makes the difference...
It depends.  If you have to use multiple references to make the for-loop work, then I've seen tail recursion be faster (and clearer).  Also, if you recalculate the ending requirement every recursive call, recursion can be slower (in the above for loop above, for example, Array.length is gaurenteed to be called only once).

Brian

_______________________________________________
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
"Márk S. Zoltán" | 2 Jan 19:46 2008
Picon

Re: OCaml 3.10.1 release candidate 2

Compiled it on MSys + MinGW; gcc produces some redefinition warnings 
when make'ing the win32caml directory (3.10.0 did not give them) but 
builds and installs successfully with my usual configuration. Compiled a 
few projects heavy on recursive modules, and did not find anything that 
appeared broken (at least, nothing compared to 3.10.0).

Cheers

  Z-

_______________________________________________
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

Edgar Friendly | 2 Jan 20:20 2008
Picon

Re: [NEWBIE] is there an in-place map?

Brian Hurt wrote:
> The OP did say "in place modification.
> 
Kuba also said "the output array is given as the argument, not as a
return value."

> It depends.  If you have to use multiple references to make the for-loop
> work, then I've seen tail recursion be faster (and clearer).  

Any example of a faster tail recursion?

> Also, if
> you recalculate the ending requirement every recursive call, recursion
> can be slower (in the above for loop above, for example, Array.length is
> gaurenteed to be called only once).

I have no problems precalculating the Array.length value, or recursing
down to 0.
> 
> Brian
> 

A little testing results in some data: for arrays of 1024 ints and
simple arithmetic operations, I get a 9% speed increase in using a for
loop over recursion.

E.

_______________________________________________
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


Gmane