Earlier quoted context omitted.
Types don't tell you if the behavior is correct or not.
Yes they do. Ignoring trivial cases and dependent types, types tell you one of two things: "this might be correct" or "this is incorrect". Again ignoring trivial cases where exhaustive checking is possible, that's the same thing that tests tell you - and it's a hugely useful thing to be told!
Pure Python Vim clone
51–60 of 85 posts
Re: Pure Python Vim clone
#52Why not decouple the following things: - Core editor (internal representation, etc.) - Key bindings (so you could easily create an emacs instead of a vi) - Rendering - Scripting language (for customized behavior) Finally, make sure you thoroughly document these building blocks, so others can create really cool stuff with it. Also, think of possible use-cases when defining the modules. A smart architecture could allow…
The key bindings are also separate. Getting emacs bindings is not much more than changing this line [0]. Only adding the bindings for the window management and emacs command line is still to be done. (I know that emacs is actually much more than only its key bindings, but you know what I mean.)
The rendering is also independent. There are two backends: vt100 terminals and the windows console. (Honesly, my main focus is vt100, but any render back-end is possible. I think even graphical)
The same for the event loops by the way, it can run on a couple of event loops. For instance asyncio.
Documentation will follow. prompt-toolkit has already quite a lot of examples, and there's a lot of documentation in the code itself. But I agree that we should keep improving.
Cheers!
[0] https://github.com/jonathanslenders/pyvim/blob/master/pyvim/...
Re: Pure Python Vim clone
#53It's an automatic translation of the C version.
Like tomp said 4 hours ago: Like vim, just slower.™
Re: Pure Python Vim clone
#54Why not decouple the following things: - Core editor (internal representation, etc.) - Key bindings (so you could easily create an emacs instead of a vi) - Rendering - Scripting language (for customized behavior) Finally, make sure you thoroughly document these building blocks, so others can create really cool stuff with it. Also, think of possible use-cases when defining the modules. A smart architecture could allow…
There are plenty of examples in the repo that cover most of the features in the library. The awesome thing is all of the examples fit in a single page, a testament to the power and simplicity of the library.
I built pgcli (https://github.com/dbcli/pgcli) almost entirely by reading the examples.
Re: Pure Python Vim clone
#55Earlier quoted context omitted.
Yes they do. Ignoring trivial cases and dependent types, types tell you one of two things: "this might be correct" or "this is incorrect". Again ignoring trivial cases where exhaustive checking is possible, that's the same thing that tests tell you - and it's a hugely useful thing to be told!
No they don't. They only tell you that you are matching function signatures correctly. This is valuable but it's not a substitution for unit tests.
It is a substitute for those unit tests that are essentially checking type invariants. It is not a substitute for all unit tests, but I don't think anyone made (much less intended to make) that claim anywhere in this thread.
"They only tell you that you are matching function signatures correctly."
All of computation can be expressed as application of functions, so for sufficiently expressive function signatures that's not much of a limitation. Of course, if you want to guarantee that your compiles terminate, you need to apply some limits to the expressiveness of your function signatures... but there are powerful guarantees you can get out of even so simplistic a type system as C's, if you work with it rather than against it.
Re: Pure Python Vim clone
#56Earlier quoted context omitted.
It's interesting that your first thought was to post a troll about how Python is a bad language.
I regret that this post is the top of the page. I failed to anticipate that people will take any opportunity to have yet another boring static typing debate. But to be clear, in my day job I work on an app with 350k lines of Python in it and the reason I know it mostly works is due to our test coverage. As someone else mentioned in this thread, a lack of tests should not give you confidence regardless of the language…
Re: Pure Python Vim clone
#57Why not decouple the following things: - Core editor (internal representation, etc.) - Key bindings (so you could easily create an emacs instead of a vi) - Rendering - Scripting language (for customized behavior) Finally, make sure you thoroughly document these building blocks, so others can create really cool stuff with it. Also, think of possible use-cases when defining the modules. A smart architecture could allow…
The prompt_toolkit (core library) which is the basis for pyvim (same author), is well structured and modular. https://github.com/jonathanslenders/python-prompt-toolkit There are plenty of examples in the repo that cover most of the features in the library. The awesome thing is all of the examples fit in a single page, a testament to the power and simplicity of the library. I built pgcli ( https://github.com/dbcli/pgc…
Re: Pure Python Vim clone
#58Like vim, just slower. ™
Re: Pure Python Vim clone
#59Earlier quoted context omitted.
The prompt_toolkit (core library) which is the basis for pyvim (same author), is well structured and modular. https://github.com/jonathanslenders/python-prompt-toolkit There are plenty of examples in the repo that cover most of the features in the library. The awesome thing is all of the examples fit in a single page, a testament to the power and simplicity of the library. I built pgcli ( https://github.com/dbcli/pgc…
Will you please make pgcli compatible with the most recent prompt_toolkit release?
Re: Pure Python Vim clone
#60There's a Java version of Vim here: https://www.mtsystems.ch/#section2 It's an automatic translation of the C version. Like tomp said 4 hours ago: Like vim, just slower.™