This seems like an odd choice when creating a new language. Most modern languages (C++11, Swift) have been introducing new declaration techniques or requiring all variables to be initialized at declaration, as this prevents a large class of bugs.
This seems like an odd choice when creating a new language. Most modern languages (C++11, Swift) have been introducing new declaration techniques or requiring all variables to be initialized at declaration, as this prevents a large class of bugs.
import std.array : uninitializedArray;
int a; /+ defaults to '0' +/
int b = void; /+ not initialized +/
bool[5] c; /+ defaults to array of 'false' +/
auto d = uninitializedArray!(bool[])(5); /+ not initialized +/Using 'auto' in C++ forces out uninitialized variables as well.
I don't know about Felix, but even the simplest C compilers I use are able to warn me when they can't verify that a variable is initialized before first use. It's not that hard. And, no, you don't have to solve the halting problem as long as you're clear what you promise to warn about. There are cases where you can trivially prove initialization or failure to initialize. Promise to get those cases right, and to warn on anything else.