[GRASS5] GUI for GRASS

hi glynn:

i did a quick look around the gcc page, and obj-C is supported (couldn't find which version it start with). as for learning obj-C, there's been this claim on the osx developers' pages that if one knows C, one can learn obj-C in an afternoon...

andy

Glynn Clements wrote:

andy agena wrote:

what about gnustep <http://www.gnustep.org/&gt;? display postscript and
an interface builder so easy, even i'm able to use it.

The main problem is that, AFAIK, GNUstep uses objective-C. This would
require anyone who builds from source to have an objective-C compiler,
and require developers to be able to program in objective-C.

A similar problem exists for wxPython, i.e. users would need to have
Python installed, and developers would need to be able to program in
Python.

andy agena wrote:

i did a quick look around the gcc page, and obj-C is supported
(couldn't find which version it start with).

I'm aware that gcc supports it; however:

a) Most distributions relegate it to a separate package, and not many
people install the objective-C component.

b) I have no idea how reliable it is on minority platforms (i.e. other
than Linux and Mac). Even gcc's C++ support has tended to be flaky on
commercial Unices, which doesn't bode well for objective-C.

c) What's the state of Windows support?

as for learning obj-C,
there's been this claim on the osx developers' pages that if one knows
C, one can learn obj-C in an afternoon...

Even if people can learn it, will they? Or will they turn away as soon
as they realise that it's in a language they don't currently
understand?

Also, it isn't just a matter of being able to write code. We need to
be able to handle bug reports (which means understanding the awkward
cases, not just typical usage). Can you call objective-C code from C?
What about binary compatibility? E.g. C++ is very "fragile" in this
area; note how many GDAL problems are C++ related. Will we have
similar problems with objective-C?

--
Glynn Clements <glynn.clements@virgin.net>

Hi all.

c) What's the state of Windows support?

I had a look into this today and found that the Windows GnuStep graphics is
alpha only but under active development.

I feel that if you were to choose to use Objective C (much as it appeals),
you might as well go all the way and use Smalltalk. For example Squeak
Smalltalk is stable, free software, maintained by an enthusiastic and large
group of people (including Alan Kay and friends) and has excellent cross
platform portability including hand-helds, Unices and Windows. It also has
a built in 3D graphics engine which can automatically take advantage of
acceleration hardware, and a well established foreign function interface.

Whether such a course of action would sit well with the average potential
user/developer of Grass would be an interesting question however. Hence:

Even if people can learn it, will they? Or will they turn away as soon
as they realise that it's in a language they don't currently
understand?

I have to say that despite it's limitations, C is an excellent language and
there is plenty of scope for making the current Grass source base more
maintainable as discussed in other recent threads.

As a matter of interest, I wrote from scratch some some simple minded
Haskell which parses and displays Grass 4 and 5 CELL rasters (plain and RLE)
but not FCELL, including several variations of colour file and it took only
a few hundred lines of code, so there is plenty of attraction in using a
higher level language than C.

Cheers

Mike Thomas

Mike Thomas wrote:

> c) What's the state of Windows support?

I had a look into this today and found that the Windows GnuStep graphics is
alpha only but under active development.

I feel that if you were to choose to use Objective C (much as it appeals),
you might as well go all the way and use Smalltalk.

That really would be going all the way :wink: Using Smalltalk would
probably reduce the developer base to you and me; actually, probably
just you.

> Even if people can learn it, will they? Or will they turn away as soon
> as they realise that it's in a language they don't currently
> understand?

I have to say that despite it's limitations, C is an excellent language and
there is plenty of scope for making the current Grass source base more
maintainable as discussed in other recent threads.

One of the main reasons for C's popularity is its lack of limitations.
Sure, you might have to write more code (possibly a lot more) than in
a high-level language, but there's very little that C simply won't
allow you to do.

The other main reason is that it's feasible to:

a) interface between C and just about any other language, and

b) link object code compiled on one system (e.g. yours) with object
code compiled on another system (e.g. your OS vendor's).

As a matter of interest, I wrote from scratch some some simple minded
Haskell which parses and displays Grass 4 and 5 CELL rasters (plain and RLE)
but not FCELL, including several variations of colour file and it took only
a few hundred lines of code, so there is plenty of attraction in using a
higher level language than C.

FWIW, I did r.out.ppm3 in 76 lines of Haskell (plus ~300 lines of
GreenCard for the relevant libgis bindings). For languages other than
C, I would strongly recommend interfacing to the GRASS libraries
rather than reimplementing them.

It's a nice language for "bespoke" applications, but it's completely
impractical for writing code which is intended to be distributed. The
language and the main libraries are so fragile that a lot of code will
only compile with one specific version of the compiler. Binary
compatibility is totally non-existent.

The same issues apply to a lot of other languages. C++ is
(unsurprisingly) the only one which really comes close, and even that
is problematic.

It works well on Windows, where anything other than 100% binary
compatible with the current version of MSVC is considered an outright
bug. Linux isn't too bad, but even there programs written in C++ are a
lot less portable than those written in C. On commercial Unices, you
need the complete GNU toolchain and libraries, and to have built any
other libraries with those; otherwise you're asking for trouble.

--
Glynn Clements <glynn.clements@virgin.net>

Hi again.

That really would be going all the way :wink: Using Smalltalk would
probably reduce the developer base to you and me; actually, probably
just you.

Before shutting the door on Squeak I would point this project:

http://swiki.agro.uba.ar/microcosms

out to those geographers who might want to try complex systems simulation
without writing special software.

I/O to one or two simple Grass data formats would be very easy to add - you
don't need libgrass to do it. Squeak also has EPS output of any graphical
object.

a) interface between C and just about any other language, and

b) link object code compiled on one system (e.g. yours) with object
code compiled on another system (e.g. your OS vendor's).

Agreed.

> As a matter of interest, I wrote from scratch some some simple minded
> Haskell which parses and displays Grass 4 and 5 CELL rasters (plain and

RLE)

> but not FCELL, including several variations of colour file and it took

only

> a few hundred lines of code, so there is plenty of attraction in using a
> higher level language than C.

FWIW, I did r.out.ppm3 in 76 lines of Haskell (plus ~300 lines of
GreenCard for the relevant libgis bindings). For languages other than
C, I would strongly recommend interfacing to the GRASS libraries
rather than reimplementing them.

Is the Greencard stuff publicly available?

I decided to do otherwise as I can't stand libgis. Parser combinators make
it really easy to do the Grass text file parsing.

By the way, I am not suggesting that GRASS officially move to Haskell (or
any other non-mainstream language). I think there is lots of scope for an
easier set of primitives for external bindings though and I think C is an
excellent choice for doing that.

It works well on Windows, where anything other than 100% binary
compatible with the current version of MSVC is considered an outright
bug. Linux isn't too bad, but even there programs written in C++ are a
lot less portable than those written in C. On commercial Unices, you
need the complete GNU toolchain and libraries, and to have built any
other libraries with those; otherwise you're asking for trouble.

It's a shame because C++ has a lot of good points too.

Cheers

Mike Thomas

Mike Thomas wrote:

> FWIW, I did r.out.ppm3 in 76 lines of Haskell (plus ~300 lines of
> GreenCard for the relevant libgis bindings). For languages other than
> C, I would strongly recommend interfacing to the GRASS libraries
> rather than reimplementing them.

Is the Greencard stuff publicly available?

No, but I can send it to anyone who is interested. It only deals with
those functions which were necessary for this particular program:

G_gisinit
G_get_window
G_find_file2
G_open_cell_old
G_close_cell
G_raster_map_type
G_get_raster_row
G_read_colors
G_free_colors
G_lookup_raster_colors

I decided to do otherwise as I can't stand libgis. Parser combinators make
it really easy to do the Grass text file parsing.

The problem with re-implementing core functionality is that you have
to rewrite it if the original implementation changes.

--
Glynn Clements <glynn.clements@virgin.net>

On Sat, Oct 19, 2002 at 06:32:08AM +0100, Glynn Clements wrote:

Mike Thomas wrote:

> > FWIW, I did r.out.ppm3 in 76 lines of Haskell (plus ~300 lines of
> > GreenCard for the relevant libgis bindings). For languages other than
> > C, I would strongly recommend interfacing to the GRASS libraries
> > rather than reimplementing them.
>
> Is the Greencard stuff publicly available?

No, but I can send it to anyone who is interested. It only deals with
those functions which were necessary for this particular program:

G_gisinit
G_get_window
G_find_file2
G_open_cell_old
G_close_cell
G_raster_map_type
G_get_raster_row
G_read_colors
G_free_colors
G_lookup_raster_colors

Weren't it a good idea to separate the I/O routines from the libgis?
Then we could release them under LGPL for inclusion also into
proprietory systems to invite everybody to implement GRASS support.

Frank Warmerdam once extracted the relevant functions:
http://freegis.org/cgi-bin/viewcvs.cgi/libgrass/

This should be reflected in standard GRASS to get rid of extra maintenance
efforts.

(of course another 5.1 issue)

Markus

Hi Markus.

Weren't it a good idea to separate the I/O routines from the libgis?
Then we could release them under LGPL for inclusion also into
proprietory systems to invite everybody to implement GRASS support.

Frank Warmerdam once extracted the relevant functions:
http://freegis.org/cgi-bin/viewcvs.cgi/libgrass/

This should be reflected in standard GRASS to get rid of extra maintenance
efforts.

(of course another 5.1 issue)

Sounds like a smart move. If no-one else does it I'll look into it over the
next month or two.

Cheers

Mike Thomas.