Archive for May, 2007

going vertical on filenames

Thursday, May 17th, 2007

There are tricks worth knowing.

Even in textpad the only way to get a DOS filename to have no extension – not to be TXT – is to surround the filename in double quotes. Or save as a unix file. Then there are the protests of Windows Explorer when saving .anyrc files.

Had Windows required a file extension for every file, windoze might have become as marginal as the mac. No offense intended. Windows gave us “cd\” without the mandatory space character of “cd /”

Btw, the double-quote bit is essential if you are ever stuck using Ms Notepad

Now here’s the rub. Another little trick lets you put titles with a CRLF – mutli-line titles of your own choosing – on Windows desktop icons. But not in filenames.

Tangent to my point … Smalltalk folks sometimes get on a high-horse about types. It’s their hobbyhorse. As if the Symbol #-headed string is not as much a static types as you will ever need. And as much a worry if abused to the point of bloating. There is something to be said for software evolving to being typed as a prototype design evolves to a maintainable product. Optional typing is a feature in some powerful multi-paradigm languages.

Filenames are types. They even have evil proxy-types in the form of tilde-mangled 8.3 filenames. And they preclude the letters of my choosing as much as sets preclude dups and INT precludes a FLOAT.

But once is awhile I want a vertical filename

expect
libexpect

expectk

wish
blt

I remember the look which an IBM CUA-91 engineer from Boca gave me when I ventured my thoughts on 3-D widgets.

But if the SOM had survived in OS/3 we would not think twice about my having vertical filenames.

Now here is what an O-O desktop would give me on an O-O OS

That vertical filename would evolve as I reorganize the internal structure of that file on TCL Expect resources and related.

And its type is not ‘text’

Its type is

language

-resources and related

The closest thing that Windows offers, to my limited knowledge, is the virtual folder “My Documents”

But what of quote marks, quotation marks, if you will. This might be a useful type in and of itself.

If you have followed the Chronos project then you know that we have not yet put Date and Time to bed. But consider quotes.

PDF files will catch you with double-quotes-inverted and double-quotes-erect and you may not even notice. But there are languages where the opening quotes are not the ending quotes. I say this, entre-guimets, if you will.

The American-English QWERTY keyboard has its secrets for most American and Canadian users who type filenames. They may know that Microsoft is using tilde in mangled names but they themselves never reach up with the left pinky for the backtick key. These are not deep secrets, such as the left SH-key not being the same as the right SH-key or NUMPAD Enter not being the carriage return.

That the double quote on an electronic keyboard is not the single-quote sent twice may baffle digital archeologists in the year 5010.

The markup people know the answer. Have the keyboard send invisible markup codes with my every keystroke. The smart keyboard will ‘know’ whether I am typing in a text box or

You must be kidding. The keyboard – part of the OS ? Is this that Io mania?

But if the keyboard knew that the type that it was typing was a label on a desktop icon …

Imagination dead. Awful.

That’s for the keyboard which knows you are misquoting. Call it the Googleboard. The silent amanuesis. The foot-slogging pedagogue. We have crawled to the very lip on our brem.

and an IDE for Io again (almost) with Expect Tcl

Thursday, May 17th, 2007

One of my favorite places in L.A. is the JUG, that being the Los Angeles Java User Group.

It was there that I heard an excellent presentation on Ruby Rails by a young guru who never leaves the command line but whose rationale for Ruby and Rails was, well, just more Smalltalk. It was at the LA JUG that I heard all the reasons to stay with Smalltalk and Seaside from a Google hacker who was explaining the virtues of the Instantiations GWT kit. As I mistakenly said then,

I was not ready to gwt my day job

But it seems that the path of least resistance to an IDE for Io is not where I expected: it lies in TCL and the expect language.

But wait: is there an IDE for working with TCL while building this IDE for Io?

Let me back up a few steps … you must not diss the cmd line. The ssh command line is our shibboleth. Even as the CRT becomes the LCD, the CRT remains.

It is not enough to explain that whatever the internet was, it is now not accessed from the command line. It is safe to say that almost all internet activity from users begins with an icon, a link in an e-mail ( or, in my case, a link in a pane in OneNote ). But those are users.

There should be a lesson in Japan where it is not enough to have Chinese kanji, each with its Chinese pronunciation and meaning, they must also dup the whole thing and give each a Nihon pronunciation and meaning. And that is not enough. For a language as easy to pronounce as Italian and as easy to read in Romanji as German, there must be alternative alphabets in hiragana and katakana.

Now there are languages which are difficult: Turkish may be one, being even difficult to learn if you are born to it. But there is a limit. Consider only the alphabets proliferated in Sri Lanka. Enter Tcl. Or should I say,

Expect Tcl

Nothing should be as difficult as it now is to create a process under Windows. I will not bore you with it all now, but if you must have async communication and resource sharing between processes you may want to set aside the Win32 SDK and API. Even in Smalltalk.

Consider the admirable CommandShell project for Squeak Smalltalk. The best of this Tcl-ish business lies in the AttachableFileStream and the piped processes. Alas, those pipes are not for anyone inhaling through open Windows.

There was a time and an OS where I thought named pipes were the answer. And only a few hours ago I was thinking that for my needs, pipes would do. And then I was even driven to consider KERMIT.

and an aside.

Kermit is not gone; it has not croaked its last. While I do not remember when I last used kermit, I may have been mistaken to set it aside: kermit can be used to configure communication, either as C-kermit or G-kermit at die.de.

Because Io, the language, is readily embedded, building an IDE should not be an issue. But the IDE that I want must also serve trans and cecil and perhaps slate at the drop of a hat. Or a zip. Or a tar.

( to be continued )

And Tcl, as you may know, is in an active state. Literally. The Perl and Python people at activestate are also one of the centers for Tcl.

git python

Tuesday, May 15th, 2007

A funny thing happened on the way to the repository …

I had been unable to build the latest compressed Io sources on Win32 CYGWIN ( and so had to go for sources in the Io repository.)

But Io has moved off darcs to Linus Torvald’s git which you can right-click to save link at http://git.or.cz/.

To build git you must first make a configure file. And that will take autoconf.

Off to for that puppy. It built fine.

And now back at my git a

make configure

resulted in autoconf doing a GEN configure.

I was then able to run

./configure –prefix=/usr

for my git.

Here things got antsy. The git folks recommend that you make the docs, but it seems that somehow we have missed the dependency on

asciidoc

That was easily remedied at asciidoc

But here is the catch: asciidoc is going to require CYGWIN python

It is not enough to test your CYGWIN python install by running

python -V

to check the version. I suggest running

/bin/python2.5.exe -c ‘import sys; import time; print sys.path’

In my case the path to ‘lib-dynload’ and the python time module in time.dll just could not be found.

The first thing was to

unset PYTHONHOME

Then an

echo $PYTHONPATH

revealed the need to reset the comma-separated strings of a GNU PYTHONPATH

I used

PYTHONPATH=’/lib/python2.5′,’/lib/python2.5/lib-dynload’,$PYTHONPATH
export PYTHONPATH
/bin/python2.5.exe -c ‘import sys;import time; print sys.path’

Things looked better and now returning to git saw

make doc
make install-doc

run just fine.

And my tips for getting Io, the language, to build from git sources is sure to follow.

line edit history for Io, the language

Monday, May 14th, 2007

Since learning that Io would not play with stdin and stdout redirects in my Emacs or other shell alternatives, it has been so great to get a cmdline history into Io with rlwrap

Some gift in my CYGWIN configuration means that I could not find rlwrap after tar had unpacked the exe.

What is working is

~/usr/bin/rlwrap io.exe

Now the Io cmd line is able to find my last commands with the usual cmd line history keys.

As a ‘readline’ wrapper for languages with minimal frontends, this will be great!

rlwrap can be found at univie

I was unable to raise knoware.nl which may be its usual home.

You will need bzip2.exe to decompress the bz2 file.

Just run

bzip2.exe -d rlwrap-some-version.bz2

then move the rwrap-version.tar to the root of your cygwin install and go into bash to run

tar -xf rlwrap-some-version.bz2

The Emacs shell with Io and Trans

Friday, May 11th, 2007

With my problems getting a decent graphical IDE for OCaml (to match ocamlbrowser) to run in my Cygwin world, I thought that I should try Emacs. This naturally led to my trying to bring up Io and Trans in an Emacs shell.

When neither worked as expected in the Emacs shell, I popped up a new shell for Lua, fine. And then a shell of Cecil (long wait for load) and then also fine. So what gives?

The misbehavior may have to do with how the two new VM languages interact with STDOUT.

If you are not used to Emacs as a shell, just bring up emacs and then META-x for a command line and enter shell (META being an ALT key on your PC keyboard). There is an a trick worth knowing: ALT-! brings up a command line for your shell. To get to your shell you can CTRL-x o or do CTRL-x b *shell* It will probably be useful to CTRL-x 2 so as to split the screen to show 2 buffers. You – even I begin to forget that I loathe, detest and hate Emacs.

There are ways to set Emacs at startup to use a preferred shell, but I have been launching Emacs from various shells to try to eliminate obvious causes of the VM langauages misbehaving in the shell.

What is happening with Trans and Io can be seen by running

ALT-x shell
ALT-! io.exe
CTRL-x b *Shell Command Output*

What you will see is that even though Io appears to just die in the shell, it in fact wrote output to the Shell Command Output buffer.

One idea was to tell Io to write to the present buffer, the shell, instead. This is done by preceding the command with ALT-1 ( such that M-1 appears on the command line .)

But no joy. Another idea was to try to use the mini-buffer by using CTRL-j instead of the numpad ENTER key or the main pad RETURN key.

So what do the experts say?

sez: cs.cmu.edu

A numeric argument, as in `M-1 M-!’, says to insert terminal output
into the current buffer instead of a separate buffer. It puts point
before the output, and sets the mark after the output. For instance,
`M-1 M-! gunzip < foo.gz ‘ would insert the uncompressed
equivalent of `foo.gz’ into the current buffer.

sez: gnu emacs

You may notice that some programs, when run in a shell in shell-mode, have their output buffered (e.g., people have found this happening to them with sql-mode).
When the program has a lot of output, it overflows the buffering and gets printed to the shell buffer; however, if the program only outputs a small amount of text,
it will remain buffered and won’t appear in the shell buffer.

Although it may at first seem like the shell is buffering the output from the program,
it is actually the program that is buffering output.

The C runtime typically decides how to buffer output based upon whether stdout is bound to a handle to a console window or not. If bound to a console window, output is buffered line by line; if bound to a block device, such as a file, output is buffered block by block.

In a shell buffer, stdout is a pipe handle and so is buffered in blocks. If you would like the buffering behavior of your program to behave differently, the program itself is going to have to be changed; you can use setbuf and setvbuf to manipulate the buffering semantics.

Some programs handle this by having an explicit flag to control their buffering behaviour, typically “-i”. Other programs manage to detect that they are running under Emacs, by using getenve(“emacs”) internally.

All this got me back on my quest for a shell for Io and Trans. To my surprise, the best clues on how to proceed for Win32 came from .NET C# gurus.

As anyone who does headlesss images for Smalltalk knows, the character-mode terminal seesion or ‘console’ application is not dead. And will not dies as long as people are piping things in and out of perl and such. Now while my hopes lie with TCL, this articles is a must read or at least a toread for any Win32 developer who has been in GUI-land.

Any language which leaves I/O undefined has to come to terms with data-in and info-out. Call it necessary side-effects of being applied to a real problem. The remarkable short article at the CodeProject provides an example of a simple shell strategy to handle even DOS 16-bit console applications ( dust off your Borland Turbo Prolog and the like.)

The author’s key points are about the oddities of piping console applications. Enjoy.

Another rather good piece is at .Net devsource which also has useful links.

Bring that TCL up on the console, Mr. Spock.
Make it so.

Anvil WebServer and a Finnish mystery

Wednesday, May 9th, 2007

I cannot tell what has become of the Anvil project of Njet.

What I did do was to take a swipe at running their app server on my Win32 box. They offer an MSI install, so that should have been easy.

Before I was able to get a page served up without a 404, I had occasion to check what they had written to the registry ( which was fine ) and to discover that they must have kept some of the key bits in Finnish.

The instructions for server configuration were fine. But not a word on how to test. And no hint that they will be using a mangled URL.

The cause was easy enough to find: although they updated the registry to reflect my chosen install drive, they did not update the server configuration. Rather the same mindset that hard-coded 9090 as their chosen port.

So if you try ANVIL, be sure to grep the ./conf and /WEB-INF directories for files with values set to ‘Program Files’ if you install anywhere but c:\Program Files\Anvil 3.5

And once it is up and running, it looks rather interesting. While I had expected to go to http://localhost:9090/site/examples/index.html, I find myself instead at

http://localhost:9090/$np8uxhg3rm/examples/

And now back to finding out why ncurses will not build on cygwin … since PWIG won’t build either …

Ruby and Gnome2 aka gtk2 and the iconv.dll

Wednesday, May 9th, 2007

My heart went out to the author of a mail list request for suggestions:

“I encountered the current problem I’m having about a year ago and thought I had figured what was wrong but can’t seem to remember how to fix it.”

Naturally after installing Gnome2, the simple ruby

require ‘gtk2′

failed.

I began slowly, conservatively, moving gtk2 site-ruby into my dev ruby tree.

I finally got to the iconv.dll missing entry-point error.

Here is my tip if you find that your ruby/bin already has an iconv.dll

In ruby/bin create a safety dir and move your current iconv.exe and iconv.dll into that backup area.

Now copy from the the gnome2/bin into ruby/bin

You should now get a reassuring true when you require ‘gtk2′

There are good tips on rubyscript2exe elsewhere on the web.

Harrowing

Wednesday, May 9th, 2007

It sometimes seems that fate cannot be ignored.

It may be my fate never to compile a current release of Mercury. Or GNU Smalltalk.

But then there are those things you feel you must do, no matter how many hours of try-this-then-try-that you must endure. In my case, that would be Slate.

In the world of CYGWIN, when you run a ./configure and all ends well with a bright morning feeling for that fresh new makefile … and then the make coughs and chokes … you hunker down — but you have that nagging awareness that you may yet give up.

But in the world of Mingw Msys, if there was no configure to run, you may be left to tinker with a variety of make-related files. This is the case with Slate on my Win XP box.

And I have not emerged unscathed: after the make install completes, my Slate image can be saved and will re-load. But there is a catch. I end in debug mode and I start in debug mode. This does not look too healthy.

Who was a tinker, you may not have asked … what is it to tinker? We do not come to tinker; we come to build. And then to actually make sumpin.

Well, I could not tell you now what all I did to finally get Slate to build. But I do think that if our object is not to keep out the hoi polloi, then we should not be so casual about what I can only call a harrowing experience.

The most common thing that I see in posts to mail threads on failed builds in opensource is “something must be wrong in your environment”.

My own nominee for the build that will never complete is the alternate frontend to Io, the language. Schicksal. Destin.

And of course, hubris.

There is a thought that a discovery is not ‘made’ if peers fail to recognize it for the discovery that it is. And it has been said that the future of a computing language is determined by the momentum of its user base.

Think of Cecil. It has not failed; it is being replaced by Diesel.

But when I struggle to build Slate, I do wonder whether I will not feel more at home in that other lobby … in Io, the language, which builds like a charm. Until you want a better frontend.

And now back to Slate … and maybe a SWIG.

GNUstep ProjectCenter quirks

Tuesday, May 8th, 2007

If you are a Smalltalk developer who has never worked in Objective-C, you may want to look at GNUstep at GNUstep.org if only to see the Markup approach to UI’s found in Renaissance.

If you are on Win32, that may mean installing the Minimal GNU toolset or Mingw and run the Msys shell. You may also have to set the env vars CC and CPP to blank if then are set for anything other than gcc.

But even after you have run ./configure and

make

and

make install

you may have an exasperating moment where you ask yourself how to launch the thing…

The usual answer is to place yourself one directory below a directory with a name such as

SomeProject.app

and then run

openapp SomeProject.app

But to my consternation, while this runs fine on my laptop, on my boat anchor it gives a less than informative error about

could not find /gnustep-install-dir … executable/script

The answer ?

openapp ./SomeProject.app

You will almost certainly want to install the ProjectCenter application even with its occasional fatal bugs ( there is bug reporting at the GNU Savannah project ) and the Graphical Object Relationship Modeller (GORM) tool which is the new Interface Builder.

And with applications, if all else fails you can enter the directory and run the name EXE file – provided that you are in an Msys session configured to run GNUstep.

If you make Renaissance, you may have to make some little adjustments.
Start with the GNUstep Msys session.
cd to the Renaissance install.
You will be using Msys make and there is no ./configure to run.
But it may fail even if you set INCLUDE and LIB sensibly. I simply copied

GNUstep.h

from ./Source to ./Source/Markup

When make got down to the Tools build, it failed again. No settings of PATH or LIB helped, so I set the ./Tools GNUmakefile to read


GSMarkupBrowser_GUI_LIBS +=
-L../Source/shared_ob/Renaissance
GSMarkupLocalizableStrings_GUI_LIBS +=
-L../Source/shared_ob/Renaissance

Then make and make install ran clean.

Enjoy!

Teng + Bolot Smalltalk Prolog/V running fine under Squeak 3.9

Tuesday, May 8th, 2007

I haven’t got an upload to SqueakMap yet, but I have the Prolog/V running fine with very few requests to other components for changes (most involve simply asking a class for its compiler or Parser rather than referencing a Compiler or Parser class explicitly.)

It makes for a fun comparison with VisualWorks SOUL and the Aoki Atsushi 1997 Prolog interpreter found Smaltalk/X and elsewhere.

What is also worth looking at are very-lightweight rule frameworks such as the ersatz-prolog implemented in Python. It makes you realize what can be done in a prototype-based language which allows assertion and retraction in the ‘parents’ of an object.

Yes, I know, even easier in Lisp – I mean, Haskell, but just try to tell a project manager that you are doing *anything* Lispish/functional in a business package where they will hire the bodies to maintain it over the years into the sunset. Just don’t try doing it without telling them … talk about constraints!

As Jim Bender may be amused to recount from my reaction on a F*d*x project in Distributed Smalltalk some years back.

Here is a Prolog/V snapshot pending a new LogicBrowser in OB, Tamaris or StarBrowser+

Prolog/V in Squeak 3.9 Smalltalk

And a simple test ..

Prolog/V test

And a first pass at an OBLogicBrowser

OBLogicBrowser