What does HackerNews think of vigil?
Vigil, the eternal morally vigilant programming language
Similar to how there are some nice ideas in Ok?, Vigil had some some cool capabilities like the `implore` statement - a dynamic value check on function arguments.
This was the Hacker News thread for it https://news.ycombinator.com/item?id=5002597
This is an example from itzer/virgil [1]:
def fib(i: int) -> int {
if (i <= 1) return 1;
return fib(i - 1) + fib(i - 2);
}
And an example from munificent/vigil [2]: def fib(n):
if n < 2:
result = n
else:
result = fib(n - 1) + fib(n - 2)
swear result >= 0
return result
[1] https://github.com/titzer/virgil/blob/master/doc/tutorial/Me...“It goes without saying that any function that throws an exception which isn't caught is wrong and must be punished.”
It no longer is, since C++11. Check Phase 2.2 here: https://en.cppreference.com/w/cpp/language/translation_phase...
> clang won't delete your source file, even though it would be perfectly within its rights to.
UB allows the execution of the compiled program to wipe your hard drive, but it certainly does not give your compiler that right. I mean, the standard doesn't say what side effects invoking a compiler is allowed to have (because that's out of scope), so none of it can be predicated on UB.
(Mandatory mention: https://github.com/munificent/vigil)
https://github.com/munificent/vigil
It's a programming language that erases any code that fails to meet contracts or throws an exception.
A more modern implementation: https://github.com/munificent/vigil
It's a bit the opposite of Vigil, a programming language who punishes functions throwing errors.
https://github.com/munificent/vigil
"It goes without saying that any function that throws an exception which isn't caught is wrong and must be punished."