Re: CLOS and databases
From: Pete Kirkham (pete-kirkham-2004_at_cafemosaic.co.uk)
Date: 03/26/04
- Next message: szymon: "[Re] google-it: more_control_and_pkg_man.txt"
- Previous message: Cameron MacKinnon: "Re: Lua (was Re: What would you do with 10 Man Years?)"
- In reply to: Antonio Menezes Leitao: "Re: CLOS and databases"
- Next in thread: Antonio Menezes Leitao: "Re: CLOS and databases"
- Reply: Antonio Menezes Leitao: "Re: CLOS and databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 26 Mar 2004 18:07:50 +0000
I've also been playing on some similar themes, and come to the
conclusion that to target Java/.net/Objective-C or C++ has too much of
an impedance match to use ANSI CL as source language.
Every library in the target languages (or for that matter python or
haskell) has a list model as a thing than has functions to access it's
members sequentially. Null and () are different. Even though you can add
wrappers and unwrappers to map cons'd lists onto functional lists,
automating them is a drag and the end code looks messy and runs slower
than pure Java; this gets very complicated if you are modifying a list
you have a reference to the head of elsewhere. It is also nice to use
the same iteration forms on functional lists, for example representing
the output of a streaming parser as a list of symbols- you don't want to
hold a 8GB AST in memory if you're only forward iterating over it's
contents, but you don't want to have to rewrite your code for the cases
where you do have the thing in memory.
The object systems in the target languages doesn't match CLOS. This
means if you want to use objects, you have to may from something other
than CLOS to the target language, or you can get lots of non-first arg
dispatch bugs. You can generate warnings for this quite easily at the
compile stage, if you also have a metaobject system in your generator.
As the computers on most people's desktops look like they are going to
be running a single dispatch object system as the core of their
operating system in a couple of years, downgrading from lisp's
capability is possibly the only pragmatic option. However, providing
auto-generation of the boilerplate for double dispatch is fairly
trivial, in the cases where the classes are in your control, so that can
be done transparently in most cases without a loss of conciseness.
Another thing I've played with is a lisp interface to a byte code
library, which had some success flattening OOT-OO Java and moving
branchs forward, detecting like clauses and other patterns as a
optimization process. That's implemented in Java, but with a lisp as the
control language, largely as I'd started it as a GUI based Java project,
but then decided that it would be easier to use with a command line and
scripting language, and if it's going to contain a scripting language
you may as well make it lisp. I'm planning to revisit that soon (I'm
writing an ASN.1 library for Java and want to be able to allow
flattening for the binary encoding cases but give a capability for
runtime configuration so you can read legacy file formats and arbitrary
XML), but is a bit too buggy for serious use right now, partly as I
tried to make its lisp too like common lisp so it ended up with lots of
impedance-management hacks, and more functionality than I could really
be bothered testing. I didn't want to reuse an extant cl implementation
as I hope to be able to reuse my little-lisp-on-java as a control
language for other Java tools.
Pete
- Next message: szymon: "[Re] google-it: more_control_and_pkg_man.txt"
- Previous message: Cameron MacKinnon: "Re: Lua (was Re: What would you do with 10 Man Years?)"
- In reply to: Antonio Menezes Leitao: "Re: CLOS and databases"
- Next in thread: Antonio Menezes Leitao: "Re: CLOS and databases"
- Reply: Antonio Menezes Leitao: "Re: CLOS and databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|