From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 97162BB81 for ; Sat, 19 Nov 2005 16:55:23 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jAJFtNtF032163 for ; Sat, 19 Nov 2005 16:55:23 +0100 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 QAA10595 for ; Sat, 19 Nov 2005 16:55:22 +0100 (MET) Received: from mail.cs.unm.edu (mail.cs.unm.edu [64.106.20.33]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jAJFtLJs032152 for ; Sat, 19 Nov 2005 16:55:21 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.cs.unm.edu (Postfix) with ESMTP id A0A62E412B; Sat, 19 Nov 2005 08:55:34 -0700 (MST) Received: from mail.cs.unm.edu ([127.0.0.1]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15642-08; Sat, 19 Nov 2005 08:55:34 -0700 (MST) Received: from [192.168.0.3] (pcp09983606pcs.svaley01.nm.comcast.net [68.35.58.177]) by mail.cs.unm.edu (Postfix) with ESMTP id 1F40CE410B; Sat, 19 Nov 2005 08:55:33 -0700 (MST) In-Reply-To: <20051119150931.GB324@first.in-berlin.de> References: <20051119150931.GB324@first.in-berlin.de> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <42E4A821-E220-4463-ABAA-C33F6EDEE833@cs.unm.edu> Cc: caml-list@inria.fr Content-Transfer-Encoding: 7bit From: William Neumann Subject: Re: Yet another OCaml Webserver?! (was: Re: [Caml-list] Yet another sudoku solver (838 bytes)) Date: Sat, 19 Nov 2005 08:55:57 -0700 To: Oliver Bandel X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at cs.unm.edu X-Miltered: at concorde with ID 437F4AEB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 437F4AE9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 caml-list:01 solver:01 oliver:01 bandel:01 ocaml:01 buffer:01 libs:01 libs:01 re-implement:01 ocaml's:01 parsers:01 hash:01 838:98 motto:98 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=PLING_QUERY autolearn=disabled version=3.0.3 On Nov 19, 2005, at 8:09 AM, Oliver Bandel wrote: > But where's the OCaml programmers community (is there something > like that?), > showing that it also goes in other ways? > > When asking here for databases and other stuff, often comes the > answer: try to use library and write a C-binding. > > Nice idea, but too often most of the libraries are buggy and > many of them struggle with Buffer Overflow (and similar) problems. > > For example pcre-lib, curl-lib, a lot of the graphic-format libs, ... > ...even cryptographic libs... where you send your credit card > informations through the network... well.... Well, there are a number of reasons for this. The biggest, I would guess is time. Seriously, why would I want to re-implement, say, libcurl when one already exists and works well? I don't have enough hours in the day to do that kind of evangelism *and* my day job. Number two on the list is that OCaml just isn't well suited to some of those domains. I do crypto for a living (though more at the research level than the implementation level), and I know why things like cryptokit rely on C routines... Crypto and pure OCaml don't work well together because you don't get direct access to 32 and/or 64 bit words for manipulation. It's less of a hassle when you just need simple operations like XORs which you can do on strings without too much overhead, but when you need something like addition mod 2^32, well... Int32 is a bit of a pain in the ass. OCaml's great for the higher level stuff. I just wrote a few Merkle- Damgard type constructions using stream parsers, and it's all very compact, pretty and elegant. But if I want a final hash with a decent throughput, chances are I'll have to implement my compression function in C. And you know what... that's OK. Best tool for the job is usually a good motto. William D. Neumann "I eat T-bone steaks, I lift barbell plates, I'm sweeter than a German chocolate cake. I'm the reflection of perfection, the number one selection. I'm the man of the hour, the man with the power, too sweet to be sour. The ladies' pet, the men's regret, where what you see is what you get, and what you don't see, is better yet." --Superstar Billy Graham