473,473 Members | 2,215 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Lua versus C++ for embedded processor

Regarding the message appended below: I was in a similar situation, only I
had 4 "small" (RAM-wise) legacy processors in a fault-tolerant Tandem K100
system. The system came with an old Borland C++ compiler but I didn't want
to become an expert in anachronistic C++ trivia, so I ported Lua
(www.lua.org) using the perfectly serviceable C compiler. Although I still
need to put in library extensions to access the Tandem's Guardian OS API,
Lua came up quick and easy, gave me object-oriented scripting and provided
access to the applicable portion of the C Standard Library.

I've programmed Z-World Z-180-based embedded microcontrollers in their
Dynamic C language, and will be using their products again but I'm seriously
considering porting Lua in via Dynamic C so I can have object-oriented
scripting to facilitate prototyping and systems integration work. Whether it
will work out in this case is not clear yet, but the Tandem port worked
fine. Maybe Lua has a place in your embedded application, if there isn't
enough infrastructure for Python.

As for C++ on microcontrollers, I have absolutely no idea what the pros and
cons are. Any ideas out there on whether C++ is a good fit there?

Message: 5
Date: Wed, 14 Jan 2004 11:16:48 -0500
From: Peter Hansen <pe***@engcorp.com>
Subject: Re: I come not to bury C++, but to praise it...
To: py*********@python.org
Message-ID: <40***************@engcorp.com>
Content-Type: text/plain; charset=us-ascii

Cameron Laird wrote:

I was still fussing with cfront in the early '90s.
Its era *had* passed by then, though.


And I actually went looking for it again as recently as two years
ago, considering the possibility of using it to allow the use of
C++ code for a small embedded processor which did not have an
available C++ compiler. I actually don't remember precisely why
we didn't try it out, and I assume we simply got distracted by having
to make things work and forgot to continue the search.

Can it be used as a front-end for such chips, where at best there
are two or three C compilers on the market?

-Peter


Jul 18 '05 #1
5 3712
(Sorry for off-topic posts...)

John Benson wrote:

Maybe Lua has a place in your embedded application, if there isn't
enough infrastructure for Python.
That's something I should seriously investigate. I did consider FORTH
but encountered the usual emotional block which always shows up: the
language is just too "weird" for most people, and I can't saddle the
company with a maintenance issue like that. It just doesn't seem
feasible to expect all the developers to have to learn FORTH just to
write for our embedded products.

Lua, on the other hand, as I understand it, is much more traditional in
flavour and (therefore?) easier to read, so it feels more likely to
find a place. Thanks for the suggestion.
As for C++ on microcontrollers, I have absolutely no idea what the pros and
cons are. Any ideas out there on whether C++ is a good fit there?


I believe the same pros and cons apply there as they do anywhere. Easier
to handle complexity (e.g. encapsulating hardware with clean driver objects)
etc, but possible impact on performance.

-Peter
Jul 18 '05 #2
I'll be starting a new project using Rabbit modules (the new wonderfully
low cost, feature rich RCM3700) in a couple of weeks time. I'm quite happy
to code in Dynamic C and the new version is supposed to have improved a
good deal, but I do like the idea of using scripting languages where
possible for future maintainability and Lua would probably be about the
only option for a device like the Rabbit. If you port it to Dynamic C,
could you let me know? I'd be very interested.

I took a look at Lua a while ago, and even bought the Lua book to allow me
to get a good feel for the language. It is actually very good, but at the
time I was looking at it as a replacement for Python, but for my
day-to-day, non-embedded work, the lack of additional libraries (compared
to Python) was an issue.

It did strike me as being ideal for embedded work, primarily due to its
size, and deploying a product running software written in an interpreted
language allows quick and easy live remote updating of the software
itself. I've done this on devices based on embedded PC architecture
running Perl, but it always seemed too optimistic a goal on something like
the Rabbit Cores.

Jul 18 '05 #3
In article <45******************************@localhost.talkab outprogramming.com>,
ciw1973 <ma**@zerospam.cleatorwilson.com> wrote:
I'll be starting a new project using Rabbit modules (the new wonderfully
low cost, feature rich RCM3700) in a couple of weeks time. I'm quite happy
to code in Dynamic C and the new version is supposed to have improved a
good deal, but I do like the idea of using scripting languages where
possible for future maintainability and Lua would probably be about the
only option for a device like the Rabbit. If you port it to Dynamic C,
could you let me know? I'd be very interested.

I took a look at Lua a while ago, and even bought the Lua book to allow me
to get a good feel for the language. It is actually very good, but at the
time I was looking at it as a replacement for Python, but for my
day-to-day, non-embedded work, the lack of additional libraries (compared
to Python) was an issue.

It did strike me as being ideal for embedded work, primarily due to its
size, and deploying a product running software written in an interpreted
language allows quick and easy live remote updating of the software
itself. I've done this on devices based on embedded PC architecture
running Perl, but it always seemed too optimistic a goal on something like
the Rabbit Cores.


I don't know what could more encourage one to Lua's suitability
for such uses than The Book, which you appear already to have
read. Yes, Lua implementation is, from all my experience, an
order of magnitude than the corresponding Perl effort.
Jul 18 '05 #4
Cameron Laird wrote:
.... Yes, Lua implementation is, from all my experience, an
order of magnitude than the corresponding Perl effort.


While this is a strange topic for c.l.p, I _am_ curious what this
sentence meant to say. Perhaps: "order of magnitude less work than"?

-Scott David Daniels
Sc***********@Acm.Org

Jul 18 '05 #5
In article <41********@nntp0.pdx.net>,
Scott David Daniels <Sc***********@Acm.Org> wrote:
Cameron Laird wrote:
.... Yes, Lua implementation is, from all my experience, an
order of magnitude than the corresponding Perl effort.


While this is a strange topic for c.l.p, I _am_ curious what this
sentence meant to say. Perhaps: "order of magnitude less work than"?

Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Alexander May | last post by:
Hi, I love Python! I've been using it for a couple of years now and have found it to be a highly productive language. I evangelize it to my developer friends and am probably responsible for...
4
by: 4csjobs | last post by:
Need embedded software developers with C++, vxworks and OO design and development experience. Please email resumes to kayd@4cs.com
12
by: Bill Hanna | last post by:
C is inadequate for embedded systems for the following reasons: 1) Direct addressing of memory mapped I/O is not supported simply and easily. You have to find work-arounds that are compiler...
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
20
by: Jack | last post by:
Is there a Python packaging that is specifically for embedded systems? ie, very small and configurable so the user gets to select what modules to install? For Linux-based embedded systems in...
4
by: RS | last post by:
Hi all, I was told that using unsigned int instead of int can speed up the code. Is this true? If so, why? Are there are any other rules one should follow to optimize the code for speed (i.e....
2
by: Fergal | last post by:
Hi, im recently new to embedded development. Im using an embedded system with Windows CE5 installed and trying to communicate with some hardware with a PC104 interface. The processor is an ARMV...
62
by: Generic Usenet Account | last post by:
A lot of research has been done to prove that the contention that C code is more efficient and more compact than equivalent C++ code is a myth. My posting pertains to a slightly different aspect...
30
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
Let's say we had a simple function for returning the amount of days in a month: unsigned DaysInMonth(unsigned const month) { switch (month) { case 8: case 3: case 5:
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.