
Vigil, the eternal morally vigilant programming language - nikolasavic
https://github.com/munificent/vigil
======
endgame
Deleting offensive code was an "accidental feature" of ghc at one point:

[https://twitter.com/bos31337/status/116372971509121025](https://twitter.com/bos31337/status/116372971509121025)

> The best ghc bug ever involved a dev version of the compiler deleting your
> source file if it contained a type error.

[https://git.haskell.org/ghc.git/commitdiff/434ef2b14b37df405...](https://git.haskell.org/ghc.git/commitdiff/434ef2b14b37df405602a74838b8b38d0f5b4375)

------
mwkaufma
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](https://github.com/munificent/wren)

~~~
altotrees
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.

~~~
jeff_petersen
Yep his blog and books are great. Incidentally I started looking into Dart
yesterday. Seems like a comfy language, more so than Typescript in my opinion.

------
stephengillie
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.

~~~
aetherson
You get that this language is a joke, right?

~~~
alimw
Adopting this scheme might really lead to improved code quality.

~~~
mnemonicsloth
Well yes. The empty program is 100% bug-free. I don't think any other language
can guarantee that your code will be 100% bug-free.

~~~
chris_wot
The contract is to _do something specific_. If it doesn't do that then it's a
bug. It will need to delete itself.

------
first_amendment
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
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
You use this for high-level parts of the app. You drop down to HolyC for
anything it can't handle.

~~~
sillysaurus3
HolyC is awesome.

Aw, Terry's YouTube channel was taken down. He did so many walkthroughs of
HolyC and his dynamic programming engine.

Oh well, 353 videos were archived at least.

Thank goodness for archive.org!

[https://archive.org/details/TerryADavisTempleOSYouTubeChanne...](https://archive.org/details/TerryADavisTempleOSYouTubeChannelArchive)

HolyC:
[https://archive.org/download/TerryADavisTempleOSYouTubeChann...](https://archive.org/download/TerryADavisTempleOSYouTubeChannelArchive/20140907%20-%20160%20-%205gfoDHycEi0%20-%20TempleOS%20-%20HolyC.mp4)

Flight simulator:
[https://ia801506.us.archive.org/2/items/TerryADavisTempleOSY...](https://ia801506.us.archive.org/2/items/TerryADavisTempleOSYouTubeChannelArchive/20131003%20-%20012%20-%20FxEq6IM43sA%20-%20TempleOS%20-%20Flight%20Simulator%20and%20First%20Person%20Shooter.mp4)

~~~
bitL
Why? Because of "offensive" language?

~~~
sillysaurus3
_An archive of Terry A. Davis ' YouTube channel before it was taken down /
removed around 2017-05-18.

Due to copyright strikes not all content was available for download._

Sounds like copyright strikes. He had 1,140 videos uploaded. That's like
burning down a library.

~~~
rjeli
Wow, that’s terrible. Anyone know if he still streams? I enjoyed his casts of
walking through the HolyC source

~~~
sillysaurus3
Was he on Twitch? I'd follow.

I'd guess if he streamed on Youtube, his account is terminated so that's no
longer possible.

I kind of want to go through the legwork of reuploading most of the 1100
videos and then giving Terry the username+password of the new channel. But I
don't know if that will run afoul of Youtube's policies and I don't want to be
banned for life myself.

(Archive.org snagged most of the 1100 videos, not just ~300. But some of them
are just missing.)

------
JetSpiegel
[https://github.com/munificent/vigil/issues/24](https://github.com/munificent/vigil/issues/24)

There's a proposition to not only delete the code but commit and push the git
repo its a part of.

~~~
chris_wot
That only works if it rewrites the git history and removes the function
completely.

~~~
JetSpiegel
[https://github.com/munificent/vigil/issues/24#issuecomment-1...](https://github.com/munificent/vigil/issues/24#issuecomment-168464165)

The proposal goes further...

~~~
chris_wot
Distributed punishment. Gives a new meaning to pulling changes.

------
tasty_freeze
It seems unfair to punish a program lacking in free will.

~~~
catnaroek
Indeed. The one that needs to be punished is the programmer. I suggest burning
at the stake.

~~~
dvirsky
You are implying/assuming that the programmer has free will. That is nonsense.

~~~
taejo
“There's no free will, says the philosopher; To hang is most unjust.

There is no free will, assents the officer; We hang because we must.”

―Ambrose Bierce

------
ComodoHacker
>any function that throws an exception which isn't caught is wrong and must be
punished

It's not obvious who's to blame here, the caller or the callee.

~~~
gunnihinn
Rarely is one at fault when two argue.

------
INTPnerd
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
>rant about how not having 100% coverage is usually irresponsible.

Well, that's because it is irresponsible.

------
steinuil
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.

------
unkown-unknowns
Likewise, users ought to be punished for making mistakes as well. If someone
has a typo in a command on the cli, delete a random file from their home dir.

~~~
482794793792894
Alternatively: [https://qntm.org/suicide](https://qntm.org/suicide)

~~~
shakna
> I have invented Suicide Linux. Any time - any time - you type any remotely
> incorrect command, the interpreter creatively resolves it into rm -rf / and
> wipes your hard drive.

That adds a level of terror... Maybe somebody will add it to a tech interview.
I mean, it's got a Debian package.

------
kmill
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
Why not:

    
    
        assert n >= 0
        assert result >= 0
    
    ?

~~~
kmill
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.

------
bitL
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.

------
staticautomatic
This is so great.

