Objective Caml Plugin for Xcode

Last version : beta 10. Download it

News

January, 4th - port to Xcode 3 (beta 10)

Table of Contents

Objective-Caml is a programming langage created by the INRIA, a french research center in computer science. For more informations, go to the Objective Caml web site. Extract from this site :

Objective Caml is the most popular variant of the Caml language. From a language standpoint, it extends the core Caml language with a fully-fledged object-oriented layer, as well as a powerful module system, all connected by a sound, polymorphic type system featuring type inference. The Objective Caml system is an industrial-strength implementation of this language, featuring a high-performance native-code compiler (ocamlopt) for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc, Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc) and an interactive read-eval-print loop (ocaml) for quick development and portability. The Objective Caml distribution includes a comprehensive standard library, a replay debugger (ocamldebug), lexer (ocamllex) and parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4) and a documentation generator (ocamldoc).

The official Objective-Caml compiler and runtime release only includes command line version of the developer tools. So, you need to use makefiles to deal with more-than-one-file projects. Makefiles are powerful, but a bit complex to use. Even if you may use makefiles in Xcode, it's more practical to have a full integration into Xcode.

This Xcode plugin allow you to :

create a Objective Caml projet or target with Xcode

add files to this target like you do for a C program

modify the OCaml compiler or linker settings through the Xcode's build-in build setting GUI.

adding a library in library build phase of a OCaml target

syntax higlighting

use ocamllex and ocamlyacc

use of the native compiler (select architecture "ppc" instead of the default "ocaml")

dependance between source files

mixing OCaml and C code

However, as it's a beta version, it doesn't support yet :

better dependance between source files (you must put them manually in the good order in the target build phase)

targeting the intel procs (only bytecode & ppc support at this time)

ocamlp4 preprocessor

debugging from Xcode (but possible with direct use of ocamldebug)

Groups & Files Errors & warnings, syntax coloration Compiler build Settings Linker build Settings OCaml targets

Requirement :

Xcode 3.0 (which itself only runs on Mac OS X 10.5.x).

Objective Caml development tools 3.08.3 or later installed in /usr/local/bin (unofficial packaged version here, official installer here).

To install the plugin, you have to put the following files in your Library folder or in the system Library folder :

To install previous version of the plugin working with xcode 2.3/4/5, available here, you have to put the following files in your Library folder or in the system Library folder : OCamlPlugin.pbplugin in :

Library/Application Support/Apple/Developer Tools/Plug-ins/

in : Target templates in :

Library/Application Support/Apple/Developer Tools/Target Templates/OCaml/

Project templates in :

Library/Application Support/Apple/Developer Tools/Project Templates/OCaml/

If your ocaml tools are not installed in /usr/local/bin , you may set up the installation base path with the following command (it's a per-user setting) :

# ocaml installed with fink : defaults write com.apple.Xcode INOCamlBasePath /sw # ocaml installed with darwinports defaults write com.apple.Xcode INOCamlBasePath /opt/local

The Objective-Caml plugin is distributed under the GPL license.

Download the source code.

The description of Xcode's plugin interface.

Sourceforge page for Xcode Plugins

1.0b10 (Jan 2008) - Xcode 3.0 compatibility. Add support for nested comments in syntax highlighting.



1.0b9 (Dec 2006) - fix a bug preventing to run the compiled executable from Xcode.



1.0b8 (Dec 2006) - Support for ocaml tools at non-standard paths

1.0b7 (Sep 2006) - Some support for source file inter-dependances, support for mixing C & OCaml

1.0b6 (Jun 2006) - Xcode 2.3 & 2.4 compatibility

1.0b5 (Feb 2006) - Xcode 2.2 & 2.2.1 compatibility

1.0b1 (Aug 2005) - First version

I'd like to thank :