5 ms·
What for? What benefits does the use of Python confer in this case?
by melted 11y ago
What for? What benefits does the use of Python confer in this case?
- bagrow 11y agoThis is discussed in the readme. One point: > The big advantage of using Python and prompt_toolkit is that the implementation of new features becomes very easy.
- gkya 11y agoWhat new features are necessary in tmux? Isn't it enough to be able to split, and connect/disconnect to a session?
- paulddraper 11y agoREADME.md is a good place to check: Compared to tmux To some extend, pymux is a clone of tmux. This means that all the default shortcuts are the same; the commands are the same or very similar, and even a simple configuration file could be the same. (There are some small incompatibilities.) However, we definitely don't intend to create a fully compatible clone. Right now, only a subset of the command options that tmux provides are supported. Pymux implements a few improvements over tmux: There is a completion menu for the command line. (At the bottom of the screen.) The command line has fish-style suggestions. Both Emacs and Vi key bindings for the command line and copy buffer are well developed, thanks to all the effort we have put earlier in prompt_toolkit. Search in the copy buffer is highlighted while searching. Every pane has its own titlebar. When several clients are attached to the same session, each client can watch a different window. When clients are watching different windows, every client uses the full terminal size. Support for 24bit true color. (Disabled by default: not all terminals support it. Use the --truecolor option at startup or during attach in order to enable it.) About the performance: Tmux is written in C, which is obviously faster than Python. This is noticeable when applications generate a lot of output. Where tmux is able to give fast real-time output for, for instance find / or yes, pymux will process the output slightly slower, and in this case render the output only a few times per second to the terminal. Usually, this should not be an issue. If it is, Pypy should provide a significant speedup. The big advantage of using Python and prompt_toolkit is that the implementation of new features becomes very easy.
- melted 11y agoThat doesn't answer the question though. Why not just add all (or some) of the aforementioned stuff to tmux? Tmux is an established, widely used piece of software. Any improvements would be much more appreciated there.
- ymse 11y agoYou could say the same about screen vs tmux (or endless other software clones). Projects like these help drive innovation on both sides. Competition, if you like. Besides, Pymux is Python while tmux is C. I'm sure you can appreciate that adding a Python API to tmux would be non-trivial, both code-wise and politically.
- JustSomeNobody 11y agoBut what's the innovation? Adding the python API?
- toolz 11y agoNot everything has to innovate. I understand it would be more useful to you and I if it did innovate, but there isn't some prereq for posting to hacker news that your project has to be innovative. I personally find this project interesting to see, although I won't be using it.
- JustSomeNobody 11y agoThe comment I was replying to specifically mentioned it.
- hueving 11y agoSpend the 30 seconds required to read the ancestor comment explaining what it has enabled WRT prompt toolkit.
- 11y ago
- _pmf_ 11y agoExtensibility via Python scripts instead of custom config syntax maybe?
- melted 11y agoWell that seems to be of very marginal utility to me, but I concede that it might be a much bigger deal for others.
- emidln 11y agoIt's probably not even that hard to embed the CPython interpreter into tmux and allow extensions written in python. If you just wanted to write python extension modules, embedding Python and then wrapping the tmux api with Python using cffi is likely a winner.
- JulianWasTaken 11y agoThis is a frequent and IMHO mostly weird question. I understand the "why reimplement XYZ in $YOURFAVORITELANGUAGE just to have XYZ in $YOURFAVORITELANGUAGE" sentiment but there is an equally valid benefit in using uniform tool stacks. I am a Python developer. I am comfortable working in other languages, and contributing patches to tools written in other languages, but there is a real benefit to having a full toolset written in a single language even if some of those tools are less developed than their counterparts. This is besides the benefit that even though you might not need tmux in Python, having tmux in Python might have created tmux-the-library which someone might later need. (I haven't yet tried this but I plan on doing so. On an unrelated note, thanks to the author for making this pure Python, and for caveatting "it's not as fast as C" with "but try PyPy").
- JustSomeNobody 11y agoNot sure I quite get what the benefit is in having all my tools in one language.
- JulianWasTaken 11y agoHere's a decent start of a more elaborated explanation: http://pyvideo.org/video/83/djangocon-2011--keynote---glyph-lefkowitz http://pyvideo.org/video/83/djangocon-2011--keynote---glyph-...
- jodrellblank 11y agoFrom the link: Just like pyvim (A Vi clone in Python.), this is another experiment. A hobby project