From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA04481; Thu, 8 Apr 2004 15:37:31 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA04581 for ; Thu, 8 Apr 2004 15:37:30 +0200 (MET DST) Received: from gatekeeper.elmer.external.excelhustler.com (gatekeeper.excelhustler.com [68.99.114.105]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i38DbSYM016549 for ; Thu, 8 Apr 2004 15:37:28 +0200 Received: from chatterbox.elmer.internal.excelhustler.com (unknown [192.168.0.12]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "chatterbox.elmer.internal.excelhustler.com", Issuer "excelhustler.com" (not verified)) by gatekeeper.elmer.external.excelhustler.com (Postfix) with ESMTP id B2470E022C; Thu, 8 Apr 2004 08:37:27 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by chatterbox.elmer.internal.excelhustler.com (Postfix) with ESMTP id 816785C161; Thu, 8 Apr 2004 08:37:27 -0500 (CDT) Received: from wile.internal.excelhustler.com (wile.internal.excelhustler.com [192.168.1.34]) by chatterbox.elmer.internal.excelhustler.com (Postfix) with ESMTP id 4CF9E5C005; Thu, 8 Apr 2004 08:37:27 -0500 (CDT) Received: by wile.internal.excelhustler.com (Postfix, from userid 1000) id E4BCD1B066; Thu, 8 Apr 2004 08:37:27 -0500 (CDT) Date: Thu, 8 Apr 2004 08:37:27 -0500 From: John Goerzen To: Brian Hurt Cc: Issac Trotts , Ocaml Mailing List Subject: Re: [Caml-list] Dynamically evaluating OCaml code Message-ID: <20040408133727.GC29195@excelhustler.com> References: <20020104004356.GA1672@mev> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-Scanned-By: clamscan at chatterbox.elmer.internal.excelhustler.com X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 dynamically:01 2004:99 function-:01 -rw-r--r--:01 usr:01 python:01 pragmatic:01 analogy:01 analogy:01 reinventing:01 python:01 langauge:01 char:01 regexps:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 138 On Thu, Apr 08, 2004 at 01:24:45AM -0500, Brian Hurt wrote: > majority of that in the eval function- so you're talking north of a > megabyte of code. As an application, that's small. As a library, that's > huge. It's of the same size as linking in libgtk (1.3M). No, you want a > small, simple language. Although this might not be so bad- libperl.so on > my machine weighs in at 3.2M. Indeed, and in fact: -rw-r--r-- 1 root root 1073392 Feb 24 02:34 /usr/lib/libpython2.3.so.1.0 Python is often used as an embedded extension language as well. > As a side note, I don't see Ocaml as a science project. It's a pragmatic > language, in that it doesn't automatically assume it knows what's best, > but instead provides the programmer the tools he needs to get the job > done. As reflected in it's design decisions, the people designing Ocaml Careful; that sounds like you're describing Perl :-) [snip] > Wandering into the arena of suspect analogy, if C and C++ are the blue > collar assembly line workers, tightening bolts by hand, than Ocaml is the > robot repairman maintaining the whole factory of robots. He's every bit > as blue collar and about getting real work done, but more educated and a > heck of lot more productive. I agree with most of your analogy here. I'm still relatively new to OCaml, having been using it for only a couple of months, but you've touched on one of my pet peeves: the OCaml standard library is really sub-par for doing real work. Don't get me wrong; I'm still using OCaml, but have to do a lot more wheel reinventing than with, say, Python. Even basic functions that I've found in *every* other langauge I've used are missing (here I'm thinking of things like asctime(), strptime(), and many things relating to sockets and DNS [*especially* the complete lack of IPv6 support). The standard I/O functions miss out on trivial things that I could do way back on DOS with Turbo Pascal, such as opening a file for both read and write. (I'd have to go through the Unix module and some pain to do that in OCaml.) Basic string processing is also more difficult than a language such as, say, Python, where I can say, for instance: y = x[2:-1] In OCaml, I would write -- I think: let y = String.sub x 2 ((String.length x) - 3)) Also, there is no string_of_char function (I'd have to use fill). Things like splitting a string have to rely on str and regexps, an unnecessary complexity for 90% of what I do. Similar complaints exist for working with subsets of lists; it's really too hard to say "replace elements 4 through 9 with this", "delete elements 4 through 9", "return elements 4 through 9", etc. (While we're at it, I think it's silly that there is a list and an array type). Yes, I could write functions to do all of this, but my point is that I shouldn't have to. This library problem hurts productivity, and in some cases makes OCaml less productive than even C. One other thing to mention is that installing libraries is much more difficult than it should be, and writing library build systems (and even app build systems) is much more complex than it should be. Part of this is due to a lack of a standardized build system (think Perl's MakeMaker or Python's setup.py). Part of it is due to the complex array of OCaml options -- for instance, some platforms do not support ocamlopt, so while a library might normally build both native and byte-code versions, it has to not try to if ocamlopt is missing. (Something which, I have found, many OCaml authors fail to consider.) I've been toying with the idea of writing a generic build system for OCaml to address this point though. -- John ------------------- 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