wishlist for NXC
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: wishlist for NXC
I'm not sure how you (someone) would go about it. I do remember hearing about how messy the FW is though, so it might be possible. John said that it would take a ton of work to rewrite it, and he doesn't have the time to attempt something like that. If you really need faster processing, there are options available.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: wishlist for NXC
matt,
thanks, but this is my wish (or actually a question to John) for the wish list, not for a discussion thread.
I found that RobotC works really faster (min 10x) in direct comparison and I remember correctly that they "have stolen much from the NQC API" (ref: John Hansen) so I'm curious if NXC can get some profits of it's techniques.
thanks, but this is my wish (or actually a question to John) for the wish list, not for a discussion thread.
I found that RobotC works really faster (min 10x) in direct comparison and I remember correctly that they "have stolen much from the NQC API" (ref: John Hansen) so I'm curious if NXC can get some profits of it's techniques.
Re: wishlist for NXC
Nope (for the "10x fast") - that would mean modifying the firmware. It can, however, be optimized to 3x fast by improving the output of the NBC code. I'd prefer that method to the firmware changing.doc-helmut wrote:so I'm curious if NXC can get some profits of it's techniques.
EDIT: Adding to my non-expert guesses.
Well, he has added natively supported bitwise operations, but short of changing a whole bunch of internal stuff, and rewriting the FW, I doubt it.doc-helmut wrote:is there a chance to speed up the enh FW in relation to the std FW ?
Last edited by muntoo on 15 Jun 2011, 16:07, edited 1 time in total.
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Re: wishlist for NXC
muntoo,
I'm not sure if you're such an expert for the VM and FW details, so I'd like to hear something from a "real specialist" - even if the answer should be coincidentally the same as yours ...
I'm not sure if you're such an expert for the VM and FW details, so I'd like to hear something from a "real specialist" - even if the answer should be coincidentally the same as yours ...
doc-helmut wrote:is there a chance to speed up the enh FW in relation to the std FW ?
Re: wishlist for NXC
Proper support for the following:
Not necessary, but a few more ideas:
NXC should be able to determine and "disambiguate" this, even without pointers!
Code: Select all
++foo[i]; // EDIT: According to the operator precedence table, this may be undefined behavior in C.
++(foo[i]);
(foo)[i] = 1;
++(i);
Code: Select all
(foo+i) = 1;
int* bar = &foo; // Notice: bar points directly to foo; no "runtime stuff" is needed. It's an "alias", in other words. Kind of like passing-by-reference.
*bar = 1;
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Re: wishlist for NXC
Static electricity!
Code: Select all
static int foo;
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Re: wishlist for NXC
support for
volatile
to prevent the compiler from faulty optimizations
volatile
to prevent the compiler from faulty optimizations
Re: wishlist for NXC
As Spiller describes in this post:
To:
This is something that should be fixed - it limits our memory use significantly. Could you generate NBC code which reinitializes the arrays only in scope of the block at the end of the block?spillerrec wrote:As shown in muntoos post, you have to be very careful when you are dealing with large strings/arrays because it ends up making temporary variables.
To make matters worse, in NBC there is no such thing as scope, all variables are global/static so even when it goes out of scope in NXC it does not get cleared. And it is "impossible" to clear them, since you don't have access to them. (Well, there is a dirty trick, run the function again but with an empty array, depending on the function you might be able to clear most of them.)
Code: Select all
{ // start block
string c = a + b;
//...
} // end block
Code: Select all
// start block
strcat c, a, b
//...
arrinit c, 0, 0
// end block
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
-
- Posts: 358
- Joined: 01 Oct 2010, 06:37
- Location: Denmark
- Contact:
Re: wishlist for NXC
Is it possible to add the possibility to manually limit FontTextOut() when using DRAW_OPT_FONT_WRAP?
If you want to make something like a border around the text, or a scrollbar in the right side for example it is fairly important to prevent the text overlapping this.
But this is actually not what I want to use it for (since I already have implemented this in my word-wrapping library (which also makes it possible to control which lines should be drawn)). I often use FontTextOut() to replace certain GraphicOut() operations but I often end up having to do the wrapping manually. In my slide puzzle game I needed to repeat FontTextOut() for each line because I wanted my 64x64 sized grid to start at the left edge. In my tile engine (for NXT RPG) it needs to draw it just before the screen starts and stop just after the screen ends to properly show animation. Again I had to repeat FontTextOut() for each line since DRAW_OPT_FONT_WRAP is fixed on screens right edge.
[quote=muntoo]This is something that should be fixed - it limits our memory use significantly. Could you generate NBC code which reinitializes the arrays only in scope of the block at the end of the block?[/quote]Could this be enabled/disabled with a keyword? Sometimes performance is more important than memory usage.
If you want to make something like a border around the text, or a scrollbar in the right side for example it is fairly important to prevent the text overlapping this.
But this is actually not what I want to use it for (since I already have implemented this in my word-wrapping library (which also makes it possible to control which lines should be drawn)). I often use FontTextOut() to replace certain GraphicOut() operations but I often end up having to do the wrapping manually. In my slide puzzle game I needed to repeat FontTextOut() for each line because I wanted my 64x64 sized grid to start at the left edge. In my tile engine (for NXT RPG) it needs to draw it just before the screen starts and stop just after the screen ends to properly show animation. Again I had to repeat FontTextOut() for each line since DRAW_OPT_FONT_WRAP is fixed on screens right edge.
[quote=muntoo]This is something that should be fixed - it limits our memory use significantly. Could you generate NBC code which reinitializes the arrays only in scope of the block at the end of the block?[/quote]Could this be enabled/disabled with a keyword? Sometimes performance is more important than memory usage.
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
Re: wishlist for NXC
That's whatspillerrec wrote:Could this be enabled/disabled with a keyword? Sometimes performance is more important than memory usage.
static
is for. (I asked for that a little while ago.)Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Who is online
Users browsing this forum: No registered users and 0 guests