A thought on the design of new low-level languages...

The other day i was reading & pondering about effect systems, linear types & regions, unquiness typing and relationships between them aswell as monads/arrows and the resulting (relatively) new programming languages coming out on the research done with linear types & regions like Cyclone & Vault.

At the same time i was briefly looking into Xanadu a dependently typed imperative language then it got me thinking about the advantages that linear types & regions and dependent typing bring to safety, clearly there is potential for research of utilizing/combing the two in the context of low-level programming languages?.

From what i understand inorder to use a rich type system with linear types, one has to use unquiness typing.

Anyways what do you guys think? dicuss! discuss!! :-)

Comment viewing options

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

define

Define "low-level." I'm assuming you mean performant, system-level, correct? Otherwise, one could make the case that including such features in a low-level programming language could possibly make it high-level.

On the topic at hand: I suppose such a language could be conceptually "better" (relatively speaking, of course), although I'm unsure on its uptake when it comes to the community. Specifically, a system-language would obviously target system programmers, of which you can split into two groups: those who work on production systems which cannot be ported and those working on or creating new systems. A new language, barring fairly extreme circumstances, is probably unlikely to be used by the former. Once you get rid of that baggage, you can basically do whatever you want, including the use of a high-level language to write it. What this means is actually fairly subtle: the programmers of such systems are actually saying that they want to spend the least amount of time in a system-level language as possible. I suspect what language that is doesn't matter so much, as they're not writing any substantial amount of code with it, anyway.

Define "low-level." I'm

Define "low-level." I'm assuming you mean performant, system-level, correct?

Yeah system level, for example Cyclone & Vault are safe dialects of C with stronger type systems and some features added from typical statically typed functional languages like algebraic datatypes (discriminated unions) and pattern matching, etc, etc. These would be examples of low-level languages i'm talking about.

Otherwise, one could make the case that including such features in a low-level programming language could possibly make it high-level.

Yes that is exactly what i thought of at first, bit of an oxymoron! but if you look at Xanadu which is an imperative dependently typed language, it's looks like a (sub-set of) C with a dependent type system so it doesn't feel like a high-level language yet it is quite expressive but more importantly the safety advantages that can naturally come with a dependently typed language without the need to treat it as a special case like eliminating array bound checks. I'm only suggesting a lightwieght approach to dependent types.

So i think having a lightweight dependent type system with linear types & regions with a low-level language from the beginning i think would make it abit more cleaner (but more importantly safer) language than say Cyclone.

Vault ?

I have no experience with Cyclone, but last time I looked at Vault, it didn't really strike me as low-level -- and especialy not as a dialect of C, as it had a different set of primitives.

... but last time I looked

... but last time I looked at Vault, it didn't really strike me as low-level -- and especialy not as a dialect of C, as it had a different set of primitives.

Are you sure we are talking about the same thing? this is straight from the horse's mouth:

Vault is a safe version of the C programming language, being developed at Microsoft Research, which provides the same level of safety as languages like C#, but allows a programmer to retain control over data layout and lifetime.

Yes that is exactly what i

Yes that is exactly what i thought of at first, bit of an oxymoron! but if you look at Xanadu which is an imperative dependently typed language, it's looks like a (sub-set of) C with a dependent type system so it doesn't feel like a high-level language yet it is quite expressive but more importantly the safety advantages that can naturally come with a dependently typed language without the need to treat it as a special case like eliminating array bound checks. I'm only suggesting a lightwieght approach to dependent types.

So i think having a lightweight dependent type system with linear types & regions with a low-level language from the beginning i think would make it abit more cleaner (but more importantly safer) language than say Cyclone.

It would make a pretty good language, but I'd rather see work go into making high-level languages suitable for certain tasks system-level languages are used for--low-memory, speed-critical environments. This doesn't necessarily mean removing everything from the language, just making it modular and letting the programmer override certain things, e.g. do manual memory management.