EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

NXT: Which C dialect should I pick?

Started by Unknown September 8, 2009
Hi,

I'm looking to writing software for the NXT in either pure C or a
dialect thereof. I had the option of choosing the Java Optimized
Processor (JOP) instead of the NXT, but I wanted to seek a different
challenge so I chose C/C dialect.

Searching the net, I find that most options for writing for the NXT is
in C dialects and not pure C. I had hoped to get a chance to use
pointers etc., but it seems like you're pretty sandboxed with most of
the options out there.

Also, is it possible to measure execution of selected tasks on the NXT
once it's compiled for it?

Regards,
Anders
"Anders S&#4294967295;rensen" <mail@anars.dk> wrote in message 
news:f7f80fbd-425f-4e0a-8ac2-157d45abb225@k39g2000yqe.googlegroups.com...
> Hi, > > I'm looking to writing software for the NXT in either pure C or a > dialect thereof. I had the option of choosing the Java Optimized > Processor (JOP) instead of the NXT, but I wanted to seek a different > challenge so I chose C/C dialect. > > Searching the net, I find that most options for writing for the NXT is > in C dialects and not pure C. I had hoped to get a chance to use > pointers etc., but it seems like you're pretty sandboxed with most of > the options out there. > > Also, is it possible to measure execution of selected tasks on the NXT > once it's compiled for it?
Can you elaborate on this? What do you mean by "in C dialects and not pure C"? As far as I know the NXT has two processors, an AVR and an Atmel ARM7 - both of which have both free and commercial C compilers available. A very quick peek into the source code download from the Lego site would lead me to believe they are providing C code for you. -- Regards, Richard. + http://www.FreeRTOS.org Designed for Microcontrollers. More than 7000 downloads per month. + http://www.SafeRTOS.com Certified by T&#4294967295;V as meeting the requirements for safety related systems
On 8 Sep., 10:17, "FreeRTOS info" <noem...@mentioned.com> wrote:
> "Anders S=F8rensen" <m...@anars.dk> wrote in message > > news:f7f80fbd-425f-4e0a-8ac2-157d45abb225@k39g2000yqe.googlegroups.com... > > > Hi, > > > I'm looking to writing software for the NXT in either pure C or a > > dialect thereof. I had the option of choosing the Java Optimized > > Processor (JOP) instead of the NXT, but I wanted to seek a different > > challenge so I chose C/C dialect. > > > Searching the net, I find that most options for writing for the NXT is > > in C dialects and not pure C. I had hoped to get a chance to use > > pointers etc., but it seems like you're pretty sandboxed with most of > > the options out there. > > > Also, is it possible to measure execution of selected tasks on the NXT > > once it's compiled for it? > > Can you elaborate on this? =A0What do you mean by "in C dialects and not =
pure
> C"?
By C dialects I mean RobotC and NXC (Not eXactly C) e.g. By pure C I mean ANSI C.
> > As far as I know the NXT has two processors, an AVR and an Atmel ARM7 - b=
oth
> of which have both free and commercial C compilers available. =A0A very q=
uick
> peek into the source code download from the Lego site would lead me to > believe they are providing C code for you.
Thank you kindly. I will look into that.
> -- > Regards, > Richard. > > +http://www.FreeRTOS.org > Designed for Microcontrollers. =A0More than 7000 downloads per month. > > +http://www.SafeRTOS.com > Certified by T=DCV as meeting the requirements for safety related systems
Regards, Anders
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323328-1272288298-1252589027=:3606
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Tue, 8 Sep 2009, Anders S=F8rensen wrote:

|---------------------------------------|
|"[..]                                  |
|                                       |
|[..]                                   |
|[..] I had hoped to get a chance to use|
|pointers etc., [..]                    |
|[..]                                   |
|                                       |
|[..]"                                  |
|---------------------------------------|

Hi,

Why?

C. P. G.
--8323328-1272288298-1252589027=:3606--
On Sep 10, 9:23=A0am, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org>
wrote:
>Anders S=F8rensen wrote: >> I had hoped to get a chance to use pointers etc., > Why?
Perhaps we should change it to "use pointers etc _by hand_". I'm struggling to think of a programming language which does not make heavy use of pointers in its ultimate execution... there probably is one somewhere, but most rely on them for practical implementation. The difference is that the user is often not permitted to access them by hand. By they are still present, and still cause issues... consider all those "null pointer exceptions" you can generate in a "pointer free" language like java, when you try to call methods of non- existent objects... While we can debate the merits of manually using pointers in everyday programming, I'd be very suspicious of a programmer who had no "educational" experience of doing so in their background.
On Sep 10, 9:52=A0am, Chris Stratton <cs07...@gmail.com> wrote:

>By they are still present, and still cause issues... > consider all those "null pointer exceptions" you can generate in a > "pointer free" language like java, when you try to call methods of non- > existent objects...
Sorry, I should not have said pointers cause such issues in more abstract languages, but that they are often associated with the symptoms of problems.

The 2024 Embedded Online Conference