Browse thread
[Caml-list] Automatic wrapper generator
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | skaller <skaller@u...> |
| Subject: | Re: [Caml-list] Automatic wrapper generator |
On Sun, 2004-05-23 at 00:19, Marcin 'Qrczak' Kowalczyk wrote: > Unfortunately in my case it has two problems: > > 1. My compiler doesn't produce as optimized code as it could. It's not > that bad, but dynamic typing make generating good code very hard. > It would be interesting to try to make some universal C binding for my > language (after macros). I'm leaving considering it for the future. What I think you will have to do is what I'm doing now with Felix. YOu actually commit to writing the bindings in your language. You make sure you can make them work. Then, you examine what would make it possible for the compiler to generate better code and extend your language to handle it. For example, Felix has a specialised 'domain specific sublanguage' which deals with C bindings. There is a whole class of statements which do nothing else than organise C interfacing. In your case, you might consiser a DSSL which has some static typing, just to deal with FFIs .. but which is higher level than C, and interfaces with the rest of your language. I think you can do this by saying 'we have many objects at the moment, all the same static type -- my language isn't typeless, just monotyped'. Ok, so add a type system with two types: native and foreign. You can't lose any dynamics here, since they're embodied in the native part already. Just a thought. I worked on statically typing Python .. and it turned out to be almost impossible but *only* because of a few nasty language features 99% of all Python programs could do without (unrestricted 'eval' and mutable modules being two such evils). -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners