From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 2A14FBC6B for ; Sat, 12 Jan 2008 17:20:44 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAALp3iEdA6aa3mGdsb2JhbACQCQEBAQEHBAQrkC2GSQ X-IronPort-AV: E=Sophos;i="4.24,275,1196636400"; d="scan'208";a="21161468" Received: from py-out-1112.google.com ([64.233.166.183]) by mail4-smtp-sop.national.inria.fr with ESMTP; 12 Jan 2008 17:20:43 +0100 Received: by py-out-1112.google.com with SMTP id v53so1727518pyh.33 for ; Sat, 12 Jan 2008 08:20:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=xN3jIhEBQDIYidsx0IifjqXtTO0rBH50K6ZKS5Y1LLk=; b=CyZGTD6FQOxnMAMwMQ+MZXzkEJO9X+ZVZe7VDD6D53BFivgbuzTbVUJWecsu9H5FvFuiLIckt51V4tjU8VonoyFBmhPwnDM3lEKM2Jp2Lav6Mt4rTXRpqQkY81AiYRZWUSptPzIdomR+Ul6lzwSRP4hVxF4O5Udnos2b+FQcJA0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=OklIks3mxDfJeiPPgHIA2p21nyMzOZ6v+KY8fW+LAbdbqVSXbEvl6TnmscPsDEWhiJfk0LEwa2dTzaW+C9btccjC/6rfA5aNVHJraOJcwjBYUtS7ApSbV+fXWXh7/LFnY/kuyRcWDChFy10+NT0NJ5VkZZ2zXtsYihzq0XcI9ys= Received: by 10.142.86.7 with SMTP id j7mr2111735wfb.78.1200154840579; Sat, 12 Jan 2008 08:20:40 -0800 (PST) Received: by 10.142.214.2 with HTTP; Sat, 12 Jan 2008 08:20:40 -0800 (PST) Message-ID: Date: Sat, 12 Jan 2008 11:20:40 -0500 From: "Will Farr" Sender: wmfarr@gmail.com To: "Kuba Ober" Subject: Re: [Caml-list] ocaml doesn't need to optimize on amd64?? Cc: caml-list@yquem.inria.fr In-Reply-To: <200801110814.35168.ober.14@osu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200801090922.00231.ober.14@osu.edu> <200801091714.52294.jon@ffconsultancy.com> <200801102256.42193.jon@ffconsultancy.com> <200801110814.35168.ober.14@osu.edu> X-Google-Sender-Auth: ba50fcc95d2113b1 X-Spam: no; 0.00; ocaml:01 allocations:01 run-time:01 variants:01 c-like:01 compiler:01 ocaml:01 compiler:01 higher-order:01 48,:98 abstract:01 stack:01 compile:01 heap:01 emit:01 Kuba, > Yeah, but my area of interest is really embedded realtime stuff, running > typically on architectures which are quite resource constrained. On some of > those your typical GC wouldn't even fit in the code memory. And I'm not even > (most of the time) using dynamic memory allocations. None of my code really > calls for any sort of boxing -- there's no need for it. All I need is C that > is more expressive and easier to optimize. No run-time variants, really, all > types are known and fixed, and data is at fixed locations in memory, or on > the stack, or occasionally on the heap which is manually managed (C-like). > > Of course that pertains to the code that gets generated, because I should be > able to use abstract concepts while writing the code. If I pass a function to > a function, it doesn't necessarily mean that the compiler must emit the code > for the former, and that the latter should actually call (as call machine > instruction) the former. This may be something you have seen before and dismissed, and it's not really OCaml at all, but have you looked at PreScheme? It's a scheme dialect (and, in fact, runs *un-modified* in a scheme interpreter), plus a compiler that turns it into optimized C of the type you're talking about. (For example, one optimization is that all higher-order procedures are beta-substituted away at compile time.) It might not really fit your needs, but perhaps there's some ideas you could steal there, in any case. (The scheme48 guys used it to write the VM for scheme48, which sounds to my un-expert ears like it would have a lot in common with the tasks you're looking at doing.) Will