[REBOL] Embedded REBOL (Re: Population of PDA Users)
From: brian::hawley::net at: 11-Apr-2001 16:38
Hi all!
Ryan Cole wrote:
>Palms, thus Handsprings, are very limited. Though they tought 8 MB these
>days, they only have 32K of fast RAM available for programs. The memory
>to which they refer operates slowly and is intended for program storage
>and records. You can still use this memory as you do RAM, but it is much
>slower.
Actually, the RAM hardware the heap is in is no faster than
the rest of the RAM. The reason it is 32k is because it is
accessed using a 16-bit signed offset pointer. Other RAM
needs a change of base pointer in addition to the offset,
an operation that takes slightly longer. Palm OS is 16-bit,
like MS-DOS. The speed difference is similar to that between
.com and .exe programs on DOS.
The only slower RAM in Palm-compatible handhelds is in the
add-on flash cards that are available for Visors and Sonys.
>I am sure REBOL could work on the Palm, but it would crawl in
>comparison to other ports.
Certainly, because it would run on 16-33 mhz processors.
>To further deter, they likely would have to do extensive porting,
>since the Palm OS seems so much different than other operating
>systems that I know.
Palm OS is pretty generous by embedded standards. REBOL just
isn't structured by embedded standards. And yes, REBOL would
need some minor rewriting to really fly on Palm OS, WinCE or
in any other environment that is not based on the slow-disk,
large-heap pattern. Palm OS and WinCE are based on a small-
heap, in-memory database pattern. WinCE has a potentially
larger heap (32-bit addressing) but can have a heap that is
too small for traditional REBOL, as I think it does with the
HP Jornada 620 when its RAM hasn't been updated.
Of course Carl would be the one to ask about this, with his
experience in OS design, but I'll give it a shot.
What REBOL does now:
1 - Load the native core from the disk to the heap.
2 - Decompress (build?) the REBOL data into the heap.
3 - Run the interpreter.
What other languages do on these platforms:
1 - Execute the native code from where it already is.
2 - Access the data directly from in-memory databases in the
native format, without needing to put it in the heap.
3 - Run the interpreter.
What REBOL would need to do to make this work:
1 - Make sure that as much of the native code as possible
is reentrant, so that multiple REBOL instances can be
run at the same time from the same code. This could
improve the Windows and Linux ports as well, maybe.
2 - Structure the REBOL heap as an object-database, or
perhaps several databases. One way would be for the
system to get one read-only heap for the mezzanine
and below, and one read-write heap for each session.
Objects in the main heap changed in a session would
be copied to the session heap and changed there. The
existing REBOL code is somewhat anti-reentrant, so a
little rewriting would be necessary to minimize the
copying (and enable multi-threading as well). The
database code could just be a wrapper around system
database support on platforms that have such, like
Palm and WinCE. You can even compress the code in
the main heap with a REBOL-to-native compiler, and
even store most of the native functions in it.
3 - Some of these platforms don't have an easy mapping
to the program concept - on Palm a "program" is a
database with native code in its records. They also
don't necessarily have specific program opening and
closing operations, basically picking up where they
left off. The session concept would map quite well
to this, allowing you to pause and resume multiple
sessions, start new sessions, and even "stop" them
by deleting the session database.
I'm sure that there are other factors that I haven't
thought of (Carl, chime in!), but that should cover the
basic changes. The REBOL code should be mostly portable
between Palm, WinCE, etc. The native code would be less
portable but some careful planning and a REBOL compiler
would relieve some of that.
>Keep in mind that the Palm was originally designed to be a
>robust handheld organizer. I think, and many would agree,
>that they are overdue for a new OS and hardware archetecture
>to meet developers increasing desires.
I believe Palm OS 4.0 is supposed to be that. It is even
said to be ported to the ARM architecture (I'll believe
that when I see it).
>Maybe a cut down, compileable?, REBOL like language, for cell
>phones and PDA's? A REBOL PDA dialect? Carl could probably
>write it in a weekend.
>: )
I could probably write it in two weeks (at least the basics),
after several months of reading and research of course. :(
Experience counts. I've been thinking about this, off and
on, for a few months now. Carl has actually done things like
this before (Amiga comes to mind)...
>Till then I will keep on using Satellite Forms, which I am skepticle is
>more productive than C since I spend sooooo much time dealing with thier
>interpeter's bugs. For now I can only hope Carl gets a PDA itch,
Me too!
Brian Hawley