Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] productivity improvement
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pal-Kristian Engstad <engstad@n...>
Subject: Re: [Caml-list] productivity improvement
On Tuesday 15 October 2002 02:24 am, Eray Ozkural wrote:
> For instance in a stock market prediction code I have been working on, it
> took no more than a couple of days to rewrite a large portion of the code
> in Haskell that was previously written in C. The resulting code was
> significantly shorter and more modular; allowing me to play with new
> algorithms / metrics easily. The same would not be the case with C++. (The
> code isn't too Haskell specific and could be done as well in ocaml)

I've found Haskell's use of IO monads to be "interesting", but terribly 
restricting and hard to understand. I do like their operator and function 
overloading mechanisms though - I wish Ocaml would have something similar (it 
just gets tedius having to add a "." in every floating point calculation). 
I've also had problems with converting stateful programs into Haskell.

> That code I think went down from about 2500 lines to 500 lines which isn't
> bad. To attain that kind of improvement, you need a change in style. The C
> program apparently used lots of text I/O to transfer and store data between
> modules. The Haskell program didn't have to.

That's strange. How could the Haskell program not have to do IO?

> It is also true that it is not correct to expect such improvements in code
> that is too simple. If all you want to do is to sum over an array of
> integers, you can do it in C easily.

Now, that is very true.

PKE.
-- 
  _       
  \`.       Pål-Kristian Engstad, Senior Software Engineer,
   \ `|     Naughty Dog, Inc., 1315 3rd Street Promenade, 
  __\ |`.   Santa Monica, CA 90046, USA. (310) 752-1000 x799. 
    /  /o   mailto:engstad@naughtydog.com http://www.naughtydog.com
   /  '~    mailto:mrengstad@yahoo.com    http://www.engstad.com
  / ,'      Go hang-gliding!
  ~'

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners