Target Backend for a Uniquely Typed Language

I'm currently designing a small, uniquely typed language for a masters project. So far the semantics is pretty well mapped out and I'm looking for a suitable backend to compile to.

Although the language has been designed as an imperative language with referential transparency, it can be translated fairly directly into Haskel, however doing so loses most of the benefits of having uniqueness typing, i.e. object lifetime can be determined at compile time meaning no garbage collection and safe destructive updates. I'd like to find a suitable backend/vm to compile to that will allow me to take advantage of these properties.

It would be nice to be able to include laziness and implicit parallelism too, although neither is essential and are perhaps beyond the scope of my project. Having said that, a backend that supports concurrent programming would be very useful, as uniqueness typing allows for an interesting model of concurrency without deadlocks or race conditions....

I can happily provide more concrete information on the language (I should really give it a name) if needed, I'm not sure of the kind of thing that's important to consider.

A previous discussion on this site talked about how linear languages can be compiled using stack machines and permutations, so some sort of stack based vm might be a good idea.

Thanks!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Clean perhaps?

Perhaps Clean fits the bill.

Although the language has been designed as an imperative language with referential transparency, it can be translated fairly directly into Haskel,

Clean is very similar to Haskell.

however doing so loses most of the benefits of having uniqueness typing, i.e. object lifetime can be determined at compile time meaning no garbage collection and safe destructive updates.

Clean has Uniqueness Typing and the compiler does compile-time garbage collection (called reuse unique nodes in the IDE). This does require that you provide uniqueness attributes in the types, so you will have to find a suitable translation of your types to Clean types.

Thanks

That looks like a good place to start. I'll start working on how to translate the types.

Thanks for the links as well, I've looked at clean before but never found that much information on it.

Cat

Apologies in advance for the shameless plug.

My language Cat (or some variant of it) could possibly be a possibility, even though it isn't mature like Clean. Cat is a small functional stack based language, with a static type system. See the Cat home page, or this article at Doctor Dobbs.

I have also been working lately on a byte-code language based on Cat, called CVML. I can post the specs in a day or two (currently I'm in the middle of a move).

Primary ideas of CVML:

  • stack-based with higher-order functions
  • designed with an emphasis on compact code representation
  • support for list processing primitives, where laziness is implementation specified
  • support for both statically and dynamically typed (checked) languages.

If you are interested, I would be interested in collaborating on making CVML a target for your language. I have been looking for a good source language other than my own projects (e.g. Heron). You can write me at cdiggins at gmail.com, if you want to converse off line.

re: Cat

Cat look pretty interesting...It could be just what I'm looking for.

I have a few questions about it, but I'll play around with Cat first and email you with them.