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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 8154EBBAF for ; Sun, 3 May 2009 14:34:14 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah0CANsr/UmIpwIxmWdsb2JhbACNRoklAQEBAQEICwoHEacQhRWIToIwCYFEBYgo X-IronPort-AV: E=Sophos;i="4.40,286,1238968800"; d="scan'208";a="25534662" Received: from outmail5.bc.edu (HELO purgatory.bc.edu) ([136.167.2.49]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 May 2009 14:34:13 +0200 Received: from bc.edu (outmail2.bc.edu [136.167.2.43]) by invidia.bc.edu (8.14.1/8.14.1) with ESMTP id n43CYB9H030145; Sun, 3 May 2009 08:34:11 -0400 Received: from [209.6.228.75] (account muller@mail.bc.edu HELO [10.0.1.8]) by fe2.bc.edu (CommuniGate Pro SMTP 5.2.10) with ESMTPSA id 297338278; Sun, 03 May 2009 08:34:11 -0400 Cc: caml-list@inria.fr Message-Id: <2B39A17A-8D66-4A7E-A465-22A0D69ECF6C@cs.bc.edu> From: Robert Muller To: Jeffrey Scofield In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: [Caml-list] OCaml on iPhone (was: arm backend) Date: Sun, 3 May 2009 08:34:10 -0400 References: <170624B9-E8DE-4E94-BAA5-2CAF928CE54B@gmail.com> <49F9E7F7.7060705@glondu.net> X-Mailer: Apple Mail (2.930.3) X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.7400:2.4.4,1.2.40,4.0.166 definitions=2009-05-01_02:2009-04-28,2009-05-01,2009-05-03 signatures=0 X-Proofpoint-Spam-Details: rule=quarantine_notspam policy=quarantine score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0811170000 definitions=main-0905030049 ID dyhg5s4ub on invidia-10000_instance1 (192.168.1.21) X-Spam: no; 0.00; ocaml:01 ocaml:01 wrappers:01 ocamlopt:01 gcc:01 gdb:01 globl:01 model:01 ocamlopt:01 unboxed:01 u-tokyo:01 beginner's:01 bug:01 thrilled:98 cocoa:98 This sounds great. I will be teaching an iphone programming course next year and I would very much like to use the course as an opportunity to introduce students to caml. I know that there are others gearing up for iphone programming courses who aren't thrilled with the idea of teaching Objective C. If you were to post your resources on a web site it might lower the barrier to entry for more people to use ocaml + your wrappers rather than Objective C. Bob Muller On May 2, 2009, at 7:15 PM, Jeffrey Scofield wrote: > Nathaniel Gray writes: > >> Ok, I'm glad I left this to people who are familiar with ARM >> assembly programming. :-) > > We've done a lot of assembly programming, but none of us is an > ARM expert. We looked at ARM documents and the assembly (.s) > files generated by ocamlopt and gcc, and spent some long sessions > with gdb. > >> Awesome, but now I'm confused because the arm.S you included >> has lots of .global pseudo-ops. Do you not compile it with >> Apple's as? > > At around line 36, you'll see: > > #define global globl > > As I said in private mail, you could call this a hack, but it's a > way to avoid making lots of small changes everywhere in the file. > >> What's your app? > > We're working on a collection of card games for casual play. > >> How are you managing the interface between Cocoa and OCaml? > > This is a big topic. The summary is that we model Cocoa objects > as OCaml objects. We have a layer that wraps OCaml objects in > smallish ObjC objects for use on the ObjC side, and wraps ObjC > objects in smallish OCaml objects for use on the OCaml side. The > layer then translates between these representations as required > for calls into iPhoneOS and Cocoa Touch from OCaml (asking for > iPhone OS services) and into OCaml from iPhoneOS (for event > handling). > >>> We also made a small fix to the ARM code generator >> >> I am very interested in any and all information needed to get a >> correct OCaml port suitable for use in App Store applications. >> Please share! > > OK, I'll gather up our patch and send it to the list. I want to > separate out our changes from those of Toshiyuki Maeda [1]. > > As I said, our patch fixes calls to external C float functions > such as floor(), sin(), and so on. There is special handling in > ocamlopt to allow them to be unboxed, but the ABI of the existing > ARM code generator doesn't match the iPhone ABI. > > Regards, > > Jeff Scofield > Seattle > > [1] http://web.yl.is.s.u-tokyo.ac.jp/~tosh/ocaml-on-iphone/ > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs