Stupid ideas part 469: line editor

Interesting quote in this article about Unix history:

By the way, ‘em’ stands for ‘editor for mortals’ – I christened it that after Ken Thompson visited our lab at QMC while I was developing it and said something like: “yeah, I’ve seen editors like that, but I don’t feel a need for them, I don’t want to see the state of the file when I’m editing”.

So I was wondering… would a line editor still be feasible today? The obvious answer is “no”, of course. Nobody uses them anymore, as far as I can tell (at least not interactively)… as a matter of fact, quite a few people seem to think that even an editor isn’t good enough to edit code anymore, they want IDEs (whatever that means — it seems to depend on the speaker).

However, I have a tendency to look for non-obvious answers. :-) Question is, why did Ken Thompson say this? Notice that this quote is from around 1975, when line editors were pretty much the default (or so I understand; I was only 2 years old at the time :-). I assume that Ken has moved on since then. Nevertheless, one can wonder, did he say that simply because he was used to line editors and didn’t see the need for anything “fancier”; or is it because line editors have certain qualities not found in other editors?

I have never really used line editors myself. In 1991 my first PC came with edlin, which seemed prehistorical even then. Heck, the C64 had a more powerful environment to code in! But I have often wondered what it would be like to use them. Because of all their restrictions, they force you to focus on only the text (or code) you are interested in. This would make for a very different editing experience than jumping through the whole documents using cursor and PgUp/PgDn/Home/End and friends.

Many questions arise:

  • Would modern-day users be able to get used to it? (I have power users and hackers in mind here, people who regularly use a command line of some sort.)
  • How would you get around the document (efficiently)?
  • How would you copy & paste?
  • How would you delete or replace stuff and be confident that it didn’t overwrite the wrong thing?
  • Would it be possible to add modern features like code completion, svn integration, etc, and what would it look like?
  • What would be the macro/automation capabilities of such an editor? (Probably quite powerful)

Maybe this would make for an interesting (although not necessarily practical) side project. I’m especially interested in finding out what it “feels” like to use such an editor, if it’s still usable nowadays, if it has benefits of any kind over regular editors, and if/how modern features can be added to it.

:: Comments (5)

Random thought

If I finish my Scheme interpreter (written in Python), and it comes out halfway decent, it would technically be possible to use Google App Engine with Scheme…

*ponders*

:: Comments off

Stupid ideas part 79: Asus 64

My esteemed coworker Justin pointed me to this device: the Asus Eee. “They even have it in your favorite color”, he claimed; which isn’t true, since it’s not yellow. :-) Not that it matters so much if you’re colorblind

But anyway. The stupid idea is:

  • install C64 emulator on it (it runs Linux, so it should be possible to run e.g. Vice)
  • install oodles of C64 games on it (can be found online at various places)
  • um, that’s it. You now have a portable C64. ^_^

Supposedly this can be done with the PSP as well, and it even has an analog stick that could be used to emulate a joystick, but I never managed to get it to work. :-(

(I mention this because my “Commodore Project” is stalled at the moment. Over time, I collected a C64, a Plus/4, a 1541-II, two Quickshot joysticks, 5 1/4″ floppy disks, and a XE1541 cable to transfer files from PC to C64. That last part never worked. Then my Windows box died. 1) So I’m disgruntled and looking for a better way to play all those old games. (Other than using an emulator on OS X, an area in which the Mac isn’t a very strong player, by the way.))

Someday I should really blog about things that actually do work. :-/

1) Hopefully the two events were unrelated.

:: Comments off

Stupid ideas part 78: Ebayes

Ebay search results are often unrefined. I know, there’s a whole slew of settings that you can use… most of which are uneffective.

Let’s say I am looking for a PowerMac G4 Cube. The actual machine, *not* memory for it, or a power supply, or peripherals, or software for it. The search “powermac g4 cube” does not work well here, because it does include all the above. Queries like “mac g4 cube”, “powermac g4 cube machine”, etc, yield similar results. Narrowing things down by selecting the category “Apple, Macintosh computers” hardly has any effect either. 1)

This problem is not easily solved. Selecting “Search title and description” returns even more bogus results. As we already saw, categories are useless (most likely because people lump their items in whatever old section to increase exposure). Yet, I don’t like to have to wade through hundreds of items just to find a few that actually match the criteria I had in mind.

Sooo… I was wondering… maybe some sort of Bayesian filter would help here? You get a bunch of items and group them… this would match my criteria, this does not. It probably wouldn’t be so useful if you are looking for a certain item but don’t intend to search for it again once found and acquired. It might work better if you’re, say, a collector, and are regularly looking for certain items (e.g. zoids, although those results tend to be more accurate).

What I would need is

  • a query
  • a script that crawls the eBay site periodically, using that query
  • simple user interface that lets the user filter the results (and, after the initial training, makes educated guesses)

Of course, eBay doesn’t like spiders crawling their site. Alternatively, one could set up an RSS feed and use that as input.

Thoughts welcome… :-)

1) If there is some secret eBay-search-fu that I am not aware of, and that does give the correct results, narrowed down, then I’d like to hear more about it. :-)

Update 2008-03-03: It appears that eBay’s developer program has been free since November. I recall it being virtually unusable before, but I will take another look at it, and see what I can do with it.

Update 2008-03-04: I’m currently doing some research in order to write some Chicken code that uses the API. (Talking to HTTP, and generating HTML and XML, seems easy enough. I am now trying to figure out which XML parser is the best.)

Update 2008-03-18: I have since written some proof-of-concept code, which produces SXML, but I’m kind of at a loss what to do next. Leaving the (simple) code as it is, is pretty lame, as a seasoned Schemer can easily write this themselves. On the other hand, second-guessing what the user would want to do with the XML doesn’t sound like a good idea either. (The hard part was actually, signing up for the eBay developer program in all the right places, and getting all the right keys and IDs.)

:: Comments (3)

Civ

Saw this preview of Civilization Revolution for Nintendo DS today. I’m most likely going to get it, as I’ve been playing Civ in various incarnations since 1992 or so.

I am wondering though, did anyone ever make an ASCII art version of Civ? E.g. something with the same rules, but ASCII graphics, kind of like Nethack. It would seem like a natural fit, with its grid-based map and turn-based movement. It’s by no means a *trivial* task of course, even without the graphics, but it seems doable.

(It would be an interesting project to do in Chicken, if I had a year to spare, or something… :-)

:: Comments off

Interlude: Scheme command-line tool idea

While I’m preparing a long Python-vs-Scheme post, here’s a bit of filler. :-)

Check this. No, not the part about Common Lisp; what I’m interested in right now, is the snippet of Awk code, and the question whether a similar tool can be written in Scheme.

To put it more precisely, would it be possible to have a command-line tool, using Scheme as its language (and probably written in Scheme as well), that lets users write one-line queries like that?

It would be a cool thing to have, although I’m not sure if nested parentheses mix so well with the command line. Writing Scheme code in an editor is different from writing it at a shell prompt.

The Awk example could look something like this:

<name> '(begin (set-fs! ":")) (if (equal? $6 "/sbin/nologin") (print $1))' /etc/passwd

(It would have to use some reader manipulation to allow for expressions like $6 meaning (field 6), or something like that. Chicken already uses the $, so maybe a different syntax would be preferable.)

In any case, I am pondering this. The idea is to have a tool that is powerful, relatively easy to use, and still Scheme-y. Of course, the world probably doesn’t need a new Awk, but I am exploring this idea as a coding/design exercise.

:: Comments (2)