[REBOL] Re: A prototype typechecker
From: jan:skibinski:sympatico:ca at: 7-Nov-2002 18:03
Hi Gregg,
> Deep stuff! Given my current lack of free time and other commitments, I
> probably won't be able to provide any useful feedback, but I appreciate the
> time and effort you're contributing!
>
Thanks!
> I think this could be applied at the dialect level to great effect in
> certain cases.
Not that I plan to do it, at least not for quite a while, but consider
this:
Rebol with all its nice internet gadgetry, great flexibility and power
could be used as good GUI and internet platform for other languages, such
as Haskell. Despite a lot of effort, Haskell is not well equipped
for this sort of things. It has only one native declarative GUI,
called Fudgets, but it is a massive stuff and not in popular use. But
very interesting since in priciple you *do not do* your buttons,
or *do not do* your actions, but only declare how those "things" or
actions
could have happened if the program was to run. And when a program
specification is run those things somehow magically happen.
Clear as a mud? :-)
Well, the thing is that Fudgets are still declarative pieces of code
- they are referentially transparent, and therefore a Haskell compiler
can reorganize and optimize the code any way it pleases - without
introduction of side effects. So that's why Fudgets is such a big beast.
On the other insteresting side, there is quite a good progress being
made in Domain Specific Embedded Languages, and their
practical applications in Haskell. Haskore (the program to write
"symphonies" - well, almost), Fran Reactive Animation and
Reactive Robotics are quite interesting projects in their own.
In the meantime the main GUI effort is to interface Haskell to
third party libraries: Gnome, Da Vinci, Clean's Object Library,
etc. All of this require taking good care about interfacing
to foreign languages. Foreign Function Interface (FFI) has been
already defined but implemented mostly to interface C.
This has been quite an effort, since Haskell has such a rich
type system, while C or C++ are quite primitive by comparison.
It's like trying to translate from PDF to text and back,
if you know what I mean. :-)
So if I ever consider interconnecting Haskell and Rebol,
I'd better have clear idea what I am entitled to do. Obviously,
the simplest approach would be to base everything on
(string -> string) operations. Haskell would consider it dirty
anyway and would treat them as (IO string -> IO string) types,
meaning that it would try to defend itself from "pollution"
by putting everything in monadic IO envelopes, whose
contents could only be passed to other "dirty" monads.
Anyway, this is one of my motivations for my current effort.
Another one relates to documentation of complex functions,
especially HOFs. I think, clearly specified patterns would tell
the user in precise terms how to use such functions.
I am a great believer in good documentation, and so far
I was most impressed with only one language in this respect
- the Eiffel. The main point here is, aside from the Design
by Contract, that there is never any discrepancy between source
code and documentation, because the documentation is always
produced on the fly. Rebol has similar attitude and that
pleases me. No stupid markup tags and all that nonsense
introduced by Sun to Java. So I hope I can to contribute to this
side of Rebol.
The final motivation for my effort here is learning. Hands on
something of significant size helps me much in discovery of
mysteries of Rebol.
:-)
All the best,
Jan