Show HN: Phi-editor, a text editor implemented in Go and SDL
A text editor that renders text the hard way... Cool!<p>Talking about editors that do crazy stuff, I have a story about the de-facto text editor in Vietnam in the 80s-90s called BKED. That editor runs on MS-DOS and looks just like edit.com [1], except for it displays and allows the user to input text in Vietnamese. Nothing really quite special at the first glance.<p>The Vietnamese alphabet is Latin-extended, and it needs about 100 or so extra characters (caps included) besides the standard Latin alphabet. Thankfully, the extended ASCII character set (code 128-255) was just barely enough to hold the extended Vietnamese alphabet.<p>Consequently, the obvious way to solve the problem of displaying Vietnamese on DOS was to override and redraw the character set in the VGA-compatible text mode [2]. Its rivaling editor, called VietRES, did just that. With some other TSR hooks [3], VietRES made it possible for any text or TUI program on DOS to display and accept Vietnamese. You might have guessed it, RES stands for RESident. However, it has a drawback that is it messed up the TUI of many programs because it had to override almost all of the extended ASCII characters, most notably table-drawing characters. It was an inevitable problem if you ever want to display Vietnamese characters with just ASCII. The problem carried on to even Windows 3.1 and Windows 95. Our Windows-based Vietnamese support program at that time overwrote the MS Sans Serif and turned every &#x27;®&#x27; in every software install package to an &#x27;â&#x27;. Many other character sets had this problem, for example, in Japanese, the &#x27;\&#x27; was turned into the Yen symbol.<p>Two years ago I thought about BKED and realized that BKED had no problems drawing tables. It could even display bold and italic characters at the same time alongside with regular characters. When I tried to run it on DOSBox, it was clear that BKED did something really clever to get around that. First I thought it might have used the secondary table or something. So I updated my status on Facebook praising whatever the author did. The author of the software -- now an old man -- somehow is a friend of a friend of mine, saw that and chimed in. He said his editor doesn&#x27;t run in textmode. My mind was <i>blown</i>! It is a full-blown graphical program in Hercules&#x2F;CGA&#x2F;EGA&#x2F;VGA graphics and just pretends to be a text-mode program. It draws every single character in its UI. It had to do it very quickly and economically -- computers in Vietnam at the time were all old secondhand ones imported from the US recycle centers and such. Now as I looked at it more, it was no surprise to me it could also do quite sophisticated mathematical formulas [4]. Thanks to its flexibility, the editor was used to typeset the whole suite of national textbooks on every subject in the 90s. The author also wrote another textbook about Turbo Pascal for college students. Indeed that book was the first I read on programming and Pascal was the first language I learned when I was 12. His work and contribution were well paid off -- he is now a very high-ranking official in the National Ministry of Education.<p>The editor was never open-sourced. I just got his email a month ago. If nothing else, I will ask him to release this gem to our future generations to enjoy.<p>1: <a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;RZN50oS.jpg" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;RZN50oS.jpg</a><p>2: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;VGA-compatible_text_mode" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;VGA-compatible_text_mode</a><p>3: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Terminate_and_stay_resident_program" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Terminate_and_stay_resident_pr...</a><p>4: <a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;ofhE0TG.jpg" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;ofhE0TG.jpg</a>