Re: Perl and Robots
by PetaMem (Priest) on Jan 24, 2005 at 19:16 UTC
|
A BASIC Stamp is probably the last piece of IC where it makes sense to try to squeeze Perl to. If you want to go for Perl on an embedded device: Get a fairly decent MCU (http://microcontroller.com/) that runs linux and cross-compile an optimized perl for it. You will need between 4MB and 8MB of Memory though.
That said, I believe Perl is actually a very good choice for doing high-level robotics logic and worth the effort getting it on embedded systems.
| [reply] |
Re: Perl and Robots
by ikegami (Patriarch) on Jan 24, 2005 at 19:08 UTC
|
You'd need to add RAM for Perl and your programs to run in. You'd need to add some form of non-volatile storage big enough to hold Perl. You'd have to write some sort of VM (if one doesn't already exist) since these boards are designed to run programs from the onboard EEPROM instead of from the external memory. This doesn't sound like the way to go.
Have you considered using a computer with a Mini-ITX form factor motherboard (such as Via's EPIA mainboards)? This requires much real estate, and probably requires a fair chunk of power (possibly requiring a house's or a car's power outlet), so I don't know if it meets your needs.
| [reply] |
Re: Perl and Robots
by osunderdog (Deacon) on Jan 24, 2005 at 18:40 UTC
|
I doubt that you could get a Perl image wedged into a Basic stamp.
Perhaps into some handheld devices: does perl goes to mobile?
"Look, Shiny Things!" is not a better business strategy than compatibility and reuse.
| [reply] |
Re: Perl and Robots
by jryan (Vicar) on Jan 25, 2005 at 09:52 UTC
|
Oh Perlmonks, oh man oh man oh man, the replies in this thread, the replies in this thread. I can't believe it.
Anyways, as far as introductory microchips go, the parallax basic stamp is actually pretty nice. The problem, is, of course, the whopping 32 bytes of ram coupled with the (unusually fast) 2k of eeprom. You're barely going to have enough space to hold your program, much less do anything complicated.
You might be better off using a PIC, which is like super-cheap mini microcontroller. (try http://www.microchip.com/, you should be able to search around and find them for 5-8 bucks a pop). In addition to being cheap, PICS will be much faster than the stamp and have somewhere in the range of 16x - 64x the memory, as well as more I/O ports.
Unforunately, you'd need 20x more memory on top of that (at least 2 megs) to embed even the most stripped down versions of perl, such as miniperl. One technique to get around this is to write a domain-specific high level language and compile it (using Perl and Parse::Recdescent) down to whatever assembly language that the PIC uses. Not only will this make your code reliable and consistant, it can also give you the chance to write a simulation layer that will make your testing phase much faster.
I've been successful with this approach in the past, and am currently using the same approach in an AI-heavy robotic art project that I'm involved with right now. I highly recommend that you give it a shot. :)
| [reply] |
Re: Perl and Robots
by Fletch (Bishop) on Jan 24, 2005 at 18:40 UTC
|
Given a sufficiently large IC, sure it might be conceivable . . .
Despite the lack of information (e.g. a link to some information about what the frell a "parrallax basic stamp" is), I'm going to say the answer's probably "no". Perl likes a whole lot of room to work in and freely trades RAM for programmer efficiency and doesn't lend itself to tiny platforms (search for some of the threads about Perl on PDAs).
| [reply] |
|
|
A BASIC stamp is a small microcontroller that implements a form of BASIC. It's popular in small robotics applications. For more info, Google is your friend.
To answer the orginal question, no, a BASIC stamp is almost certainly not going to run Perl. There simply isn't enough RAM available. You'll need something heaftier, like an ARM with a few megs of RAM.
P.S., we need to gather a Farscape fanclub on PM :)
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
| [reply] |
Re: Perl and Robots
by samizdat (Vicar) on Jan 25, 2005 at 14:10 UTC
|
I bring a few decades of embedded work to the table here (who just said 'pompous' on another thread??? ;-)), so I'll take a stab at this one. First off, no 8x51 is going to give you the kind of juice you need. A few variants can have more than 64K of total memory space, but they're rare and the BS is not one of them. You can write an interpreter with similar syntax, but it'd be crippled and it wouldn't have the bit-banging routines you need most, unless you write them.
That said, there are a host of 486-on-a-chip boards (see http://soekris.kd85.com/) that will give you a tiny BSD kernel like PicoBSD and your entire Perl environment or http://www.ampro.com for examples of units with vga and keyboard connectors so you can have a whole pc on your bot.
With PicoBSD (see http://www.freebsd.org/~picobsd/), you can build an entire deployment system on your pc and d/l it to a floppy or a flash disk for your embedded system, if it's 'headless', i.e. no kb and monitor. | [reply] |
| A reply falls below the community's threshold of quality. You may see it by logging in. |