KBD

Keith Devens .com

Saturday, September 6, 2008 Flag waving
Of course, that's just my opinion. I could be wrong. – Dennis Miller

Archive: December 09, 2002

← December 08, 2002December 10, 2002 →

Daily link icon Monday, December 9, 2002

Lord of the Rings: Page to Screen

I'm watching Bravo's Page to Screen: Lord of the Rings (their web developers are dumbasses, so it doesn't work in Mozilla). It's excellent.

Firefly

Via WHEDONesque, You keep flying, we'll keep watching.

My dad's abandoned us

My dad's abandoned us... he's hardly ever home anymore. He spends every weekend now with his girlfriend (eew). We hardly ever have home cooked food anymore... mostly it varies between pizza, chinese, Boston Market, and spaghetti with meat sauce... oh yeah, and cans of soup.

NSIS

Beta 0 of version 2 of the Nullsoft installer, NSIS, is out.

The first beta version of NSIS 2, the new version of the popular win32 installer/uninstaller system is ready. NSIS 2 supports highly customized user interfaces, multiple languages, easy usage of plugins and more. And it's even smaller than before, with an overhead of only 34KB.

I love their tagline: "NSIS tries to be a scriptable win32 installer/uninstaller system that doesn't suck and isn't huge."

Cute kitten!

http://img.ranchoweb.com/images/xsarahcorex/kitty.jpg

Programming Languages History

Via E7L3 (who has some problem with his site being a weblog and therefore offers no permalinks), check out The Evolution of Programming Languages (PDF).

Peter Grogono wrote this excellent text: The Evolution of Programming Languages. It contains lots of details I never read before, for ex., about how the dichotomy between functional and OO languages evolved. Did you know that Smalltalk was created as a crossbreed between LISP and Simula, and that it was first implemented in BASIC?

It seems like a great thing to read after my finals are over and before the next semester starts.

Writing a text editor

I've never been satisfied with any text editor I've ever used. I keep looking for an editor I'd like to use over what I'm using now, and never see anything good enough to switch. I currently use EditPlus, and I do recommend it highly. It's stable, has a good set of features, works well, and has a very reasonable price. However, I have my little knits with it, and I've asked for features for a long time that haven't been implemented.

I've always dreamed of writing my own text editor... one of my complaints has been that I've always wanted to have a program to work on for me to teach myself a bunch of stuff, but I could never think of a program I wanted to write -- except for a text editor. But a text editor is such a huge undertaking. Though, as I've been thinking about it tonight, there are many reasons why I think I'd have a good chance of being able to do it. Text editors have a few features which make them somewhat straightforward to program:

  • They have a good separation between the editor model (the actual text of the file) and the interface of the program.
  • There are many opportunities to use design patterns. In fact, Design Patterns uses the example of a text editor throughout the book as an illustration.
  • To my knowledge they don't involve many "hard" algorithms. Most of the algorithms are straightforward. You need to keep track of lines of text, and then display the text on screen. Of course, add (simple) syntax highlighting, find and replace (including regexes), etc. and it gets a little more complex of course, but still doable. Editing functions don't seem hard... the model has an api and all interactions between the model and interface have to go through that api. It gets harder if you want to open files of arbitrary size (VIM uses a cool disk cache system), but to start I can work all in RAM.
  • There are many open source editors out there for me to look to for inspiration Smiley winking
  • I have a pretty good idea of how I want one to work.
  • There are a few simplifying assumptions I can make.
    • No variable width text (a text editor is much simpler than a word processor (which is hard)
    • I can leave a lot of things out to start, like word wrapping, syntax highlighting, large file support (like VIM has, mentioned above), etc.

Keep in mind that I'm just brainstorming right now. I may decide tomorrow that tonight I was being silly and there's no way I have the time or the experience to write a text editor... so, don't think I'm pretentious, and don't think I'm promising anything Smiley Basically right now I'm procrastinating from studying for an exam I have tomorrow.

Some thoughts:

  • Most likely programmed in C++.
  • Many pieces can be done in a high level way and then replaced with something fast... for instance:
  • I'd want to embed a scripting language like Lua or Ferite (or even ICI), both of which seem very easy to embed. I thought about Python, but it's probably a bit more than I'd want to embed. Lua and Ferite are much more lightweight. Then I can do as much of the program in the high level language as possible and replace it with fast code as I go on.
  • Scintilla and SciTE are great starting points. I may even be able to get away with embedding Scintilla, or using SciTE itself as a basis (assuming their license permits it, I have to look).
  • I'd want to use wxWindows, most likely, as a cross platform gui library.

As you can see, a lot of the hard work (gui libraries, even the text editor component itself, maybe) has been done already. This isn't a "new" area... text editors have been well known forever, there's a lot of literature on the subject, etc. It'll be a great learning opportunity, assuming I actually do this I'd get a great new tool out of it, and there's no better program to eat your own dogfood with, since as soon as it gets usable you can use it to write itself. And I have lots of ideas of stuff I want.

Obviously I've done a lot of handwaving on hard things involved here, but I think I can, I think I can...

More thoughts:

As long as I define really good interfaces, I can probably get up to speed rather quickly and then replace pieces one at a time. For instance, the application code is separate from the text editing component, so if I wrap either Scintilla or whatever text editing component comes with wxWindows within my own API I should be able to have something to start with and use while I program my own. Or I may like Scintilla so much that I just stick with it. So, you have your application model, your program interface (gui), and your text editing component, and each of them is pretty independent. I could even start with the plain wxWindows sample text editing app I'm sure they have, stick Scintilla in there, and go from there. Hmmm...

Also, there are a few reasons I'd like to embed a scripting language. It allows for macros eventually, I can use any of the high level features of the languages, they give me libraries (Lua or Ferite has to have an FTP library I can use to download files over FTP, but even if they don't (actually, I couldn't find much about it in their documentation) there's got to be some open source FTP library I can use, or if all else fails I can wrap operating system applets -- actually, ICI has a sockets library, and I don't know what C++ has built in for network programming. Lots of libraries would be a reason to look at Python for embedding... How well does Ruby embed? -- there you go... ferite has a sockets library too), regular expressions, etc.

Ok, back to studying.

Hey, maybe I should look at Io for embedding (see here). I like prototype based languages.

← December 08, 2002December 10, 2002 →
September 2008
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
282930 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 6 posts

Recent comments XML

new⇒I hate Norton Antivirus

Long long live AVG I love you!...

kevin sands: Sep 6, 7:31pm

new⇒I hate ASP.NET

CF, why pick that piece of trash?​Cold Confusion. Is it finally​really a OO...

ColdConfusion: Sep 5, 8:36pm

Maps of Iraq

This is for Linda, I will be​visiting that site some time in the​near futur...

Bob: Sep 5, 1:20pm

Girls, please don't get breast implants

Well alright I just read my above​comment and I wanted to add​this...I shou...

76.66.140.8: Sep 4, 7:31pm

Spider solitaire

I don't think the question was​necessarily if there are unbeatable​games.  ...

Jared: Sep 4, 12:44pm

Convert Pantone Colors to RGB and Hex - Color Conversion Chart

The colors on those website don't​seem to relate to the pantone data​we hav...

blah: Sep 3, 10:12am

Generated in about 0.057s.

(Used 7 db queries)

mobile phone