On Tue, Aug 27, 2013 at 1:43 PM, Jonathan S. Shapiro <[email protected]>wrote:

> David (I think) asked how BitC would be different from C#. On reflection,
> that's an interesting question. Given that I think BitC needs a single
> inheritance object system, it *does* start to look a bit like C#. So
> here's an attempt to answer David's question. If I were king of the
> universe, what would C# 6.0 have?
>

It was me..

>
> 1. Fixed-size arrays in the safe language subset. The fact that the *fixed
> * keyword is unsafe is just plain irredeemably stupid. I'm told that
> fixed arrays were planned for CLR 1.0, didn't make the cut, and were
> dropped. It's time. Oh. They shouldn't be limited to non-reference types
> either.
>

well fixed allows you to draw a pointer which you can then manipulate eg
ptr + sizeof(abc) .. So you really need 2 types of fixed

I think its a major change in C# to work with a pointer to these fixed size
embedded arrays ( as opposed to the ref type enbedded array) .  They did in
v2 allow you to create such an array on the stack  with stackalloc which is
surpiringly usefull .
Note usafe in C# is not that unsafe ,  still heaps of limitations on what
you can do its just teh GC cant handle those pointers outside of fixed.



> 2. Attributes on local variables.
>

Weird but could be usefull.

>
> 3. Attributes on types, not just on variables. With this, and a very
> little bit of attribute algebra, effects could be encoded as attributes and
> effect propagation could be user defined.
>

Classes and value types can have attributes ..

>
> 4. A proper region typing system
>

yep

>
> 5. readonly properly enforced, plus shallow and deep readonly.
>

yep.

>
> 6. Type classes, to be used as WHERE constraints
>

yep

>
> 7. Nat kind and associated kind classes, as introduced in Habit
>

yep.

>
> 8. Top-level functions (this is just a sugaring change).
>
> 9. Closures (as opposed to delegates)
>
> 10. Direct support for immutable types and effect-free code.
>

part of read only .

>
>
> Probably more, but that's my initial list.
>
>

My list in order

1. Regions
2. Tail calls
3. Some less verbose type declerations  and map .
4. Explicit no boxing on a type , you can use unsafe now but it always gets
boxed somewhere defeating the purpose. This requires a new standard lib.
5. NAT type to imorve run length elimination
6. Type classes and constraints
7. Single threaded mode with compiler optomizations.
8. First class integer SIMD support you just cant beat working on 32 shorts
at once ,  LINQ over SIMD arrays , building SIMD eg
IEnumerable.ToSIMDArray()  saving the registers on context switches.
9. Remove inheritance or add a warning . C# devs dont really use it
anymore.
10   Better unboxed types so you dont need unsafe ( though i dont reall
mind unsafe)  , but remove the restriciton that calling a non CLR unsafe
lib is only possible with unsafe.
11 ref counting as an option for tracking a class.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to