Feb2001 hugs98 on MacOS

Johan Nordlander nordland@cse.ogi.edu
Wed, 28 Feb 2001 11:58:19 -0800


Hans Aberg wrote:
> 
> At 13:40 +1300 2001/02/28, Richard A. O'Keefe wrote:
> >The February 2001 release of Hugs 98 unpacked fine and seems to run fine
> >on my PowerMac 7600/120 running Mac OS 8.6
> >
> >HOWEVER, the characters in the console window are teeny tiny wee characters
> >indeed.  What are they, 8 point?  I could live with 10 point, but would
> >personally rather have 12 point.  So what do I do to change the size of
> >the text in this window?
> 
> At 20:05 -0800 2001/02/27, Ashley Yakeley wrote:
> >Product: Hugs 98 MacOS Feb-2001
> >To Repro:
> >In the Finder, drop a haskell source file on the "Hugs 98" application.
> >Results:
> >Hugs 98 launches, but doesn't read source file.
> ...
> >The worked OK in previous versions of Hugs 98 (although you couldn't drop
> >source files on an already-running app).
> 
> The explanation of these problems is this:
> 
> The first joint version I and Pablo MacOS made, happened at right the time
> MPJ wrote the last version and then left the Hugs team. So because of that,
> the MacOS modification where never written into that version.
> 
> Nor has the subsequent Hugs team ever written in those or any later MacOS
> versions into the Hugs sources. So what you have in those sources are some
> very old MacOS stuff.
> 
> Now, it seems, somebody at the Hugs team (Johan?) has tacitly assumed that
> these old Mac modifications are OK, and compiled it. But then most of the
> later stuff breaks.

So the real story is actually this:

The MacOS specifics in the Hugs Feb2001 version are actually quite new; they are
directly taken from the latest version I got from Hans in December last year. 
However, for reasons I'll return to below, many aspects and features of that
version didn't make it into the distribution.  This explains the lack of
drag-and-drop launching.  The font size problem Richard O'Keefe reports is
however a mystery to me, I'll have to pass on this one for the moment since I'm
not able to recreate the bug.

My main objectives as the Hugs maintainer have been fixing bugs and
incorporating interesting enhancements, while at the same time making sure that
the source base stays maintainable.  These objectives aren't always compatible,
and in the Mac Hugs case this essentially means the following:

- The meat of the Mac additions have previously been provided as a separate 
  source distribution, with a stucture totally different from the main sources.
  I've only merged in things that could be transferred to the main repository 
  without too much effort.

- The AppleEvent handling in Hans' and Pablo's version is indeed interesting, 
  but it introduces asynchronous concurrency into the interpreter itself, 
  something which it just isn't built to handle.  This is of course unacceptable
  for a software package that aims at being stable across multiple platforms,
  and the AppleEvent support was therefore edited out.  Unfortunately, this also
  took away the drag-and-drop facility, which is something that definitely could
  be implemented in a safe way.  I just simply didn't have time to do that for 
  the Feb release.

- The Mac sources I was given also contained some stack space management 
  enhancements which I didn't understand, and which also made the interpreter
  crash on a program that ran just fine on the Feb 2000 version of Hugs.
  They were hence removed.

- The Mac sources also contained a complete redistribution of MetroWerks'
  SIOUX sources, for no apparent reason.  If some enhancements were buried
  in there somewhere they are now lost as well, since I didn't want to 
  include code in the distribution that might clash with a standard MacOS
  C library.  Furthermore, the reliance on a binary-only version of a
  library called AEGizmos(modified) is obviously not optimal from a
  maintainability point of view, so all such dependencies are also gone.

So this leaves us with a Feb 2001 Hugs that provides what could be called just
basic MacOS support.  On the othere hand, the MacOS support that's there is now
fully integrated into the main Hugs source tree.  I can see the following ways
forward from the current state:

- Someone (Hans? Pablo? me?) implements the basic AppleEvent handling that's 
  needed to get back the drag-and-drop functionality.  This code should 
  preferably be self-contained, and should be put in the machugs directory.
  Ideally it should continue to respond after hugsmain() has been called,
  but only if the Open events can be made to appear as ordinary :load 
  commands to the intepreter.

- AppleEvent handling on the Haskell level (i.e., Events.hs et. al.) could
  preferably be provided by Hans and Pablo as a standalone library that's 
  only implemented on the Mac (just like the Win32 Graphics lib, although 
  it has been ported to X-windows as well).  However, I must strongly suggest 
  that whoever undertakes this task will take the time to ensure proper
  integration with the Hugs' sequential execution machine.  I think Alastair
  Reid can be a good source of information on how this is achieved.

- Any other enhacements or suggestions are gratefully received; just bear in 
  mind that diffs must be relative the Feb 2001 source base in order to
  be considered.  Together with the other Hugs authors I will also continue to
  issue some form of "editor's discretion" when it comes to deciding what the
  distributed version of Hugs should look like.

By the way, a new release of Hugs will most likely be put out some time this
spring, to catch up with some bug fixes that have recently been made.  So this
is definitely a good time to raise your voice about bugs or features that you
think are missing.

I'll return to the font size problem in an upcoming posting.

All the best,
Johan