Live data from Hacker News

Pure Python Vim clone

github.com

21–30 of 85 posts

Re: Pure Python Vim clone

#21
post #9

My thought process upon seeing this: "Python, huh? Seems like typos in uncommon branches of the code would cause it to randomly fail at runtime, losing your work!" "Now evmar, don't be such a internet nay-sayer, plenty of people write reliable Python code. You just need tests and... yep, there's a tests directory right there in the repository." "Let's take a look. ...there's only one test!?" It looks pretty neat othe…

It's interesting that your first thought was to post a troll about how Python is a bad language.

Re: Pure Python Vim clone

#22

Earlier quoted context omitted.

I am, right now, or at least two minutes ago before I started reading HN, refactoring big chunks of _my_ text editor, WordGrinder. It's a almost-pure-Lua word processor. In the process I have been writing unit tests. Previously the program didn't have any, which was really dumb. It was dumb because, in the three days I've spent doing this, I have found (and fixed) so, _so_ many bugs. And now I have a decent set of te…

Types. They Will Save You Tests™ :-)

Types don't tell you if the behavior is correct or not.

Re: Pure Python Vim clone

#27
So is it vi clone on vim clone, exactly? I just noticed some usual things are not working (ZQ, for example), but I don't remember, maybe it's supposed to be that way in vi.

Re: Pure Python Vim clone

#28
post #23
post #20

Earlier quoted context omitted.

Types will create a false sense of security...

Can you elaborate?

print(arr[i])

Compiles, runs, fails if i is out of bounds. Which means that you need to test the code that you write, and that even if you have 100% line coverage (or branch coverage or MC/DC coverage or...), it doesn't mean i won't get the wrong value.

People who claim that "once my C++/Haskell/Agda/whatever program compiles, I know it probably has no bugs" thus tempt others to mention "a false sense of security." (Agda might be going further than anyone else with proving that i cannot be out of bounds, AFAIK... though a generally undecidable problem will remain generally undecidable.)

Re: Pure Python Vim clone

#29
post #13

Q: Why Python? A: The only alternative would be Haskell, but I still have to learn that. Wow, that would be interesting.

Hi, I once tried that, but I ran into problems with lazyness. In particular my data structure was rather simple (famous gap data structure), but editing "large" files (>1000LOC) became rather unpleasant (too big input-feedback latency). However I managed to build a _very_ basic proof-of-concept editor (no dependencies) in just a few hundreds lines of code which I could explain, but until now I was too shy to share it…

That's a shame!

"Gets the job done in just a few hundred lines of easily-explained code" is a terrific standard to meet.

"Magic abstract Haskell-fu" cannot improve such a program very much.

Re: Pure Python Vim clone

#30

Tried it on OS X. Everything blinks - as in blink-tag blinks. Not sure what's going on with that...

Can you tell me what terminal application you are using? Does it happen as well in a new terminal?

default terminal app on osx 10.6. happens in a new terminal.
Post reply on HN