Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there languages compatible with .NET that don't support unsigned types?

Let's say that I'm writing a library in C# and I don't know who is going to consume it.

The public interface of the library has some unsigned types - uint, ushort. Apparently those types are not CLS-compliant and, theoretically speaking, there may be languages that will not be able to consume them.

Are there in reality languages like that?

like image 266
Jivko Petiov Avatar asked Dec 13 '08 08:12

Jivko Petiov


2 Answers

I believe in the original version of VB.NET, unsigned types were usable but there was no support for them built into the language. This has been addressed in later versions, of course.

Additionally, I suspect that the now-defunct J# has no support for unsigned types (given that Java doesn't have any).

like image 192
Jon Skeet Avatar answered Sep 28 '22 00:09

Jon Skeet


.NET compatibility and CLS compliance are two different things. Anything that can work in some way with the .NET framework could be said to be compatible with it. CLS compliance is more strict. It provides a set of rules for language implementors and library designers to follow so as to create an ecosystem of mutually compatible languages and libraries.

The whole point of a thing like the CLS is to allow you to avoid having to research every example of a language and figure out how to support them all. If you want to do that, you can, but the alternative is to comply with the CLS and therefore know that you will be compatible with anything else (from the past present or future) that also complies with the CLS.

like image 21
Daniel Earwicker Avatar answered Sep 28 '22 00:09

Daniel Earwicker