#1685 Is the (non)nullable feature unique to fantom

jessevdam Wed 26 Oct 2011

I am curious whether the (non)null able feature is unique to Fantom

DanielFath Wed 26 Oct 2011

I think it appears in C# as well.

helium Wed 26 Oct 2011

Nice has basically the same system as Fantom.

Basically all typed functional languages don't have null at all.

brian Wed 26 Oct 2011

In C# it is available, but only for primitives.

Statically typed functional languages often use Option<T> type instead of nulls.

Although Fantom is somewhat unique in that it uses the type system to only prove what is not correct, not necessarily what is correct.

jessevdam Wed 26 Oct 2011

I think they did that in c# for performance reasons an non null able primitive can be inlined where as a null able can not.

I think the nullable system is very nice thing, but there some things with it where I am still thinking about.

brian Thu 27 Oct 2011

I think they did that in c# for performance reasons an non null able primitive can be inlined where as a null able can not.

This is actually why Fantom got it too. Stephen had been advocating it, but at the time the real motivator for me was to deal with boxed and unboxed value types. Back then Bool, Int, Float were always boxed as subclasses of FanObj. But now, I find it really frustrating to read Java code and not know what the nullable intent was. So definitely been proved out as great feature.

Login or Signup to reply.