416 points · by guessmyname · 6y ago · 336 comments
base64 /dev/urandom | head -c 1000000000 > file.txtThough I take the point: if a text editor advertises itself as being "fast", this is the kind of stuff you expect it to handle.
EDIT: ok, so i just tried the hexdump version. Vim and Emacs took a couple of seconds each (Emacs being slightly slower and chunkier when you navigate, Vim handles it without issue and is perfectly repsonsive). less opened it instantly (obviously, it's less!). ox has been going for a few minutes now, nothing happening.
It's not the benchmark's fault, ox is just slow for large files.
Personally i see no reason why this is needed (just use vim), but I'm sure a lot of people will use it just because its written in rust^^
I've always wanted to be able to try and verify performance bounds at the CI stage, and I'm hesitantly optimistic it can be done cleanly (although amortized analysis is extremely important, you can actually play "guess the C++ std container from the graph" if you plot the data right)
\s
Development speed of applications in Python compared to raw assembly is nearly infinitely faster, both because it’s easier to write and because the talent pool for ASM is near zero in most cities.
But the same can be said for basically all metrics people use to sell products.
I mean, I very rarely see non-rust projects say "Written in X!" as a selling point for the end user (why would an end user care?), and the campaign to re-write everything in rust is similarly irritating. I've never explored or read up on the rust community, but the sheer insistence that I see jutting into everything from the outside turns me off.
Lots of stuff where X != Rust.
> (why would an end user care?)
They probably don't. But, on GitHub, where programmers go, and on a forum like this, with lots of developers, this means something to many folks here.
I do agree that I'd rather see the technology choice not highlighted so much, though. But it really is a proxy for some things that matter to me: if it is in Rust, I expect it to be a single binary I can easily install and which starts up quickly and performs well (as opposed to, say, javascript, python, ruby, or java programs), but is likely to suffer very few security problems (as opposed to, say, a C or C++ program), and has a decent shot at growing an active community, which I may be able to contribute to. A lot of these things apply to other technologies (like the aforementioned Go) as well, but it I do feel like I get some information by knowing the technology.
Maybe the better approach would be to enumerate benefits rather than saying what the technology is, even if the benefits flow from the technology choice.
That means the solution often ends up being written Go, Rust or C/C++, to the extent that Go and Rust specifically also turn out to be good signalling that the application may meet my other requirements, partly simply because they are relatively new languages. They also seem to signal better thought out and more “serious” solutions, perhaps because of the barrier to entry they present vs interpreted and scripting languages.
So yeah. Rust or other languages certainly aren’t a requirement but they do sometimes present some useful signalling.
Nothing has put me off of Rust more than "Rust people". The same thing happened to me with Python over 20 years ago and I've successfully (and happily) avoided that language for over 20 years because of just how unbelievably, unstoppably "effervescent" Python people were in the late 1990s. If Python were 10% as good as those people said is was, it would be, by a wide margin, mankind's greatest achievement for the next 10 millennia.
I get the exact same vibe from "Rustaceans."
I mean it can have a crappy UI, and not do what you want it to, but at least you won't have a memory leak.
I think for most applications, written in rust shouldn't be a selling point, but things such a cURL can definitely benefit from it
I'd seriously like someone to build a HN scraper that aggregates all the articles prefaced by "How I built a..." and then write an article called "How I built a scraper to aggregate 'How I built a...' articles to assess their HN upvotes." I'd upvote that.
The part about Vim is almost entirely missing the mark, but arguably so does the part about Emacs. The real brilliantness of Emacs is that almost everything is an Emacs buffer. The interface is extremely uniform: text file, configuration menu, completion buffer, compilation log, IRC chat window, it's all the same "widget" with just some customization (keybinds, coloring) on top. You can always copy/paste text the way you're used to, navigate the buffer the way you're used to, everything is uniform and consistent.
Ever felt the frustration of having an application pop-up a modal with an error message and you want to search for it online, only to realize that you can't select the text so you have to copy it by hand? That can't happen in Emacs. Ever been annoyed that your custom bindings and shortcuts didn't work in all the parts of your editor? That the way you interact in the main text editor is different from the input box in the search dialog? In Emacs it's all the same thing.
I switched to Vim a couple of years ago but this uniform interface is still something I miss. Maybe one day I'll bite the bullet and use Spacemacs.
I'm no emacs guru, but I know this much: even if we suppose for the sake of argument that customizability is the best thing about emacs, it's an absolute pratfall to write
> Ox took the idea for the customization and extensibility of Emacs and made a configuration system where you can change the colours and appearance of the editor.
Doom emacs also has default vi-workflow.
The readme mentions Emacs and says: "Ox took the idea for the customization and extensibility of Emacs and made a configuration system where you can change the colours and appearance of the editor."
Changing the colours and appearance is a customization option for every text editor.
Now if the readme mentioned that Ox had it's own version of a .emacs file that would run any Rust code you put into it on start up then I would be VERY excited.
Basically I want Vim with an Emacs backend. I don't need a bajillion plugins, but I want the things that I use to be easily tweakable and customizable, something that Vim struggles with and Emacs excels at in my experience.
For many, many, many vim'ers, I know, the modal system (and hence the musclememory macro/scripting) IS the defining best feature...
Also, see all the "browser with vim binding" and "x with vim bindings" that is the modality, not the plugin system, that is emulated...
Correspondingly, I have a lot of cool plugins in my .vimrc now, and my editor works better.
Bonus: no remote echo typing lag! (Yes, I know about mosh.)
The *BSDs come with vi for example
I am sure that it made me a better programmer as I know a lot of stuff by heart, where a lot of "auto" programmers are merely constantly picking of a list, which I think breaks their thinking flow...
Which is basically the same as not using the vim muscle memory for me..
Consider a piano player that needs to look up the right keys before every stoke.. The never get a feel for the music..
In the past decades I have written (and still do) like 50/50 in IDEs and plain to somewhat less plain text editors, and if there's something which is a flow breaker for me, then it's coming up with the exact name and method in such plain editor when I just know there's one which does what I need but cannot remember the exact name. Fuzzy matching it against a list doesn't break any flow for me on the other hand.
Which matches how my memory works: I cannot remember hard facts and data well (function DoSomethingVeryHardCore). However I'm good at remembering abstract things (function which does something hardcore). I am pretty sure learning many things by heart from the many very different codebases I work on would be a complete waste of time. Instead learning some abstract mental model of the codebases architecture, and how to navigate through it in text, is what makes me fast and efficient.
Programming is not remotely the same as playing the piano. This and the sibling "I don't make mistakes" comment just seem like excuses to me.
I -personally- find it way more comfortable than even a minimal vim install because when I typo a command it beeps at me, whereas in vim I generally accidentally activate a command I don't understand and get broken out of flow while I figure out wtf just happened.
I don't at all judge people who're IDE wizards, I've not seen any correspondence between maximalist versus minimalist taste in tooling and competence, but this approach works way better for me.
> where a lot of "auto" programmers are merely constantly picking of a list, which I think breaks their thinking flow...
For me, typing when the computer can type faster than me breaks the flow. Though your auto complete is very bad if it needs you to pick things from a list - 99% of the time it's just "type a couple of first letters, <ctrl-space>, repeat for the next token."
> Consider a piano player that needs to look up the right keys before every stoke..
Most professional classical musicians play with sheet music, no ?
I have never liked autocomplete. If I know the type or method I’m looking for (which is most of the time) then typing its name is not a hardship, and takes really no more time than finding it in a list.
If I don’t know the type/method, most of the time I have the documentation up in another window or monitor, and I’m going to want to read that in depth anyway, since I’m not familiar with the type/method, so autocomplete wouldn’t save me any meaningful time.
I don't really like realtime linting, autoformatting, or error highlighting either. I find it highly distracting, and usually it's complaining about something I was already going to fix anyways. I'd rather have such things done only when I intentionally trigger them. I'd say please stop whining about syntax errors and test failures in code that I haven't finished writing yet.
I've tried some Git plugins, but never got into those either. I still prefer the gitsh cli application for most of my Git work.
I hate things not being configured explicitly in files that I can version control.
> Ox is easier to use than Vim because it doesn’t have modes where the keyboard is repurposed, however it takes the idea of being a keyboard-only editor and being able to act just like an IDE after some configuration.
Modes in Vim re-purpose the keyboard. What does Ox do to re-purpose the keyboard? You can't have all functionalities on CTRL+? bindings.
> in Vim re-purpose the keyboard. What does Ox do to re-purpose the keyboard? Y
Imagine a car being advertised in a similar style called Imacar.
Ferrari, know for its Italian design and sleek lines, Imacar takes those famous design cues by including wheels and tires.
Toyota, known for it's rugged truck's like the Hilux. Inspired by that ruggedness and repairability the Imacar includes easy change windshield wipers.
Tesla, know for their famous electric motors and batteries, inspired us to add a battery to Imacar's petrofuled engine.
- Vim: they took away "being a keyboard-only editor" (every CLI/TUI text editor?) and "being able to act just like an IDE after some configuration" (most programmer text editors?). Also, "being a keyboard-only editor" isn't even accurate for vim, it totally supports mouse input even in a terminal: https://vim.fandom.com/wiki/Using_the_mouse_for_Vim_in_an_xt...
- Emacs: they took away "a configuration system where you can change the colours and appearance of the editor"... This is adequately discussed elsewhere in the thread.
Therefore, gp's analogy of taking away wheels and tires from Ferrari is apt.
I’m not really sure what to think of everyone being so negative here.
Yes, after reading how the author described vim and emacs, I knew this project was not for me.
It looks like someone has never read the vim manual.
It's entirely unclear what niche this editor is aiming for. If it's a replacement for the editors it claims as inspiration it's not going to succeed.
Why not? Your car dealer will happily compare and contrast the different models too.
It is perfectly fine and valid to explain how the "new" thing fits into the crowded landscape of similar offerings. Especially when the reader is likely to be familiar with many of the "landmarks". Using other products as a point(s) of reference is very useful.
I came away from the compare-and-contrast part confused and nonplussed.
It's also perfectly alright to say "I wanted to write a text editor in Rust, so here it is! I like it and use it, you might too".
Thanks but no thanks. Almost all editors let you customize the color and appearance. Few allow you to customize to such a deep extent as Emacs.
What makes Emacs great is that the low-level text editor features are implemented in a compiled language and then exposed to an interpreted language to be composed into the actual editor. If they're not splitting the architecture into a compiled part and an interpreted part, they aren't taking anything from Emacs.
If Emacs was written in Lisp (like Zmacs), then it would have the same flexibility it currently has without having to contain an interpreter of any kind, and the user-written customizations would have the benefit of being compiled to optimized native code. Some things that you can't do in Elisp for performance reasons would be perfectly doable in a Common Lisp version of Emacs.
One of the advantages of emacs is that an insane level of customisation is possible. Or, more practically, the high level of customisation allows for a lot of low-hanging fruit for people to create editor macros that suit their usage.
Lol, incidentally macOS native text fields / text views support a bunch of Emacs keybindings out of box (C-f, C-b, C-n, C-p, C-a, C-e, C-k, C-d off the top of my mind), so any native Mac application with any text input can claim “inspired by Emacs” for free.
What will be interesting to see is if this changes now that zsh (which does not use readline) has become the standard...but alas, if you don't have EDITOR or VISUAL set, emacs is the default there too...
As for those curious, emacs is the readline default because readline is part of the GNU project.
still, I don't like to be harsh. there is a difference between treating this as a serious alternative to a Vim or Emacs (or whatever) and a programmer resume piece. I could see it being quite fun to develop my own editor as a toy project.
Really?
Chalk up another mark on the board of unserious things the Rust community does with its time.
Edit: I'm sure this will be an unpopular, downvoted comment. I just want to say that I think that Rust is a fantastic language with an enthusiastic community. It's just a community that repeatedly demonstrates that it doesn't know what "good" looks like and has the world's worst case of NIH. Something about the community attracts the like minded.
It's kind of a meme at this point.[0,1,2]
It's going to start effecting interviews. I'm saying this as a hiring manager who has to evaluate what projects candidates spend their time on and what they are going to be like to work with. People who oversell their work or don't know how to evaluate value go into the hard pass pile.
And no, I'm not shitting on them for having a hobby project. I'm shitting on them for clearly demonstrating that they don't understand what the very mainstream software they're actively trying to compete with does.
[0]:https://transitiontech.ca/random/RIIR [1]:http://adventures.michaelfbryan.com/posts/how-not-to-riir/ [2]:https://news.ycombinator.com/item?id=21334510 (which is just the comments here from [1], but also interesting.
Nevertheless, this project is somebody learning Rust on an intermediate/advanced level. Nothing wrong with that, and people deriding it because it cannot compete with real text editors with millions of man-hours behind them are behaving bit silly. Who knows, one of these exercises might become a great editor some day.
I don't think that's describing nano or pico, at least, no version I've ever used had those keys doing useful stuff. Maybe this is supposed to reference some other editor?
I'm constantly reflexively reaching for ctrl+s and then correcting myself just at the last second.
Pretty impressive what you've put together! I'm sure it's really cool being able an editor to work exactly the way you want it to work.
Instead it should say: "This is a toy project of me. Learning about text editors. It got pretty far and is really usable. Give it a try."
Also there are zillion articles about "rewrite software x in rust because it's written in evil unsafe C". The author doesn't say this but i instantly think about it if someone tries to write a better vim.
It's a really impressive feat to accomplish something like this, and it's sad that it gets framed unfairly. I just hope it doesn't deter the creator. Maybe in the future it could indeed be a serious option for people that want something between nano and vsc.
I guess this happens as you approach a really specialized set of features and aesthetic--it activates some kind of nitpick psychology, where people who are proud of their specialization are able to demonstrate their unique ability to perceive just what makes a thing in this domain really special. Well, they spend a lot of time working with these interfaces and thinking about it, so it makes some sense--the thought-energy needs to be expressed.
Anyway IDK if one can easily demonstrate that kind of deep specialist insight and also pay attention to how it makes them sound in relation to the author and the author's gift to the world. It's easy to get caught up in what your own perception is offering the world, and kind of steal the stage with what is likely to be perceived as a weirdly negative energy.
Well, the headline is perfect for grabbing HN's attention, and the comparison section is perfect for making HN angry, so that's only to be expected.
Treating it as some kind of alternative to Emacs or Vim is probably missing the point.
> Ox is a text editor with IDE-like features.
And then we had the actual feature list, current version seems to be 0.2.5.
> Auto indentation (0.3.0) > Auto brackets (0.3.1) > Auto complete (0.3.2)
Which are quite essential for calling something "IDE like".
Other than that. It looks nice. I've seen people calling it an Nano replacement in the comments here, which seems to be missing the big point of nano - it's easily available in a lot of *nix systems by default.
I've tried micro, psi but they're not in a state I can use them daily.
What i'd love is basically sublime text in a terminal. I tried ox, but it's currently a bit buggy and non intuitive (no help that I could find, no backspace, cursor on the wrong line..)
Nothing wrong with this, it's a work in progress and early in its development. It shows great promise and I'll definitely check back in the future !
Yet, I hate the punchline "A Rust powered editor". Why should anybody care? Other text editors are never presented according to the language they are written in! For one, I'm getting a bit tired of this obsession with Rust, as if being written in a particular language was somehow an interesting feature.
Potential contributors to the project may care.
I think this would be a fantastic text editor for anyone new to the terminal. Provides some syntax highlighting, a nice background, line numbers, tabs, and mostly familiar controls without a ton of setup.
I think there are still quite a few improvements I’d love for it to have, but this might be the thing I recommend to anyone first starting out in the terminal who wants a bit of a nicer editor than nano.
I think the negative remarks come from people who are probably both very knowledgeable and experienced, but also entrenched in "their" editor, and perhaps they didn't feel the blurb gave "their" editor the justice it deserves, while this isn't an editor that purports to be the "best" out there, or even the most advanced.
Personally I've never been a fan of using the terminal for anything else than reviewing code, so Micro is enough for me. It has text highlighting and commonly known Windows-esque shortcuts. To compare this to Emacs, which I've given my best shot, it just turned out way too complicated for my needs, and there's a ton of extra stuff to learn that I just wasn't motivated for on top of learning to code.
Once I saw the high treshold for getting into Emacs, I just opted out. Perhaps it is better in many ways, but I was instead lured in by Sublime Text, and I've stayed there ever since. Is it "better"? IDK. It's what works for me.
I, and I think most heavy vim users will agree, think that Vim's modal editing is one of it's great strengths. Sure, it has a steeper learning curve, but once you learn it, it is amazing.
In other word: It ain't that easy.
Clearly the author does not understand Vim. Seeing this gross misunderstanding, I can confidently assumee that Ox does not even have a quarter of the features and editing capabilities that an editor like Vim or Emacs providee.
They do, actually. What happens if you type `yy` in a non-modal editor? You get "yy" in your text. It only works in Vim because you're in normal mode.
> Vim http://vim.org: Vim provides a plugin system for adding features to it as it is very minimal and only provides basic text editing functionality by default. [...] a “modal” text editor, having special modes for editing text. Ox is easier to use than Vim because it doesn’t have modes [...] however it takes the idea of being a keyboard-only editor and being able to act just like an IDE after some configuration.
Interesting, mentions vim first in list of taking features from popular editors, and explicitly doesn't take the one feature that everyone takes (when they take any)!
I think most editors on mainstream Linux distros and also Windows use Ctrl + Home/End for to go to the top/bottom of a document.
I'm used to the shortcuts, the syntax highlighting works, and you can run shell scripts on selected text which is the best "plugin system" if you ask me.
I've tried to switch to vim and emacs a few times but they are too big an ecosystem and I don't want to change EVERYTHING at once.
The vagueness of this statement is great.
http://kakoune.org/ (very interesting concept about "turning the modal editing of vim around)
and https://github.com/fox0430/moe (written in nim)
Normally they are fine, but add the indexers and code parsers then everyone is bloated. On my emacs + lsp, lsp is the one using a lot of cpu/memory resources.
> Emacs is still actively used today ... I would change much of the Readme.
Writing text editor seems to be the second favorite hackers past time activities after perhaps writing a compiler for APL and Rob did it too :-)
Anyway, congrats to the Ox editor authors for having a go, and personally I like and commended the fact that on the project Github page they provide the comparison to the other popular text editors.
Since Ox is both front-end and back-end implementation based on Rust based libraries, it does shows that Rust based eco-system has been growing steadily.
I have two features suggestions that perhaps can take Ox editor to the next level and be more useful.
Firstly, as mentioned by the sibling comment's buried towards the end of comment section, on the very large file (VLF) feature for opening big file. This can be implemented by the help of RRB-Tree data structure and the Rust library is already available [2].
Secondly, is the CRDT feature that can be implemented with the automerge library. It seems Rust based automerge library is still in its infancy but perhaps by more project adoption, it can further accelerate the development [3].This second feature is very useful for local-first text editing capability enabling both offline and online collaboration feature that can propel Ox to stand out from the crowd.
[1]https://news.ycombinator.com/item?id=20607261
What I can't see here is any mention of VLF mode (get via elpa/melpa) in emacs which allows you to open very large files (per acronym) which are mem mapped.
I just opened a 3.3GB .mpg and it opened immediately. Seems to be editable but it gets verrrry slow (has to page huge amounts and create temp files if you edit) and I've not verified that, but in the rare case I need to browse a multi-GB file, it has worked for me.
Anyone used vlf mode in emacs more extensively, please chime in.
FYI, HTH
* lnav about 4 seconds to index[1] and display
* vim about a second to display
* emacs about 3 seconds to display
This is on a late 2013 27-inch iMac with a 3.5Ghz i7 and the file cached.
[1] - Indexing in lnav involves parsing all log lines to extract their timestamp and log level (status codes in this case)
For performant buffer-wide operations (:g, :%s), I had success with using vim like an improved sed by passing in commands directly via the command line. That was noticeably faster than opening vim up and running the commands before exiting e.g.
# join together lines delimited by LF into one line, then convert all CRLF into LF
vim -Es \
-c 'g/[^^M]$/.,/^M$/join' \
-c ':%s/^M$//g' \
-c 'wq'https://github.com/arximboldi/ewig
Check out the talks from Juan Pedro Bolivar Puente. They are truly next level imo.
"Heavily inspired by Vi/Vim. Amp aims to take the core interaction model of Vim, simplify it, and bundle in the essential features required for a modern text editor. Written in Rust."
It's also a terminal editor btw
class ClassName(object):
def some_method():
def other_method():
class Class2(ClassName):
def more_methods():“How much faster/leaner/more user friendly can I make X when I don’t have to care about safety, performance, or package management?”
Change the colours and appearance of the editor? Took the extensibility and customization of Emacs? Really?!?
I guess if we were to assume this is also true of text editors, Ox is well on its way to great success!
Only for terminal fetish? Or because it is written in Rust?