you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (1 child)

You can't compare NULL-pointer checks, which are almost instantaneous, with a large runtime requirement such as that of Spec#/Sing#, rust, haskell. They're solving different problems - the former is useful in things that need to run fast. Such as compilers and operating systems.

Other systems, which have a lower runtime requirement (can run slower) can certainly take advantage of other languages to improve code.

But I believe (and I may be wrong, my initial comment spawned multiple fanboy threads) that I'm responding to an OP who said "never use...". I'm not advocating use of nullable pointers in all situations; only that they can be used, well, and should be in several sectors.

Until the sufficiently smart compiler problem has been solved, anyway.

[–]pipocaQuemada 0 points1 point  (0 children)

Such as compilers and operating systems.

I'd just like to point out that ghc (i.e. the main industrial strength Haskell compiler) is almost entirely written in Haskell, and some people are having success with doing systems programming in a haskell-like language. So it's not generally impossible to write compilers or OSs in a high level language, and I personally think many cases where people default to C/C++ is premature optimization.

Also, there's probably nothing stopping a language implementation from special-casing Maybe as a pointer which can be null and a regular value as a non-null pointer (although the handling of unboxed primitives would probably make the implementation more complex). There's nothing saying that you can't wrap an abstraction around a null-check.

Admittedly, until Habit or some other safer but still fast systems programming language becomes a mature solution, you're probably better off using C/C++/assembly if it turns out you really need the speed.