Tuning Enlightenment
Since my switch to
Enlightenment, I’ve spend a fair amount of
time adjusting it too my needs (and I don’t regret it, configuring
Fluxbox was a much bigger, troublesome task).
One thing that disturbed me was that my favorite terminal emulator
aterm only used the background image of the first desktop for
pseudo-transparency, which is kind of icky if you have four different
backgrounds. :-)
However, it can be solved quite easily by calling :
eesh -e 'hints xroot root'
shortly after Enlightenment starts. aterm (and other apps using
pseudo-transparency that are not Enlightenment specific) will now get
the backgrounds right.
In fact, this eesh, the Enlightenment extended shell is a very
cool tool to “speak” to Enlightenment using simple scripts.
I’m building a Ruby library to abstract the interface of eesh in a
object-oriented way, and I’ve already implemented a sample, IMHO very
useful function, moving windows until they touch some other window.
As a side effect, I also can do stuff like “focus the next window on
the left-hand side of the current one” now. Something I always wanted.
The code still needs a bit of polishing and there is a small bug to be
fixed, but will it follow.
NP: Bob Dylan—Desolation Row
Say you want a revolution...
I’ve come to the conclusion that the only thing that will help
Microsoft staying a “successful” company for the next, say ten, years
is a new—radically new—operating system. XP was not enough to stop
the inertia coming for all the years of DOS, Windows 3.11, 95, 98 and
ME. Neither will be Longhorn, as I can see it.
Microsoft needs a revolution. WordNet defines this word as: a
drastic and far-reaching change in ways of thinking and behaving
;
and that’s the way I see it. (The other definition, the overthrow
of a government by those who are governed
, would be even nicer,
but in this post I’ll try to stay on the technical side.)
In terms of Microsoft, that means dropping backwards compatibility
from the view of the OS.
Longhorn is still able to run Visicalc, and this
is something that doesn’t need to be. If I really wanted to run Visicalc,
I’d use a real emulator like DosBox, anyway.
Note that I say “from the view of the OS”. They should do it like
Apple. Mac OS X is still able to run applications written for Mac OS
9 and sooner, but they will run in an emulated mode, which is clearly
separated from the rest of the operating system.
Once they have thrown all the old mess away, they need to fulfill these
6 points:
Drop drive letters
This is a step that should have happened shortly after DOS got
directory support, which would be version 3, IIRC.
Drive letters have absolutely no useful purpose anymore, instead,
future versions of Windows should have a file system with a single root,
where external disks and devices are being mounted on.
This includes weird devices like PRN: and NUL:. These are, nearly
20 years after their introduction, still responsible for a lot of bugs
and crashes, not at least of IE.
It would be that easy: I simply drop my document on
/Devices/Printers/LaserJet, and voila, it’s getting printed.
Drop file extensions
Same case here, this can be done a lot better: Every application may
include a entry for a file(1) like program that maps the file itself
onto a MIME type. This MIME type gets mapped to matching programs then.
Also, for security reasons, only programs and scrips with
an executable flag set should be possible to run. It should be fairly
easy to enable that flag, but mail programs and other open gates for
virii and worms shouldn’t set it on their own.
Drop .exe-Installers
Instead, get a real package management system, like for example
Debian’s apt which can handle dependencies and ensure clean
removal of packages.
Alternatively, provide Mac OS like disk images, which include all
files the application needs in a single file, ready to be
“installed” by drag and drop.
Drop the registry
Going the step to program specific configuration files is a trend I
see on lots of applications today. Therefore, remove this mess.
(Possibly provide a backwards-compatible API to access configuration
files using registry like structures.)
Drop CR/LF
This was one of the biggest mistakes ever, so repeat after me:
A file is essentially a string of bytes.
A file is essentially a string of bytes. This means
it will be the same no matter how it’s read.
The conversion from single-byte newlines to CR/LF has been a source
of endless confusion to programmers coming from a non-DOS
background. Drop it, no-one needs it anymore (or so to say,
… needed it ever).
Drop the bloat
Longhorn is expected to take 1 Terabyte of disk space and 2 Gigabytes
of RAM. I don’t this this needs more words.
Furthermore, it would be nice if they included a nice Unixish
environment. I think a lot of Windows power-users would love to be able
to dump command.com and cmd.exe (although the latter is a lot
better, admittedly) and use a real shell. Inside the estimated 1
Terabyte for Longhorn, there surely should be some space for the unix
utilities, a ported GNU toolchain and a portable language usable for
quick scripting, such as Perl or Ruby.
And this is only the stuff that I count to the operating system. A
lot also applies to their other applications; the Internet Explorer could
badly need a revolution too, for example.
NP: Beatles—Revolution
Fixing Windoze
Today, our internet box running Windoze XP just wouldn’t boot anymore.
Power on. Bootloader. Blank screen. Nothing.
Power on. Bootloader. F8. Safe mode. Blank screen. Nothing.
I was damn pissed off. The box suddenly stopped working. I love
computers when nothing works and you have no idea why. But hey,
Knoppix to the rescue.
After booting, I quickly inspected C:\ using mc, my favourite
filemanager (old, but good). Hmm, nothing special. At least my files
are still there. Wondering.
After some more debugging, I chose to look at all files changed in the
last 24h.
Somehow I felt the need to delete hiberfil.sys, the file where
Windoze stores it’s Hibernation state in. Quickly booted into
the recovery mode (Knoppix can’t write on NTFS), and a quick:
del hiberfil.sys
Rebooting. “Welcome…”. Desktop. Uff.
Seems like someone tried to hibernate the computer, which didn’t seem
to work.
Now the big question: If I try to boot into safe mode, why the hell does Windows try to load the hibernated state?
NP: The Hives—Love In Plaster
Enlightenment
I’ve never been a great fan of
Enlightenment, but there haven’t been lots
of new releases in the past either.
However, today this totally changed: Enlightenment kicks ass. The
new default theme, winter is soo great. I think I’ll switch from
my fluxbox to it. It’s just great.
So far, I didn’t have to touch any configuration file(!), everything
was configurable using the GUI. I’m normally not that kind of guy that
likes that especially (I’m still wondering where exactly the
configuration is saved… ;-)), but remembering the hours I spent to
make fluxbox start my Emacsen and ATerms at the right desktops isn’t
exactly good either.
Sample screenshot:

NP: Brand New Demon—Damn The Beat
Olympic (sh|g)ames
I’m sorry, but I can’t link to the website of this year’s Olympic
Games, because my snail mail to the webmaster didn’t get approved
(yeah, sure…). Only a fascist pig with a read-only mind can get
those ideas.
A bad Nirvana filk dedicated to the olympic games:
Dope me,
Dope me my friend
Dope me,
Dope me again
I’m not the only one…
Hate me,
Do it and do it again.
Waste me,
Dope me my friend.
I’m not the only one…
Yeah, it’s bad. But those games don’t deserve it better.
NP: The Hives—Dead Quote Olympics
The Party
What a party yesterday night… Some notes:
Tequila Gold and grapefruit matches quite well, if no oranges are available.
Trying to speak English all the time when you’re drunk can be pretty funny
(esp. if the people around aren’t that good in English. :-P).
Be sure to assume a reasonable number of guests when buying stuff.
Be sure they will come. ;-)
Don’t try to sleep in a room when people are talking non-stop thru the
whole night.
Playing keyboard at half to 5 o’clock doesn’t help either.
Wax can be removed from tables by making it wet using dishwater and
abrading with a sharp knife.
NP: Josh Ritter—Come and Find Me
Capitalizing
IN GENERAL, IT IS CONSIDERED EXTREMELY UNFRIENDLY TO WRITE LONG SECTIONS
ALL UPCASE.
This is a widely known rule (maybe not among spammers…), and should
be followed by every user that knows the netiquette.
HOWEVER, I think there is nothing wrong with spelling a word upcase
now and then. Look around you; look at books, CD-ROMs, newspapers,
advertisements. Do you see how much text is written upcased?
I think this is quite amusing. Look around when taking a walk in the
city, and count all uppercase-only sentences. Would you have expected
that much?
NP: Deftones—Digital Bath
zxy___
Yesterday, on #ruby-lang (at this time, zxy
had already three instances of himself in this channel) (logs slightly
edited):
* zxy____ (tux-chan@gw-3.selfnet.de) has joined #ruby-lang
<lyle> haha
<zxy____> you will be assimilated
<lyle> zxy____: the role of "person who posts under multiple aliases" is already taken.
* You are now known as zxy_____
<zxy______> flgr_: you will be assimilated
* flgr_ is now known as zxy________
* zxy________ is now known as zxy_______
<zxy_______> i win.
* You are now known as zxy________
<zxy________> haha
<zxy______> vruz: you will be assimilated
<zxy________> tab completion sucks :P
<lypanov> lol
<zxy____> lypanov: resistance is futile
* oGMo is now known as zxy_____
<zxy_____> how silly
<zxy______> lypanov: you will be assimilated
<zxy_______> damn, I can't decide which lines I actually typed now
* lypanov is now known as zxy_____________
<zxy_____________> bler
<zxy_____> nice
<zxy_______> zxy_____________: you're expanding my nick delimiter!
<zxy________> zxy_____________: you always need to overdo, hmm?
* neoneye is now zxy___________________________
<zxy_______> (this totally destroys tabbing)
<zxy_____> this is screwing up my nick hilighting
<zxy_______> and highlighting, too
<zxy________> lool
<zxy_______> there are no individuals, there is only us
<zxy____> we have become One
<zxy________> yuck
<zxy________> :P
* neoneye is now known as zxy___________
<zxy_____> i hope some newbie joins about now and gets utterly confused
<zxy________> hehe
<zxy______> I am zxy______ of Ruby
<zxy_____________> batsman. where are you?
<zxy____> batsman is no more
<zxy_____________> ASSIMILATE HIM
<zxy_______> I think we started something superior to orkut
<zxy______> we shall go to #python now
<zxy___________> END { python }
<zxy_______> okay
<zxy______> LET US GO TO #PYTHON
<zxy________> YA!
<zxy___________> he he
So, we chose to go to
#python:
* Now talking on #python
<-- exarkun has kicked zxy_______ from #python (zxy_______)
* zxy___________ (~neoneye@0x50c4101e.boanxx9.adsl-dhcp.tele.dk) has joined #python
* You have been kicked from #python by exarkun (zxy________)
How unfriendly they are!
<zxy________> exarkun sucks :P
<zxy_______> we lost, damn
<zxy___________> Can't join channel..
<zxy_______> okay, #perl then?
<zxy___________> banned
<zxy______> already?
<zxy________> #perl is unfriendly, no?
<zxy_____________> hope we don't all get klined :P
<zxy______> we will be quicked right away
<zxy_______> they will understand the magic
<zxy________> ok
<zxy______> we just have to keep quiet
* zxy________ is in
Onwards to
#perl!:
* Now talking on #perl
<Limbic_Region> vi - the one true editor to rule them all
* zxy___________ (~neoneye@0x50c4101e.boanxx9.adsl-dhcp.tele.dk) has joined #perl
<zxy_____________> Limbic_Region: GO VI!
<zxy___________> vi vi
<zxy_____________> vi!
<zxy________> emacs :P
* zxy______ (tux-chan@gw-3.selfnet.de) has joined #perl
* zxy____ (tux-chan@gw-3.selfnet.de) has joined #perl
<zxy_____________> perl?
<zxy_______> /Emacs|Notepad/
<zxy________> congrats, #perl. you guys are nice.
<zxy_____________> zxy________: yup :). they win :)
<GXTi> i have to ask
<GXTi> whats with the names?
<zxy_____________> seeing how nice channels are
<zxy________> hehe
<zxy_____________> you guys are nice :)
<zxy______> #python kicked Us right away
<GXTi> but why 6 of you?
<wallshot> lamest nicknames ever
<zxy______> #perl is much nicer
<zxy_____________> we like underscores
<zxy________> GXTi: were different ones :)
<GXTi> i noticed.
<zxy_____________> just like you guys in fact :)
* eric^ is now known as zxy_________
<zxy_______> we are trying to test tabbing in popular irc clients
<zxy_________> woo woo
<zxy____> there was a zxy_ originally
<zxy________> and a __ ;)
<zxy_____________> :)
<zxy___________> it has escalated
<sili> assholes.
<zxy______> but now we are just zxy_________
<Blimey> someone kill those please
<zxy_________> and nuts
<sili> kitchen thrig help :(
<Blimey> it's a eggdrop bot
<adamruck> fucking change your nicks
<zxy_______> I am no eggdrop
<zxy______> we are no Bot
<kitchen> bad nick choice isn't necessarily a kick option
<alcaloide> zxy*: you guys are fucking retarded
<zxy_____________> we aren't
<alcaloide> hheheh
<zxy_________> we work
<zxy_________> also rock
<sili> kitchen :(
<zxy________> ;)
<sili> kitchen how about a +q? :p
<zxy_____________> alcaloide: hey. irssi has kick as highlights :P
<zxy_________> come on
<zxy_________> gimme +o
<zxy________> :P
<zxy_______> Blimey: ask a question, see we're not eliza
<adamruck> ignored
* ChanServ gives channel operator status to Chris62vw
<Blimey> maybe one of u isn't
<zxy____> Blimey: then I'm the first eliza to pass the Turing test
<GXTi> okay, you've worn out your welcome... pick decent names
<zxy_________> aww
<sili> why does chris have opness
* zxy___________ is now known as neoneye
* zxy_______ is now known as flgr
<zxy_________> baned from #python
<zxy_________> weak
<Chris62vw> so I can kick people
<zxy_____________> sili: power! :)
* You are now known as chris2
<sili> no fair.
* zxy_____________ is now known as lypanov
<neoneye> sorry
* zxy______ is now known as batsman
<chris2> dito ;)
<lypanov> hey you guys rock though!
<sili> Chris62vw be the merciless tryant you are and do your worst
<lypanov> python sucks!
<GXTi> better
* Chris62vw removes channel operator status from Chris62vw
* zxy____ is now known as aniki
What a fun…
NP: Pearl Jam—Immortality
Flipping my LSB
Today, my age is flipping it’s least significant bit (yeah, I’m a
little-endian-head).
For reference, “getting older” in several languages I know:
Ruby:
self.age += 1
Perl:
$self->age++;
C:
age++;
C++ (*g*):
++age;
sh:
AGE=`expr $AGE+1`
bash:
$((AGE++))
Common Lisp:
(incf age)
Scheme:
(set! age (+ 1 age))
dc:
lA1+sA
Forth:
1 age +!
Brainfuck:
+
Smalltalk:
age ← age + 1.
BlueMoon:
set :age + age 1
Intercal (assuming the age is in register .1), untested:
.2 <- #1
PLEASE DO (1000) NEXT
.1 <- .3
… I’m running out of languages.
To the non-geeks: It’s my birthday today!
NP: Beethoven—Freude schöner Götterfunken
pho2 again
I’ve put up a working version of pho2, so
far tested with Mozilla, Firebird and various text browsers including
w3m, lynx and links. It works in dillo too, and other low-level
graphical browsers.
Of course, it doesn’t run on MSIE! But I’m not going to fix that,
send patches if you want.
NP: Alice Cooper—Poison
Pho2
I’m trying to write a photo gallery page that doesn’t suck and is
accessible.
It works pretty good so far, some stuff is still missing, more on that
soon.
Sample Screenshot:

NP: Bad Religion—Sorrow
Slate
The programming language Slate was recently
released in it’s version 0.3.
Slate is mainly influenced by Self, BETA, Joy, Forth and Lisp. It is
quite unique though: It’s the first language to implement Prototypes
with Multiple Dispatch (PMD). In fact, one of it’s authors—Lee
Salzman— even wrote a thesis on it (available on the Slate homepage).
One interesting thing about it is the way it’s implemented. While
versions before 0.3 had Common Lisp code attached to get it
running, version 0.3 is self-hosting using mobius, a VM implemented
in Slate itself by translating Slate to C. The VM is still quite slow
(the Lisp versions weren’t fast, either), but it looks really
promising; after all, the whole this is written in itself, except
for some really tiny pieces of C to interface with Unix.). Very cool
Now, a tiny snippet of an example program to show how it looks like:
g@(LifeGame traits) init
"Load up #cells to be randomized."
[
g cells doWithIndex: [| :each :index |
g cells at: index put: 0].
g cells size / 4 timesRepeat: [
g cells at: (g random: g cells size) put: 1
].
g
].
Very Smalltalk-like (not to say Selfish :-P), but once you get a bit
used to it, it’s very easy to read.
It comes with some elisp for Emacs support, so let the hacking begin!
NP: Bob Dylan—When the Ship Comes In
Rechtschreibanarchie?
Die Diskussion um die Rechtschreibreform ist lächerlich. Dabei könnte
das Problem so leicht gelöst werden, würde man die ganze
Schwarz-Weiß-Malerei vernachlässigen und sich um die Lösung des wahren
Problems kümmern.
Fakt ist: Einige der neuen Schreibungen sind einfach zum Kotzen. Bei
Worten wie “Delfin”, “platzieren” oder “Ketschup” kommt’s mir einfach
hoch.
Trotzdem sind einige Aspekte sinnvoll, zum Beispiel die ss/ß-Regelung.
“dass” ist doch einfach schöner als “daß”, oder?
Die Lösung des Problems ist ganz einfach: Die “Übergangszeit” wird
einfach ins Unendliche verlängert. “Alte” und neue Rechtschreibung
bleibt weiterhin gültig. In den Schulen wird allerdings nur die neue
gelehrt, die alte aber weiterhin toleriert und nicht als Fehler
gerechnet.
Die Entscheidung, wie man schreibt bleibt sowieso jedem selbst
überlassen. Es ist auch nicht so, dass man sich auswählen kann, in
welcher Rechtschreibung man liest. Entweder man liest den
jeweiligen Text so wie er ist, oder eben nicht. Ganz einfach. Lest
halt keinen Spiegel mehr, wenn ihr nicht wollt. Schmeißt die alten
Schulbücher raus, ignoriert deutsche Literatur seit 1901.
Sinn der Rechtschreibung ist, dass sich unterschiedliche
Menschen schriftlich mitteilen können, ohne sich misszuverstehen. Ob
man jetzt “Radfahren” oder “Rad fahren” schreibt, ob “17jährig” oder
“17-jährig”, ist doch vollkommen egal, oder?
NP: Die toten Hosen—Die zehn Gebote
Nukumi 0.5 released
After a long time without releases, I release Nukumi 0.5 today.
New features since the last release include:
- New Formatters
- External Formatters
- Fixed URLs
- Hiding pages
- Multiple keys
- Support for Categories
- Support for Actions
- Emacs support
- Improved feeds
See the README for more information.
Download: nukumi-0.5-patch-57.tar.gz
NP: Neil Young & Pearl Jam—I Shall Be Released
While the GC gently sweeps
A filk on “While My Guitar Gently Weeps”, by the Beatles:
I look at the term and I see the prog’s sleeping
While the GC gently sweeps
I look at the code and I see it needs cleaning
Still the GC gently sweeps
I don’t know why nobody told you
how to GC incrementally
I don’t know how someone could code you
they bought and sold you
I look at the box and I notice it’s beeping
While the GC gently sweeps
With every mistake we must surely be learning
Still the GC gently sweeps
I don’t know how you did get coded
you were very twisted too
I don’t know how you were invented
no one ever tested you
I look at your code and can see the bugs sleeping
While the GC gently sweeps
I look at your code
Still the GC gently sweeps
While getting the idea for the filk, I was thinking of a Lisp program,
but during writing it turned out to be a Java one… :-P
NP: George Harrison & Friends—While My Guitar Gently Weeps
Nukumi as a CMS
Using a small plugin, I have been able to make Nukumi generate static
pages with a fixed URL. This can be used to empower a whole site
using Nukumi, even the parts that don’t relate to the blog.
Therefore, I’ve also moved the more useful parts of my personal
page to Nukumi.
There is now a intro page at http://www.kronavita.de/chris to
provide a menu for accessing the subpages.
NP: Johnny Cash—25 Minutes to Go
RubyPants
RubyPants
is a Ruby port of the smart-quotes library SmartyPants.
The original
SmartyPants is a
free web publishing plug-in for Movable Type, Blosxom, and BBEdit that
easily translates plain ASCII punctuation characters into “smart”
typographic punctuation HTML entities.
RubyPants is a general-purpose library that uses an API compatible to
Red- and BlueCloth to perform these punctuation translations.
Getting it
You can download RubyPants at
http://chneukirchen.org/releases/rubypants-0.2.0.tar.gz.
RubyPants 0.2 is also available via RPA:
rpa install rubypants
There is a gem now available too.
History
- 13 November 2004: First public release 0.2
- 3 November 2004: First half-public version 0.1
rand.rb
rand.rb
is a library for picking random elements and shuffling.
Overview
rand.rb adds new methods to Enumerable, Array, and Hash to:
return a random element (pick, pick_index, pick_key,
pick_value and their destructive versions suffixed with !).
arrange elements in new, random order (shuffle,
shuffle_hash_pairs, shuffle_hash).
use above methods in convenient ways (each_random, map_random).
It also provides these new facilities to String:
shuffle_chars, to arrange the characters of the string in new order.
pick_byte, pick_char and pick_index, to return random bytes,
characters or elements.
History
November 26, 2004: Initial version done as IRC collaboration project
between kig and chris2.
November 29, 2004: First release 0.9.
December 15, 2004: 0.9 officially announced.
Getting it
You can download rand.rb at
http://chneukirchen.org/releases/rand-0.9.0.tar.gz.
Upstream source
You can get latest development releases using
darcs by executing:
darcs get http://chneukirchen.org/repos/rand
darcs send is the preferred way to send patches, but mailing diffs
is fine too.
Authors
Please mail bugs, feature requests or patches to the mail addresses
above or use IRC to contact the
developers.
Copyright
Copyright © 2004 Ilmari Heikkinen
Parts Copyright © 2004 Christian Neukirchen
This work is licensed under the same terms as Ruby itself.
Slider
slider is a cool application launch bar, which is extremely
configurable in its look.
Note: slider needs Ruby 1.8+ and ruby-gtk2 (I use
0.60.0).
The current default slider theme, dubbed
blue, looks like this, if its open:

An alternate slider theme, dubbed
brushed, looks like this, if its open:

Since version 0.4, slider also can be used vertically:

That’s the way blue looks if its closed:

Get it! Download: slider-0.4.tar.gz
Contact
Snail mail:
Christian Neukirchen
Hindenburgstr. 5
88400 Biberach
GERMANY
Electronic mail (in preferred order):
The information at http://purl.org/net/chneukirchen is supposed to
be the ultimative reference on contacting me. Please visit this.
About
This is the personal page of Christian Neukirchen.
You can find various things I wrote here.
Here’s also the
Texinfo version of “Free as in Freedom” for download. I converted it
in 2002.
Projects
(This list is probably always horribly outdated…)
Current projects include:
Nukumi2: Next-generation blogging system.
See the
“Nukumi2 Roadmap”
for details.
rlml.rb: A Ruby parser for the
Real Life Markup Language (RLML).
RubyPants,
a Ruby port of the smart-quotes library
SmartyPants.
mee: Experimenting on next-generation networked applications.
dana: A simple ACID object oriented database for Ruby.
In development.
bungee: A lightweight object-publishing framework.
Bluemoon: A very flexible and
dynamic, concatenative, stack-oriented programming language. Still
in design, for now.
nyx: A decentral communication system. Will probably stay in the
“Just in my mind”-queue forever. :-)
Past projects:
Nukumi: A static blogging system used to
empower this site.
tEXPR: A general purpose data transmission and storage format.
There is a Specification and some
Ruby code.
slider: A cool application launch bar
written in Ruby and GTK+2.
df_zeitung: Magazine for my trip.
Finished. (The PDF is too big to get uploaded.)
texifaif: Converting Free as in
Freedom to Texinfo.
Texifaif
What is Texifaif?
Texifaif is the Texinfo (the GNU Documentation Format) version
of the book "Free as in Freedom".
"Free as in Freedom" is a biography of Richard
M. Stallman
written by Sam Williams.
"Free as in Freedom" is licensed under the terms of the GNU Free
Documentation License.
You can read a online version of FAIF at http://www.faifzilla.org, but
there is no download version, so I decided to make one myself.
I converted the whole book from HTML into Texinfo. This has some advantages:
Get Texifaif
You can get texifaif in these formats:
You can get also get a Makefile
for the Texinfo file.
Happy Reading!
For your Amusement
For your amusement:
NP: Pearl Jam—Crown on Thorns
Bluemoon
This is a proposal for a new programming language.
Serious warning: Reading this post may rot your brain in severe
ways. I find myself—being the designer of this language—having
serious trouble writing stack oriented code in languages like Forth
or PostScript. But feel free to go ahead if you don’t care for these
languages…
This new language, dubbed Bluemoon, aims for high goals: It should be
as powerful as Lisp (the goddess of all languages :-)) without it’s
problems, for example the—to the eyes of many—quirky syntax.
s-expressions were made to be read by computers, not to be written by
humans. (At the same time, Bluemoon also drops list processing from
the absolute core.)
A Bluemoon program has—as a Lisp one—just about no syntax. It is
a list of tokens, with only a few are special (comparable to Common
Lisp reader macros).
To show a non-trivial example, let’s write the classical example used
for closures, a counter:
def :counter {
def :count 0
{ set :count dup + 1 count }
}
def :a counter
print a # => 1
print a # => 2
print a # => 3
This Bluemoon program would look like that in Ruby:
def counter
count = 0
lambda { count += 1 }
end
a = counter
p a.call # => 1
p a.call # => 2
p a.call # => 3
Or in Scheme:
(define (counter)
(let ((count 0))
(lambda ()
(set! count (+ count 1))
count)))
(let ((a (counter)))
(display (a))
(display (a))
(display (a)))
Let’s examine the example above a bit more. Bluemoon is a fully
object-oriented language (the exact semantics of it’s
object-orientation are not fully specfied, however). Therefore, def
is not a special directive or a special form, but just a method
defined for symbols. Symbol#def therefore “takes one argument” (more
on that below) and binds the block given to its symbol, in this case
creating a toplevel definition.
Symbol#def is not specfic to blocks, as you can see in the second
line, it’s very much like Scheme’s define. It creates a lexical
variable, which can be “overwritten” using Symbol#set.
One thing I didn’t tell so far: Bluemoon is stack oriented. And now
we get to the syntax quirk I’ve warned you before.
This is an idea inspired from APL. In general, stack based languages
like PostScript and Forth are read left-to-right. This leads to postfix code.
For example, in Forth:
2 2 + . # => 4
In Scheme, which is infix, this program would look like:
(display (+ 2 2)) # => 4
And therefore, in Bluemoon (infix too):
print + 2 2
This is due a nice parsing hack: In Bluemoon, “lines” are read
from right-to-left, as in APL. This makes the language IMHO a lot
easier to read, and is less confusing to people coming from other
languages. (But can drive you nuts if you need to write
PostScript or Forth.)
This is how the parser will read the counter code:
- Push a Block
- Push a Symbol
- Look up
def
- Call
Symbol#def
This is it, the language of Bluemoon is more or less defined.
Now, there is quite a problem: There is no implementation by now. :-)
I think I’ll write a simple interpreter in the next weeks, but a lot
more will need to be done to make the language usable:
- define a standard library (Ruby’s will be a great inspiration source to me)
- define the object-oriented semantics (this will take some experimentation)
- a compiler?
Not to speak of a community and loads of libraries… ;-) But let’s
have everything in sequence.
NP: Black Monday—Fixated
Sarah Kuttner: Die Show
Sarah Kuttner hat nun eine eigene “Talk”-show, immer um 21 Uhr auf
Viva.
Gestern kam die erste Folge, ein paar Gedanken dazu:
Man zündet eine Pfeife nicht mit einem Feuerzeug an,
in dem man die Pfeife auf den Kopf dreht.
Ein Abischnitt von 3.3 ist jetzt auch nicht soo schlecht (gell,
Sven… :-))
Der Kioskcheck ist geil. “Zwillinge, das Magazin für
Mehrlingseltern” eher nicht.
Feuerstein nicht an die Waden fassen.
Die Pulsgeschichte war lustig. Bei Feuerstein konnte man genau
sehen, wie die Frequenz stieg, als er das Gerät anhatte.
Feuersteins Frau schaut also MTV (der Brüller überhaupt…)
Besonders genial: Die letzten paar Sekunden, “Sarah haut auf die Kacke.”
Man wird sehen, wie sich die Sendung ohne Gäste wie Herbert Feuerstein
und Wir sind Helden entwickelt…
NP: Pearl Jam—25 Minutes To Go
Return
I’m back from Munich, having now
got Paul Graham, “Hackers & Painters”: The—by now—well-known book
by the author of “On Lisp” on “Big ideas from the computer age”.
I haven’t yet finished reading it, but a post commenting it will follow.
got Pearl Jam, Beneroya Hall, October 22nd 2003”: A great “official
bootleg” taken during an amazing benefit concert for
YouthCare—acoustic only.
met Sebastian Vollnhals in Real Life (yeah,
it really exists! ;-)). We had a nice chat on—among other
things—confusing a PDP-11 with a coffee machine, wiring a coffee
machine to a LAN and the social engineering of car freaks… it was a
nice time.
NP: Pearl Jam—Of The Girl