6 ms·
Hired: A Modern Take on 'Ed'
- gmfawcett 3y agoSo sidju says to themselves, hey, let's add syntax highlighting to ed. Kids, this is how you break the eternal seals on the hellmouth, and is also why we can't have nice things.
- sidju 3y agoThe greatest crime is adding a `help` command and printing errors by default. Fools who stumble into `ed` unprepared should find no solace, it is a crime against the world itself to offer them aid and escape.
- gmfawcett 3y agoSo say we all. (And in case there were any doubts, I applaud your hellmouth seal-breaking invention. Scratch those itches, eternity will take care of itself!)
- avgcorrection 3y agoThat’s the same as bat:[1] one of the features is syntax highlighting. Kind of unexpected to find a concatenation program… which also does that. [1] https://github.com/sharkdp/bat https://github.com/sharkdp/bat
- sidju 3y agoYou wouldn't believe how often I run `bat` to quickly read some source code. It is nearly constantly open on my computer. It is just so easy to run, easy to use, can open multiple files and is so readable. Why would I open an editor when I'm already in a terminal and it's right there?
- avgcorrection 3y agoI believe you. :) That’s I guess what most of us do; quickly look at a single file. Not really concatenating multiple files. So the feature makes perfect pragmatic sense.
- ykonstant 3y agoI wrote a little script for that, and I am surprised now at how often I use it instead of opening an editor: https://drive.google.com/file/d/1l13UdgRJy2XvEzI4bYYFU09MW20oI-8n/view?usp=sharing https://drive.google.com/file/d/1l13UdgRJy2XvEzI4bYYFU09MW20...
- avgcorrection 3y agoI use `cat $(which ...)`. Makes sense to have a dedicated script for it. Cheers
- teeray 3y agoAre there any ed users that can speak to what they like about it? I have written ed scripts, but actually using it as an editor just felt like vim but with fog of war turned on.
- agumonkey 3y agoI like fog of war, it keeps me sharp
- Ferret7446 3y agoIt works in dumb terminals. A notable side effect is that it lets you see previous terminal output so you can reference it while you're editing, and use Ctrl-Z and fg to swap back and forth. (Although usually I prefer to run my shells in Emacs instead)
- PhilipRoman 3y agoI've used it once on an embedded device, which had neither ssh nor telnet. Luckily, it had bash available, so I set up something like this: /bin/bash <> /dev/tcp/... With netcat listening my side. Most things kind of worked (no way to send ctrl-c though) but vi couldn't properly redraw it's screen. So I had to use ed.
- geocar 3y agoI don’t edit files for no reason, so the context of what I am doing is lost when a screen editor takes over the window; ed/ex keeps that on-screen, which keeps quick edits quick. I also like being able to see my changes as I work.
- avgcorrection 3y agoThis could be pretty useful for writing shorter commit messages (even up to a subject + paragraph). Like a more powerful `cat`.
- pram 3y agoWell, it is the standard text editor after all.
- iav 3y agoThis is in Rust? I was expecting Ed to be in C…
- snvzz 3y agoSame. I was hoping for ISO C99, to maybe port to AmigaOS. But it's rusty.
- rob74 3y agoIf you want AmigaOS, maybe you should switch to vim (https://amitopia.com/vim-was-originally-developed-for-the-amiga/ https://amitopia.com/vim-was-originally-developed-for-the-am...)?
- snvzz 3y agoI am well aware of vim. But there's some issues. Vim is heavy, and the Amiga version was abandoned, so it's not been maintained for a long time. What I am looking for is a less shitty, open replacement for AmigaOS's provided 'ed' editor.
- flgstnd 3y agoi thought i like rust, compiling this program was very weird. it took multiple minutes on full CPU load and even after cargo finished there was still a build process using one CPU core on 100% until i killed it.
- sidju 3y agoThat sounds strange. Could you give reproduction instructions? (OS, architecture, rust version) Maybe there's some kind of upstream bug I should report.
- flgstnd 3y agoI used x86_64 GNU/Linux, NixOS, cargo 1.78.0-nightly (ccc84ccec 2024-02-07). When deleting the target directory and running `cargo build`, all the dependency crates build pretty fast. But then the build script takes ages. And somehow runs twice. In the target/debug/build dir are 2 different build-script-build executables, that produce the same outputs (compressed_syntaxes/theme). I thought it might be related to the `cargo:rerun-if-changed` stuff in the build.rs but it's the same with those lines commented out.
- swdunlop 3y agoI was expecting electron in there somewhere.
- tempodox 3y agoCame here to say the same. I was fully expecting the irony of seing the world's smallest (and standard) text editor re-implemented in the most infamous bloat monster. Also, every software ever written is being rewritten in Webshit these days anyway.
- sidju 3y agoIt isn't too late yet, you can be the one to bring The Standard Editor to the Webshit masses! The backing library https://github.com/sidju/add-ed https://github.com/sidju/add-ed could either be run through https://neon-bindings.com/ https://neon-bindings.com/ , or compiled into web assembly for that matter. Should just be a weekend project to create an electron `ed`, and if that isn't sufficiently bloated you can `node install everything`.
- tempodox 3y agoI was going to say that I expected the Webshit version to use different NPM packages for cursor-blink-on, cursor-blink-off, and cursor-blink-toggle (not to mention telemetry and the requirement to create a cloud user account), but it seemed out of context :)
- GuB-42 3y agoI tried compiling it as suggested by the GitHub page. The build folder weighs in at 618MB and it took 5 minutes and 139 packages to compile on a decent 2019 machine. The final executable is 84M (debug, 11MB after stripping) It then takes something like 10MB of RAM for opening an empty file, of which 1MB is on the heap. It is not Electron, but for an "ed" remake, it is definitely a bloat monster. Overall, it is 100 to 1000 times heavier than "ed". EDIT: speaking of bloat, I remember when EMACS was nicknamed "Eight Megabytes And Constantly Swapping" as a joke on how bloated it was. Times have changed...
- adityaathalye 3y agoYou may enjoy Episode 40 of https://lambdaisland.com https://lambdaisland.com, published 1 April 2018. https://www.youtube.com/watch?v=6oPRUzzP9DU https://www.youtube.com/watch?v=6oPRUzzP9DU They demonstrate how to build the The Ultimate Dev Setup for mind-blowing Interactive Clojure Development atop the one true, the right honourable, the standard editor, Edward 'ed(1)'.
- impoppy 3y agoThis person has delusions of reasonable choices.
- sidju 3y agoIs the delusion that they exist, or regarding what is reasonable? I'd like to know what kind of deluded I am.
- impoppy 3y agoYou just don't like modal editing. Switching from emacs to ed due to emacs' slowness is by no means a reasonable choice considering being limited to line-by-line editing. Ed is bare-bones and over time you will realize that you need other things that majority of other editors have, then add multi-line view support, then many other things. Emacs can be faster with native lisp compilation, but if you are adamant you want to go full bare bones, you'd be happy with nano, which has some subset of Emacs keybindings and supports syntax highlighting. If you call vim (let alone neovim) a monstrosity, you could go for vi or helix. Switching from emacs to ed is a dumb choice and rewriting ed from scratch in Rust with syntax highlighting is another dumb choice, when you could fork the thing - your rewrite doesn't even have 100 commits in 2 years, which probably indicates there's not a lot of innovation going on. If you just wanted to rewrite ed in Rust - sure, go ahead, but just say it. My point is the reasons for hired you stated do not sound like reasonable choices at all.
- massysett 3y agoGood grief, there’s no need to be so mean about it, there’s nothing wrong with this person building a simple tool to suit their needs. Linus has his own hacked-up editor and few would call him dumb.
- sidju 3y agoYou seem to misunderstand "freezing up on me" to be about slowness, that was a crash leaving the window open that occurred every so often for me despite a relatively simple emacs setup. My initial frustration resided in the complexity of emacs and vim and the many potential failure points that come from that, wherefore I looked into simpler historical editors and ended up trying out ed. (I considered vi, but decided that ed was a good first step if I went there anyways.) I didn't blindly decide to switch to ed, I tried it out and found its commands to suit my editing methodology, the lack of keybindings to help make it work well on dvorak and the line editing workflow to save me from often manually moving my cursor "long distances". Due to how much I liked the concept I wanted to make improvements. (I have also looked into vi but I don't quite like the cursor focused way of working it entails, and really dislike how it depends on keybindings (at least hjkl).) Regarding why I rewrote it rather than forking the C repo you can look into my other comment that explains what I gained from it. And of course I did it because I wanted to, it's not like I'm getting paid for this. It is well established that commits aren't a great way to judge anything, and innovation is especially hard to judge by any metric. Feel free to look at the usage documentation for add-ed https://docs.rs/add-ed/latest/add_ed/ https://docs.rs/add-ed/latest/add_ed/ if you wish to quickly gather some insight into the design, to base your judgement upon. (btw, some corrections ed arguably is a modal editor with default command mode and an input mode entered by `a` and `i` and left with either ctrl+c or a lone `.` on a line. The hired repo has around 100 commits since it is only the syntax highlighting UI, CLI and config handling; the `ed` runtime implementation is in https://github.com/sidju/add-ed https://github.com/sidju/add-ed with around 200 commits. )
- notso411 3y ago[dead]
- projektfu 3y agoEd made a lot of sense in the days of teletype terminals.
- stevekemp 3y agoI have fond memories of using edlin on MS-DOS 3.x. Similar system, but of course no remote access to the system there.
- projektfu 3y agoAs a kid I thought it was insane, the commodore 64 was easier than the IBM PC/AT, but I see how with a hardcopy, you can have your program or document printed in front of you with line numbers, then you just edit as you need. On a visual terminal it gets hard remembering what's there. I was really relieved they added EDIT to DOS 4.
- agumonkey 3y agoI found myself reading about ed and teco (and qed) the other day, they came from similar contexts/eras and share the same paradigm, but somewhere along the lines they branched out into flamewars :)
- sidju 3y agoIt's extremely interesting to read their nearly recognizable syntax and at the same time nearly completely foreign concepts. In case anyone else wishes to read the qed manual, here is the link I found after a while spent searching: https://wayback.archive-it.org/all/20150203071645/http://cm.bell-labs.com/cm/cs/who/dmr/qedman.pdf https://wayback.archive-it.org/all/20150203071645/http://cm....
- agumonkey 3y agothanks for that link :)
- ramon156 3y agoThis repo is actually a cool real-world example on how to wrap an application. Very neat!
- sidju 3y agoNot sure if there is a misunderstanding here. I'm not using the original ed binary (though I could have and it would probably have been smarter), I wrote my own full implementation as a library to also change some things that annoyed me.