Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Perl for the Palm? Why Not?

by logan (Curate)
on Mar 04, 2004 at 21:20 UTC ( #334034=note: print w/ replies, xml ) Need Help??


in reply to Is Perl available for PalmOS?

OK, let's take the next step. Why can't perl be ported to the Palm OS? Surely perl has been successfully built for smaller machines. The Treo 600 has 32 MB RAM. Seems to me that that's a lot more memory than the original machines Perl 1.0 ran on.

If we started by stripping out stuff that a PDA wouldn't need, we could probably get Perl down to a size that could comfortably run on a high-end Palm device. Then it becomes a problem of making Perl run on the Palm OS. I won't pretend to know what's involved in a port, but I refuse to believe that it's impossible.

-Logan
"What do I want? I'm an American. I want more."


Comment on Perl for the Palm? Why Not?
Re: Perl for the Palm? Why Not?
by elwarren (Curate) on Mar 05, 2004 at 23:39 UTC
    It boils down to the way the PalmOS was designed. (I'm no expert here, and I haven't touched palm since PalmOS 3, so this may no longer hold true. Chips are up to 400mhz these days, PalmOS will have to improve enventually. Evolve or die!)

    While the hardware has 32mb, PalmOS handles memory in 64k blocks called records. This is the biggest chunk of code you can execute, but not all ram in a palm is executable, it is also split into storage ram. Storage ram is executed in place and is not loaded into an executable space.

    Suppose you have an app that displays jpg files. Your app loads and runs in executable ram. It gets to the point where it wants to display your jpg. Instead of loading the image into ram and twiddling bits, the app points to the jpg in storage and the code runs through it. This is one of the tricks that allows palm to run in low amounts of ram.

    Back to perl, the parser is pretty big. I believe it's up to a few megs these days. Obviously this is too big for the 64k limit. Google for "microperl" and "palm" and you can read about what people are doing to work on it and how these limitations affect them.

    There exists a good paper discussing how the JavaVM was ported to Palm to build the KVM. Google for "j2me palm kvm" and I'm sure it will come up. It's not too heavy and goes over alot of design decisions and roadblocks they ran into. I don't remember, but I think they ended up chaining 64k blocks somehow. Other interesting bits like removing Unicode from the KVM libraries removed something like 21mb of bloat on hello world.

    Perl on Palm explains how python was able to be ported.

    HTH!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://334034]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-12-25 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls