Live data from Hacker News

Build Your Own Text Editor

viewsourcecode.org

111–120 of 164 posts

Re: Build Your Own Text Editor

#111
post #33

I'm curious if anyone here regularly codes in a text editor they wrote themselves? I've often thought of coding one for fun, with no intention to share it, just for the purpose of having a long-term project that evolves along with my skills. I've never made time for it, but I still consider it once in a while.

I wrote one back in 1984-85 that I called QEdit, and have been using and updating it ever since.

Re: Build Your Own Text Editor

#112

Earlier quoted context omitted.

Lua is great for extensions, isn't it? I forked antizez's editor to add Lua support, and posted it here in the past: https://github.com/skx/kilua/ That works well for me, even with the minor omissions, and is well-paired with my console-based mail-client - again scripted by lua: https://github.com/lumail/lumail2/

Yes its great --a super efficient and fast little VM and comfortable syntax and scoping. I realised how great Lua is for separating user-complexity from an applications core as my customisations got more substantial.

Over at howl.io we've been working on another Lua/moonscript based editor. Incidentally it used scintilla as well until we switched to an in-house engine called aullar. The author wrote a blog post about it: https://howl.io/blog/2016/05/26/introducing-aullar.html

Re: Build Your Own Text Editor

#113
post #97

1000 lines of code is considered small. But check this out http://kparc.com/edit.k Under 50 lines for a text editor written in K by the language's author. Way beyond my present understanding, but the promise of very small, powerful code is incredibly attractive.

It is, but the little I've seen of K implies that it's small size comes from a combination of two things: 1) A standard library / set of operators that are a very good fit for the typical domains it works on. 2) Minimizing symbol length. E.g. I translated one example I saw into Ruby, and ended up with something of similar length once I 1) implemented equivalent methods, 2) dispensed with all idioms for how to write R…

> extreme lack in readability.

understatement of the year.

Re: Build Your Own Text Editor

#114

Nice guide, especially the terminal raw mode stuff. I haven't seen much on that before, I really appreciate that this guide goes over that. I've been messing around with a little text editor component myself in golang: https://github.com/briansteffens/tui/blob/master/editbox.go For a SQL editor project: https://github.com/briansteffens/prequel

If you are looking for an interesting project that uses terminal input modes try writing a command line utility that reads in a password correctly. (eg. Masks the password input so it does not appear on screen whilst it is being typed, prevents someone from scrolling up in terminal and copy/pasting the typed password and zeros out the password after use to prevent it being visible in process address space). It is sur…

Yeah, this is still a problem. Trying to write a simple CLI in node and the library I'm using to prompt a user for their credentials only replaces the user's input with asterisks. There is still an open issue for properly masking the password input: https://github.com/SBoudrias/Inquirer.js/issues/177

Re: Build Your Own Text Editor

#115
post #96

Here's one from the 1980s, which I still use and keep up to date: https://github.com/DigitalMars/me and translated to D: https://github.com/DigitalMars/med

Linus Torvalds also has his own version of MicroEmacs: https://git.kernel.org/pub/scm/editors/uemacs/uemacs.git

I wonder if he still uses it?

Re: Build Your Own Text Editor

#116

Reference implementations of medium sized applications are incredibly useful for leveling up as a programmer. While there are many large successful open source applications, many are overwhelming to read and learn from. Having something that outlines the key features and components and which ignores the important but complicated edge cases assists in keeping the attention focused. Now if there are annotation within t…

Do you know a good example which implements a GUI, e.g. a drawing program or a graphical editor?

You could check out http://www.catch22.net/tuts/neatpad

It is Windows specific but very informative.

Re: Build Your Own Text Editor

#117

Earlier quoted context omitted.

Yes its great --a super efficient and fast little VM and comfortable syntax and scoping. I realised how great Lua is for separating user-complexity from an applications core as my customisations got more substantial.

Over at howl.io we've been working on another Lua/moonscript based editor. Incidentally it used scintilla as well until we switched to an in-house engine called aullar. The author wrote a blog post about it: https://howl.io/blog/2016/05/26/introducing-aullar.html

I want to get into that when I get time - an editor with LuaJIT - that should be brilliant.

Re: Build Your Own Text Editor

#118
post #62
post #33

I'm curious if anyone here regularly codes in a text editor they wrote themselves? I've often thought of coding one for fun, with no intention to share it, just for the purpose of having a long-term project that evolves along with my skills. I've never made time for it, but I still consider it once in a while.

I do, sort of. I bought a text editor a number of years ago that was very popular. I still maintain it and use it daily and have often thought about putting out a new version. I have it running on many OS's and devices now. I have also added a lot of features specific to what I wanted. I'm not really sure if they are useful to others or not. Example: I have an iPad version where I can use an Apple Pencil and handwrit…

Um... Can I use it too? That sounds amazing.

Re: Build Your Own Text Editor

#119
post #33

I'm curious if anyone here regularly codes in a text editor they wrote themselves? I've often thought of coding one for fun, with no intention to share it, just for the purpose of having a long-term project that evolves along with my skills. I've never made time for it, but I still consider it once in a while.

I wrote one back in 1984-85 that I called QEdit, and have been using and updating it ever since.

I have several former co-workers that wouldn't use anything but QEDIT/TSE.

Re: Build Your Own Text Editor

#120
post #33

I'm curious if anyone here regularly codes in a text editor they wrote themselves? I've often thought of coding one for fun, with no intention to share it, just for the purpose of having a long-term project that evolves along with my skills. I've never made time for it, but I still consider it once in a while.

I used to ~20 years ago. It was a curses-based mini-emacs in C; the fun part was a notebook-style interface to a Forth-like language I added in. Eventually I wanted the same kind of interface for Python programming in Emacs, and moved on to that with https://github.com/darius/halp.
Post reply on HN