top | item 15209452

Vigil, the eternal morally vigilant programming language

173 points| nikolasavic | 8 years ago |github.com | reply

48 comments

order
[+] mwkaufma|8 years ago|reply
Vigil comes from Munificent, the principle developer of wren, an unironic language that fills lua's niche (portable c, embeddable, no dependencies), with a nicer syntax: https://github.com/munificent/wren
[+] altotrees|8 years ago|reply
I believe he is also on the Dart lang team at google. He has a pretty awesome blog and is super insightful when it comes to programming languages. His Github projects inspired me to research language design further.
[+] stephengillie|8 years ago|reply
I made an automatic error fixer once in Powershell. When you load a module, it would catch missing commas between parameters, and update the module file with the missing commas. I want to extend it to catch many more common coding mistakes.

This sounds like the opposite idea, remove the function instead of repairing it. Very aggressive idea.

[+] stephengillie|8 years ago|reply
Replying to braveo's unfortunately dead comment[0]:

> I would be interested in the technique you used to do this. specifically, how did you get your code to kick off and check on module load?

Powershell has great error-handling, and all errors are stored in the special $Error variable. For missing commas, semicolons, brackets, and other punctuation, the errors usually have the line-and-column of the missing item.

So the function would just parse $Error and update the module file with the right item at the right location.

[0] https://news.ycombinator.com/item?id=15212428

[+] aetherson|8 years ago|reply
You get that this language is a joke, right?
[+] braveo|8 years ago|reply
I would be interested in the technique you used to do this. specifically, how did you get your code to kick off and check on module load?
[+] first_amendment|8 years ago|reply
Jokes aside, semantically "implore" and "swear" are actually really good primitives for static analysis. "swear" is only dangerous because there's a chance it gets out of sync with the code it's swearing for.
[+] vidarh|8 years ago|reply
Check out Eiffel if you want a serious version of pre/post conditions and invariants. Or any number of functional languages where the approach tends to be to use the type system for these type of guarantees instead.
[+] nickpsecurity|8 years ago|reply
You use this for high-level parts of the app. You drop down to HolyC for anything it can't handle.
[+] tasty_freeze|8 years ago|reply
It seems unfair to punish a program lacking in free will.
[+] Retra|8 years ago|reply
Things that lack free will cannot imagine alternatives to their current reality.
[+] catnaroek|8 years ago|reply
Indeed. The one that needs to be punished is the programmer. I suggest burning at the stake.
[+] INTPnerd|8 years ago|reply
I was actually kind of excited until I started reading the sample code and that it deletes code that has bugs. Of course this coming from the guy who went on a reddit rant about how not having 100% coverage is usually irresponsible.
[+] carlmr|8 years ago|reply
>rant about how not having 100% coverage is usually irresponsible.

Well, that's because it is irresponsible.

[+] steinuil|8 years ago|reply
So this is essentially a creative implementation of the contracts model from Eiffel. I like Racket's implementation a lot, which is coupled with its module system.
[+] kmill|8 years ago|reply
An early computer-based Nomic game (which I've forgotten the name of) had its proposals in the form of patches to the PHP for the game website. The way they handled buggy submitted code was to excise offending blocks of code until it ran again.
[+] hliyan|8 years ago|reply
Why not:

    assert n >= 0
    assert result >= 0

?
[+] kmill|8 years ago|reply
Because those don't delete the offending code which must be punished.

Also, implore specifies the caller is offensive, and any function which swears a falsehood is offensive. The latter is like assert, but the former is like lifting the assert to the caller.

[+] first_amendment|8 years ago|reply
One is a requirement, the other is a promise. The promise "result >= 0" is necessary because the compiler may not be able to prove that on its own.
[+] bitL|8 years ago|reply
Can't wait until this is noticed by a manager with a PhD from protestant theology and decided to be used/implemented :D

Referential self-punishment. Self-removing code during runtime based on a predestined moral functor.