Live data from Hacker News

Fine, I'll build my own text editor

dbushell.com

251–260 of 266 posts

Re: Fine, I'll build my own text editor

#251
post #187

Seems to me that in the short term everybody screams “DO NOT OPTIMIZE THAT CODE”, in the medium term everybody shrugs “buy a new computer”, and in the long term everybody gradually migrates to the solutions that optimized that code. I think the mainstream narrative around performance optimization is simply wrong. Inefficiency isn’t a constant, it’s a percentage. You look at software that’s 10x as fast and say yours w…

In the longer term we regress and start running an entire web browser to run a text editor in javascript

Re: Fine, I'll build my own text editor

#252

Earlier quoted context omitted.

He created Go because he believed that the average Google programmer is too stupid to program in C++, and he didn't like Java, the other language created to address this problem.

When he said the average programmer is too stupid to program in a brilliant language, I don't think he was referring to C++. I think he was referring to non-mainstream languages that require totally different ways of thinking (there are many, and I don't know which ones he had in mind, so I won't list any examples). So he designed Go to be very familiar to average programmers, instead of embracing more powerful ideas…

I'm not sure what he meant by "brilliant language", but he was working in C++ and was frustrated with it when he decided to create Go.

> Back around September 2007, I was doing some minor but central work on an enormous Google C++ program

> I actually tried and failed to find a way to bring the ideas to C++

> Some were very subtle and hard to understand, like rvalue references, while others are especially C++-like, such as variadic templates, and some others are just crazy, like user-defined literals.

https://commandcenter.blogspot.com/2012/06/less-is-exponenti...

Re: Fine, I'll build my own text editor

#253
post #61

Earlier quoted context omitted.

> just a configuration of vim or emacs. So which one?

Whichever you want. There's a million text editors today because people have different approaches. I'm not criticizing having different approaches. I'm criticizing people who start writing their own text editor instead of just building off of established platforms.

You're just avoding the same question - why not build off the established platforM - which one, though? Why not VSCode, which is also an established platform?

Re: Fine, I'll build my own text editor

#254
post #244

Earlier quoted context omitted.

Okay, including comments it's about 1,200 lines https://codeberg.org/tmtvl/open-dotfiles/src/branch/main/ema... >. My user-lisp directory contains Daredevil SKK, Groovy mode, and ICL; those are all available on Microsoft GitHub.

Thanks. I was looking for a way to reduce my startup times because I was envious of Neovim. It doesn't work for me out of the box (I'm on macOS now), but it seems that there is a lot to steal from. ;)

Yeah, the way I set read-process-output-max (by reading /proc/sys/fs/pipe-max-size) is probably GNU/Linux-only. The two main ways to reduce startup times are:

1. Don't load too much at startup, use use-package's :defer keyword where ever it makes sense.

2. Set gc-cons-threshold to a very large value during initialisation and turn it back down again once everything's loaded. That said, most-positive-fixnum is probably overkill and I should look for a way to reliably set it to half of my PC's RAM.

A less important third way to reduce startup times would be to byte compile everything (possibly even the early-init.el, init.el, and custom.el files, although that does mean you need to recompile whenever you change anything), but that doesn't gain you much.

Re: Fine, I'll build my own text editor

#255
post #103

Earlier quoted context omitted.

It's amazing just how many stories of Rob Pike seem to show him being both a dick and wrong

I kinda think this is the story of "Oh someone wrote a screen editor -- that's the 10th time I heard from other people". Like, if you write a text editor nowadays, my thoughts would probably NOT be too different, except that 1) I wouldn't speak out, and 2) I'd congratulate you, for real, because this world doesn't give ordinary people good time.

Yeah, my thought when seeing the title of this post was "everyone should build their own text editor". You can start with a couple of hundred lines of code. Not everyone will be happy using their own editor for very long, but it's surprising how little code you can get away with when it's your own and the (many) bugs left in it at any point are the ones that don't annoy you enough for you to spend time on.

My own is absolutely full of bugs and missing features, and probably a real pain to everyone else (to my knowledge only one other person has actually tried to seriously use it - I mostly discourage other users), but that's okay: It has the features I care about, some of which are entirely useless to everyone else. It started because I realised my Emacs config was big enough that I could write an editor in fewer lines.

Re: Fine, I'll build my own text editor

#256
post #53

Earlier quoted context omitted.

Yes, but... On one otherwise tranquil morning Master Foo's meditations were disturbed by cries of distress. Finding that they came from one of the novices, he inquired "What is the difficulty here?" The novice replied, "I am frustrated by my tools. Every day I must use many different editors because neither Emacs nor vi nor any of these other random editors has all the features I require." Master Foo nodded. "How," h…

Yes, but ... Sometimes there are genuine reasons to build a text editor. It's really hard to build a full WYSIWYG graphics editor without modelling text layout yourself, especially for more advanced work like properly curving the text.

Every coder/developer/programmer/software engineer should write a text editor at least once.

Re: Fine, I'll build my own text editor

#257

Fine, I do this since several decades. I use an editor-construction kit named "Emacs" to build my own Editor, and IDE, and git porcelain, and organizer, and wiki. And many things more. IDE with e.g. LSP integration, rustix and many other programmer-related modes and enhancements like tree-sitter. Git porcelain with magit. Organizer with Org-Mode. Wiki with denote.

The only thing I miss in emacs is concurrency/multi-threading. Apart from that, it's a complete software for me. Anyone can build it to anyone's liking.

Emacs has primitive concurrency (see Chapter 40, Threads in the Elisp manual), and because it's a Lisp, having nice concurrency is just a matter of programming.

Re: Fine, I'll build my own text editor

#258
post #255

Earlier quoted context omitted.

I kinda think this is the story of "Oh someone wrote a screen editor -- that's the 10th time I heard from other people". Like, if you write a text editor nowadays, my thoughts would probably NOT be too different, except that 1) I wouldn't speak out, and 2) I'd congratulate you, for real, because this world doesn't give ordinary people good time.

Yeah, my thought when seeing the title of this post was "everyone should build their own text editor". You can start with a couple of hundred lines of code. Not everyone will be happy using their own editor for very long, but it's surprising how little code you can get away with when it's your own and the (many) bugs left in it at any point are the ones that don't annoy you enough for you to spend time on. My own is…

Yeah, I think it's good to dogfood one's own program. It's just...we are so short of time. We are not the lucky few who could actually pull it off, lol.

Re: Fine, I'll build my own text editor

#259
post #187

Seems to me that in the short term everybody screams “DO NOT OPTIMIZE THAT CODE”, in the medium term everybody shrugs “buy a new computer”, and in the long term everybody gradually migrates to the solutions that optimized that code. I think the mainstream narrative around performance optimization is simply wrong. Inefficiency isn’t a constant, it’s a percentage. You look at software that’s 10x as fast and say yours w…

Casey Muratori has an interesting talk about how that narrative (“premature optimization is the root of all evil”) came to the mainstream narrative

https://youtu.be/hpj6r6CjJf8

Re: Fine, I'll build my own text editor

#260

I literally just got Fable to write me a text editor. Well, I'll be honest, I got it to wrap the KDE KTextEditor library which is like 90% of a text editor. I had been using Kate which was what an LLM suggested was the closest to something like Sublime Text on Fedora. But even Kate, which was great, had too much going on. So I asked Fable to take the text editor part (KTextEditor) and wrap it using Rust with an LSP s…

> We live in wild times. I hope everyone is taking advantage while they can. To do what exactly? Everyone can churn out their own "kinda different but mostly the same" app thing?

Yes, so what? Personalized tools are great.
Post reply on HN