Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] GC and file descriptors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brian Hurt <bhurt@s...>
Subject: Re: [Caml-list] GC and file descriptors

Wandering into language advocacy here.

On Tue, 18 Nov 2003, Ville-Pertti Keinonen wrote:

> On Mon, Nov 17, 2003 at 03:20:36PM -0600, Brian Hurt wrote:
> 
> > into C++).  And Java is the only language whose memory management is more 
> > advanced than 1968-era LISP.
> 
> Did you forget to include the word "mainstream"?

Yes I did.  For example, Ocaml has good memory management.

Note that Java's memory management is still only "excusable", not good.  
The common case of an allocation in Ocaml is 5 simple instructions.  In
Ocaml, it's simply not usefull to optimize allocation (for example,
keeping a pool of pre-allocated objects around), as native allocation is
simply too fast.  You don't gain, and it's way easy to lose.  Last time I
checked, Java still had a problem with allocation being slow, causing Java
programmers to work around it.

> 
> > I want a copy.  But I don't know how close to mainstream it is.  Perl, 
> > Python, and Ruby are scripting languages, still mainly used for short, 
> > single-person, throw-away projects.  And they aren't that far from 
> 
> Python and Ruby are hardly scripting languages, even though they are
> often used as such.  I think they could be decent general purpose
> programming languages except for a few unfortunate design decisions
> (such as scoping rules).

Have there been any large projects (multiple developers, tens to hundreds 
of thousands of lines of code) in Python or Ruby?

One problem I have is that programming is going away from strict compile 
time type checking to run-time type checking.  The problem with run-time 
type checking is that it only catches errors in the field.  Static type 
checking is the most powerfull tool we've come up with to ensure 
correctness in programs.  And no, unit tests are not a replacement for 
strict compile-time type checking.

The problem is that the only type checking people are aware of is 
Pascal/Algol-68 type systems.  Which require you to be able to circumvent.  
And so you end up spending most of your time circumventing the type 
system, which causes smart people to wonder why it's there in the first 
place.  The industry being stuck in the summer of love *is* having 
negative effects.

> 
> > C in it.  Java succeeded because IBM, Sun, Oracle, and a number of other 
> > huge companies got behind it.
> 
> Not just that, the OO hype is a huge factor.  Faced with advocates who
> claim that subclassing is all you need and other language features
> are undesirable, it takes a while for inexperienced programmers - even
> smart ones - to become disillusioned and take the time to learn
> something different...

The OO hype was what drove the adoption of C++.  See, in C++, you can 
write straight old-style procedural/imperitive C, and then tell your boss 
"Of course it's object oriented- it's in C++, isn't it?"  I've seen my 
share of procedural C++ in my time.

> 
> It's difficult for programming languages to be judged on merit.  People
> who are reasonably unbiased and know enough to be able to make informed
> comparisons aren't likely to consider any language or paradigm the
> "one true way".  But not many people listen to advocates who don't claim
> that their solution is perfect.
> 
> I'm fairly sure nobody on this list would claim that OCaml is above all
> other languages for every possible purpose.

I will go one farther, and name one use for which C is a better solution 
than Ocaml: writting an OS, device driver, or embedded code which does a 
lot of banging directly on hardware.  

> 
> However, does anyone consider OCaml the best existing language for a
> particular use?  Or just the most convenient implementation of the
> features needed?

For any large, complex, data structure & algorithm heavy application, 
Ocaml is the best language I know of.  It's not the best possible 
language (I can think of a number of improvements to Ocaml I'd like to 
see), but it's better for that purpose than any other language I know.

-- 
"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it."
                                - Gene Spafford 
Brian


-------------------
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