Live data from Hacker News

Vigil: A programming language with eternal moral vigilance

github.com

41–50 of 120 posts

Re: Vigil: A programming language with eternal moral vigilance

#42
The underlying idea here is a contract system, first pioneered by Bertrand Meyer in the programming language Eiffel[1] and then augmented with the ability to describe higher-order functions by Robby Findler[2]. PLT also strongly advocated the use of blame with contracts -- the ability to blame the responsible party (function) when a contract fails. My Masters thesis under Robby Findler was on guided random testing using higher-order contracts.

I should note that an ordinary contract system does not delete your code...

[1] http://en.wikipedia.org/wiki/Eiffel_(programming_language)#D...

[2] http://www.eecs.northwestern.edu/~robby/pubs/papers/ho-contr...

Re: Vigil: A programming language with eternal moral vigilance

#44
post #13

To make this actually useful, instead of deleting bad functions, it's probably better to make the offending functions throw a special exception when they are called, signaling the calling of a function known to be bad. This way, you can still inspect the code for the offending functions and fix the bugs. Otherwise, the original code could just totally disappear after multiple runs. What good is non-buggy code if it d…

> make the offending functions throw a special exception when they are called, signaling the calling of a function known to be bad.

I believe this would make it no different from an 'assert'.

Re: Vigil: A programming language with eternal moral vigilance

#45
post #13

To make this actually useful, instead of deleting bad functions, it's probably better to make the offending functions throw a special exception when they are called, signaling the calling of a function known to be bad. This way, you can still inspect the code for the offending functions and fix the bugs. Otherwise, the original code could just totally disappear after multiple runs. What good is non-buggy code if it d…

Yes it could throw a special exception. We could call this exception AssertionError ... wait a minute!

Re: Vigil: A programming language with eternal moral vigilance

#46
post #37
post #23

I hope someone makes a C/C++ compiler that deletes functions from the source code when they trigger undefined behaviour. It would still be compliant with the standard.

This compiler would probably delete all the code. See http://blog.regehr.org/archives/761

I think that website is confused about undefined behavior, they accuse LLVM and GCC of "executing undefined behavior" for the minimal empty-main C99 program because the default headers included in the compiler have UB code in them.

But only user code is required to be well-formed and have defined behavior, system headers could just as well be written in Forth as long as the actual behavior under the compiler they come with is correct.

Re: Vigil: A programming language with eternal moral vigilance

#47
post #13

To make this actually useful, instead of deleting bad functions, it's probably better to make the offending functions throw a special exception when they are called, signaling the calling of a function known to be bad. This way, you can still inspect the code for the offending functions and fix the bugs. Otherwise, the original code could just totally disappear after multiple runs. What good is non-buggy code if it d…

From the creator's own mouth, it's a satire language, but all satire has a good point. Vigil's is many programmers' susceptibility to The Broken Window problem. It's creation raises a good point about the usefulness of contracts in the absence of mechanisms for enforcing those contracts.

Re: Vigil: A programming language with eternal moral vigilance

#50
post #13

To make this actually useful, instead of deleting bad functions, it's probably better to make the offending functions throw a special exception when they are called, signaling the calling of a function known to be bad. This way, you can still inspect the code for the offending functions and fix the bugs. Otherwise, the original code could just totally disappear after multiple runs. What good is non-buggy code if it d…

How will functions learn to stay in line if the compiler doesn't make an example every now and then? On a serious note, what you're thinking of is contracts, like so[0] [0] http://disnetdev.com/contracts.coffee/

projects like this are why coffeescript needs to support macros. There are so many coffeescript dialects out there that make minor changes to the language to accomodate one or two extra features, e.g. IcedCoffee. I don't want to have to use a separate, presumably less well supported language for this kind of stuff, just let me plug it in!
Post reply on HN