Re:Vigil: A programming language with eternal moral vigilance
by ConstantineXVI on Thursday January 03, 2013 @12:37PM
(#5003444)
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]
Re:Vigil: A programming language with eternal moral vigilance
by phpnode on Thursday January 03, 2013 @01:03PM
(#5003581)
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!
Re:Vigil: A programming language with eternal moral vigilance
by ConstantineXVI on Thursday January 03, 2013 @01:32PM
(#5003753)
> The golden rule of CoffeeScript is: "It's just JavaScript"[0]
Macros would be deviating from core JS too much to fit with CoffeeScript's goal. Just happens that the compiler is nicely hackable to allow for these projects.
Not to say I object to the idea of an expanded CoffeeScript, just that it should be a fork.
Re:Vigil: A programming language with eternal moral vigilance
by gtrak on Friday January 04, 2013 @12:41PM
(#5008709)
Macros will eventually be in core JS, see:
http://disnetdev.com/blog/2012/10/14/hygienic-macros-for-jav...
and http://brendaneich.github.com/Strange-Loop-2012/#/40 http://www.infoq.com/presentations/State-JavaScript
Re:Vigil: A programming language with eternal moral vigilance
by mcguire on Thursday January 03, 2013 @12:12PM
(#5003322)
And so moral relativism raises its hideous, three-horned, leering head....
Re:Vigil: A programming language with eternal moral vigilance
by eli_gottlieb on Thursday January 03, 2013 @04:12PM
(#5004692)
And now I'm imagining Moral Relativism speaking in John de Lancie's voice.
Re:Vigil: A programming language with eternal moral vigilance
by aredington on Thursday January 03, 2013 @12:49PM
(#5003507)
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
by discreteevent on Thursday January 03, 2013 @07:48PM
(#5005656)
I just read it as a satire on how ridiculous safety checking could be if taken to an extreme. In the same way that some dynamic language advocates think its hilarious that statically typed languages won't even let you run your program if there is a type error in case you might harm yourself by violating your own rules!
Re:Vigil: A programming language with eternal moral vigilance
by dkarl on Thursday January 03, 2013 @06:17PM
(#5005319)
Bah. A virtuous function values its integrity over its life. It will speak the truth, and if that means throwing an exception that the caller isn't prepared to hear, so be it. Bring on the hemlock!
Re:Vigil: A programming language with eternal moral vigilance
by busted on Thursday January 03, 2013 @12:44PM
(#5003481)
> 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'.
Otherwise, the original code could just totally disappear after multiple runs. What good is non-buggy code if it does nothing? Failure to perform the user's requirement at all is also a bug. Not having the original code that you can at least edit to fix is rather pointless, especially when vigil doesn't indicate the callers of the offending functions, because next time you run vigil, those will get deleted. Besides, if foo()'s failure is completely due to bar()'s failure to fulfill its 'swear', it's foo()'s failure is not really its bug.