A little-known fact about Xcode is that is supports syntax colouring and function pop-ups for Dylan files.
Whilst this is nice, it inevitably leads to the desire to be able to build Dylan programs directly from within Xcode.
There are a few problems with this, but it turns out that with a bit of scripting it is possible. To save everyone else going through the same pain that I went through, I’ve made some template projects that you can install into Xcode.
Version
The current version is 1.1.
At the moment the file archive doesn’t include any obvious indication of the version number. I’ll try to fix that at some point. For now, if in doubt, check the output of the Build Results window - you should see a version scroll past at some point!
Downloading
You can download the templates from here.
Installation
Eventually I will make an installer, but for now you have to do the installation manually.
Extract the dylan-xcode-latest.tar.gz archive:
tar xzcf dylan-xcode-latest.tar.gzThis should produce a single folder called “Dylan Tool”. Copy this into /Library/Application Support/Apple/Developer Tools/Project Templates/Command Line Utility/
Start Xcode, and choose New Project, you should now be able to choose “Dylan Tool” from the list of templates.
Usage
Once you’ve installed the template, you can create a new Dylan project by choosing File/New Project…, then selecting Dylan Tool from the Command Line Utilities section of the assistant.
You should see a new project with three source files:
- hello.lid
- hello.dylan
- hello.dylan-exports
If you know any Dylan, you should know what these are for! If not, you probably need to check out some of the tutorials first.
You should be able to build and run this project by choosing Build and Run from the Build menu.
According to Ars, Haskell and Dylan dominate ICFP programming competition
Hurrah for Dylan…
Just read an interesting post from Gilad Bracha about adding more support to the JVM for dynamically typed languages.
I’ve been wondering for ages why the guys in the Dylan community haven’t attempted to target the JVM instead of the current approach which involves generating and then compiling C code.
Possibly invokedynamic may help… although it depends a bit on whether it supports generic method dispatch based on the type of any and all arguments. I don’t know enough about the guts of the Dylan implementation to be sure that this will help, but I hope so…