Re: [Caml-list] Average cost of the OCaml GC

2010-11-16 Thread Goswin von Brederlow
Jianzhou Zhao jianz...@seas.upenn.edu writes: On Thu, Nov 11, 2010 at 3:11 PM, Goswin von Brederlow goswin-...@web.de wrote: Jianzhou Zhao jianz...@seas.upenn.edu writes: On Thu, Nov 11, 2010 at 4:08 AM, Goswin von Brederlow goswin-...@web.de wrote: Jianzhou Zhao jianz...@seas.upenn.edu

[Caml-list] Option functions (or lack thereof) + operator for composition

2010-11-16 Thread Serge Le Huitouze
Hi, While writing a sample program (with lablgtk2), I found a few things annoying and thought I would ask here what you guys think. 1. Option type It seems that there is no predefined function to test an 'a option for being specifically None or Some _. This seems to be

Re: [Caml-list] Option functions (or lack thereof) + operator for composition

2010-11-16 Thread Thomas Gazagnaire
Hi, I found it weird to be forced to use match expressions in my code for doing that, e.g.: * let curSelectedRow = ref None in * let updateButtonsStatus () = * button_remove#misc#set_sensitive * (match !curSelectedRow with None - false | _ - true) * in * ... You

Re: [Caml-list] Option functions (or lack thereof) + operator for composition

2010-11-16 Thread Gabriel Kerneis
On Tue, Nov 16, 2010 at 12:43:30PM +0100, Thomas Gazagnaire wrote: You are not forced to use match expression, you can just define : let is_none x = match x with None - true | Some _ - false and is_some x = not (is_none x) and then use these functions in your code ... Or even simpler: let

[Caml-list] Re: SMP multithreading

2010-11-16 Thread Sylvain Le Gall
Hi, On 15-11-2010, Wolfgang Draxinger wdraxinger.maill...@draxit.de wrote: Hi, I've just read http://caml.inria.fr/pub/ml-archives/caml-list/2002/11/64c14acb90cb14bedb2cacb73338fb15.en.html in particular this paragraph: | What about hyperthreading? Well, I believe it's the last convulsive |

Re: [Caml-list] Option functions (or lack thereof) + operator for composition

2010-11-16 Thread Jacques Garrigue
On 2010/11/16, at 20:27, Serge Le Huitouze wrote: 1. Option type It seems that there is no predefined function to test an 'a option for being specifically None or Some _. In ocaml you can compare at any type. So you can just write (!curSelectedRow None) which explains why

Re: [Caml-list] Option functions (or lack thereof) + operator for composition

2010-11-16 Thread Serge Le Huitouze
To get rid of many warnings, I wrapped some calls (the connect calls of my widgets) into ignore (f x y) statements. You can, but unfortunately $ does not have the right associativity. # let ($) f x = f x;; val ( $ ) : ('a - 'b) - 'a - 'b = fun # ignore $ 1+1;; - : unit = () # succ $ succ

Re: [Caml-list] Option functions (or lack thereof) + operator for composition

2010-11-16 Thread dmitry grebeniuk
Hello. So I have to learn the precedence and associaticity table in section 6.7 of OCaml's reference manual!!! I usually redefine () operator: let ( ) f x = f x It's ok until you don't use JoCaml which defines keyword . Also take a look at other infix operators I use, maybe you found

Re: [Caml-list] Option functions (or lack thereof) + operator for composition

2010-11-16 Thread bluestorm
On Tue, Nov 16, 2010 at 3:26 PM, Michael Ekstrand mich...@elehack.netwrote: Batteries provides operators for things like this. It defines the '**' operator for function application; it's an odd name, but it has the right associativity. As Dmitry mentioned, some override (). Batteries also

Re: [Caml-list] Option functions (or lack thereof) + operator for composition

2010-11-16 Thread bluestorm
On Tue, Nov 16, 2010 at 12:27 PM, Serge Le Huitouze serge.lehuito...@gmail.com wrote: It seems that there is no predefined function to test an 'a option for being specifically None or Some _. This seems to be confirmed by the very existence of:

Re: [Caml-list] SMP multithreading

2010-11-16 Thread Gerd Stolpmann
Am Montag, den 15.11.2010, 22:46 -0800 schrieb Edgar Friendly: On 11/15/2010 09:27 AM, Wolfgang Draxinger wrote: Hi, I've just read http://caml.inria.fr/pub/ml-archives/caml-list/2002/11/64c14acb90cb14bedb2cacb73338fb15.en.html in particular this paragraph: | What about

Re: [Caml-list] OCamlJit 2.0

2010-11-16 Thread bluestorm
To those of you who are lazy but still curious, I just read the report, and here are the answers to the question I had: 1. Is that project related to Basile Starynkevitch's venerable OCamlJIT ? Yes, OcamlJIT was apparently a major inspiration for this work. The overall design is similar, and in

Re: [Caml-list] OCamlJit 2.0

2010-11-16 Thread Benedikt Meurer
On Nov 16, 2010, at 18:07 , bluestorm wrote: To those of you who are lazy but still curious, I just read the report, and here are the answers to the question I had: Thanks for posting these points, should have done this in my original post... 1. Is that project related to Basile

Re: [Caml-list] Option functions (or lack thereof) + operator for composition

2010-11-16 Thread Martin Jambon
On 11/16/10 03:51, Gabriel Kerneis wrote: On Tue, Nov 16, 2010 at 12:43:30PM +0100, Thomas Gazagnaire wrote: You are not forced to use match expression, you can just define : let is_none x = match x with None - true | Some _ - false and is_some x = not (is_none x) and then use these functions

Re: [Caml-list] SMP multithreading

2010-11-16 Thread Norman Hardy
On 2010 Nov 15, at 22:46 , Edgar Friendly wrote: It looks like high-performance computing of the near future will be built out of many machines (message passing), each with many cores (SMP). One could use message passing for all communication in such a system, but a hybrid approach might

Re: [Caml-list] SMP multithreading

2010-11-16 Thread Eray Ozkural
On Tue, Nov 16, 2010 at 7:04 PM, Gerd Stolpmann i...@gerd-stolpmann.dewrote: Am Montag, den 15.11.2010, 22:46 -0800 schrieb Edgar Friendly: * As somebody mentioned implicit parallelization: Don't expect anything from this. Even if a good compiler finds ways to parallelize

Re: [Caml-list] SMP multithreading

2010-11-16 Thread Gerd Stolpmann
Am Dienstag, den 16.11.2010, 22:35 +0200 schrieb Eray Ozkural: On Tue, Nov 16, 2010 at 7:04 PM, Gerd Stolpmann i...@gerd-stolpmann.de wrote: Am Montag, den 15.11.2010, 22:46 -0800 schrieb Edgar Friendly: * As somebody mentioned implicit parallelization: Don't

Re: [Caml-list] SMP multithreading

2010-11-16 Thread Eray Ozkural
On Wed, Nov 17, 2010 at 12:13 AM, Gerd Stolpmann i...@gerd-stolpmann.dewrote: Am Dienstag, den 16.11.2010, 22:35 +0200 schrieb Eray Ozkural: On Tue, Nov 16, 2010 at 7:04 PM, Gerd Stolpmann i...@gerd-stolpmann.de wrote: Am Montag, den 15.11.2010, 22:46 -0800 schrieb Edgar

Re: [Caml-list] SMP multithreading

2010-11-16 Thread Wolfgang Draxinger
On Wed, 17 Nov 2010 01:04:54 +0200 Eray Ozkural examach...@gmail.com wrote: [readworthy text] I'd like to point out how the big competitor to OCaml deals with it. The GHC Haskell system has SMP parallization built in for some time, and it does it quite well. Wolfgang

Re: [Caml-list] SMP multithreading

2010-11-16 Thread Eray Ozkural
On Wed, Nov 17, 2010 at 1:52 AM, Wolfgang Draxinger wdraxinger.maill...@draxit.de wrote: On Wed, 17 Nov 2010 01:04:54 +0200 Eray Ozkural examach...@gmail.com wrote: [readworthy text] I'd like to point out how the big competitor to OCaml deals with it. The GHC Haskell system has SMP

RE: [Caml-list] SMP multithreading

2010-11-16 Thread Jon Harrop
Wolfgang wrote: I'd like to point out how the big competitor to OCaml deals with it. The GHC Haskell system has SMP parallization built in for some time, and it does it quite well. I beg to differ. Upon trying to reproduce many of the Haskell community's results, I found that even their own

RE: [Caml-list] SMP multithreading

2010-11-16 Thread Jon Harrop
Granularity and cache complexity are the reasons why not. If you find anything and everything that can be done in parallel and parallelize it then you generally obtain only slowdowns. An essential trick is to exploit locality via mutation but, of course, purely functional programming sucks at that

[Caml-list] Lightweight way to extend existing module. Almost there?

2010-11-16 Thread Till Varoquaux
With the improvements to the module system in ocaml 3.12 extending a signature just got much much lighter. Suppose I want the signature of the module which in every respects is like StdLabels excepted that the String module has an extra is_prefix_of I can write: module String : sig include

Re: [Caml-list] SMP multithreading

2010-11-16 Thread Eray Ozkural
Oh well, I'm not so surprised that the fine-grain task-parallelism with (?) dynamic load-balancing strategy doesn't get much speedup. Doing HPC with Haskell is a bit like using Java for writing parallel programs, you might as well use a C-64 and Commodore BASIC. And yes, some people do use Java

Re: [Caml-list] SMP multithreading

2010-11-16 Thread Gabriel Kerneis
On Wed, Nov 17, 2010 at 06:27:14AM +0200, Eray Ozkural wrote: As I said even in C good results can be achieved, I've seen that, so I know it's doable with ocaml, just a difficult kind of compiler. The functional features would expose more concurrency. Could you share a pointer to a paper