开发者

Is there some tiny perl that I can use in embedded system where the size would matter?

开发者_如何学JAVAIs there some tiny perl that I can use in embedded system where the size would matter?


See Simon Cozens' article on Microperl.

microperl is a real, honest-to-goodness Perl interpreter; no core elements of the Perl language have been removed. The regular expression engine is exactly the same, the language is exactly the same, it has the same Unicode support, and so on. The only things that have been removed from it are functions that are completely system-specific, like crypt and readdir.

See also README.micro:

microperl is supposed to be a really minimal perl, even more minimal than miniperl. No Configure is needed to build microperl, on the other hand this means that interfaces between Perl and your operating system are left very -- minimal.

All this is experimental. If you don't know what to do with microperl you probably shouldn't. Do not report bugs in microperl; fix the bugs.

Depending on size constraints, you may not need to go that far, just using miniperl —which is built in the process of compiling perl— might be enough.


Hate to say it and I will probability get lots of down votes but ...

If size is a problem go with C. If there is a specific functionality you want from perl you will find a C library with a bit of searching that will give you similar functionality.

If easy script-ability and quick turn around is required may be you should get a larger CPU able to run perl or try a language with a smaller footprint like Lua.


Modern Perl is a fantastic language for quickly creating solutions to problems. However, it's not precisely tiny.

The earlier versions of perl were a bit smaller ... googling for "16 bit perl" shows that some crazy people managed to get versions 3 and 4 of perl to compile for 16 bit dos.

The source for perl 4 is still floating around the web, and if you really really needed to, you could probably recreate the work of those people, and make perl run on a new 16 bit embedded system.

However, there are enough differences between that ancient language and modern perl to make it not worth the trouble. The most visible difference is that the package separator was ' instead of :: , and there are many more differences besides that.

Instead of messing around with something as ancient and arcane as perl4, I would suggest just writing your program in modern perl (version 5.22 is the latest), and then rewrite it in portable C or C++ , and cross compile it to your embedded system.

I realize that the original question is a bit old, but I figured I'd provide an expanded answer for others considering running perl on embedded systems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜