473,378 Members | 1,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 3705
(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:
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.