|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: Compact rio not being able to use C
Quote:
If I were to speculate, I would guess is that the base functionality provided by FIRST will all be in C, but teams will be free to write their extraneous code in C++ and just interface it with the C base code. |
|
#17
|
|||
|
|||
|
Re: Compact rio not being able to use C
Quote:
Greg McKaskle |
|
#18
|
|||
|
|||
|
Re: Compact rio not being able to use C
Quote:
Greg McKaskle |
|
#19
|
||||
|
||||
|
Re: Compact rio not being able to use C
There's nothing wrong with the CINs being ancient. They still work...and allow you to access compiled C and C++ code. I haven't used a Call Library Node. Most of the code I use at work was already written for use with CINs.
|
|
#20
|
|||
|
|||
|
Re: Compact rio not being able to use C
Quote:
Around six years later, when CodeFragments on Mac, and DLLs on Windows existed, the CallLibrary node was added. In some ways it is superior to CINs, in other ways, it was a bit lacking since it was defined industry-wide, and not inside the LV team. In the fifteen years or so that have passed since then, both have been maintained and reworked. In the next release, NI will no longer ship any VIs containing CINs. Over the year, as code is touched for some other reason, it has been moved to CallLib nodes, but we still support them because customers have written them, and don't necessarily want to spend the time taking their C code to a new library format. If it works, why change it. On the other hand, new platforms, like cRIO can't use existing CINs. They require the C code to be recompiled for a new OS anyway. This will require reworking the make file, the header includes, dealing with little nit picky C stuff that was marginally compatible. So while doing that, we think it is better to move from CIN libs to .outs, .DLLs, .frameworks, .libs, or whatever the platform preference is for shared binary code. And that is the state the cRIO is in. It supports external binary code written by you, by the OS vendor, by third parties, etc. It does so in a standard way rather than the twenty-x year old proprietary way that LV invented. That was why I called them ancient, and that is why the cRIO doesn't support CINs. Ancient doesn't necessarily mean bad, but ancient things do fall out of use, otherwise I'd be tapping this out in morse code or writing it in Latin. Greg McKaskle |
|
#21
|
||||
|
||||
|
Re: Compact rio not being able to use C
I attended the seminar that they had at World, and the people in the seminar said that we would hav a chance to program in either C, C++, or Labview. So there are 3 programming options.
|
|
#22
|
||||
|
||||
|
Re: Compact rio not being able to use C
Quote:
![]() |
|
#23
|
|||
|
|||
|
Re: Compact rio not being able to use C
Quote:
Any thoughts? Brad Miller WPI Robotics Resource Center |
|
#24
|
|||
|
|||
|
Re: Compact rio not being able to use C
Quote:
Just wondering, but if you did write wrappers, would you then still use the C++ compiler, or would you use a C compiler instead? How would wrappers work in this case? I typically see wrappers used the other way, wrapping C code up to use in C++, which is why I am curious. |
|
#25
|
||||
|
||||
|
Re: Compact rio not being able to use C
Quote:
Quote:
I guess what is boils down to is whether there are teams who will choose to program exclusively in C and who would be confused by the C++ syntax. I can't answer for others, but my team may or may not decide to use C++, depending on how comfortable our students are with C. In either case, we'll already be taking advantage of having a C++ compiler to eliminate some of the shortcomings of C, so calling methods on a class for motors and sensors won't bother us. |
|
#26
|
|||
|
|||
|
Re: Compact rio not being able to use C
The question was, as you noticed, one of familiarity with C++. One could write the entire program using C syntax except for creating and invoking methods on objects. The syntax isn't a huge stretch from what a C programmer would know, but we're trying to be very sensitive about forcing people to learn a whole bunch of new stuff in this transition year. I was trying to get a feel if the community would be up in arms over being forced to use those few pieces of C++ syntax.
Brad Miller |
|
#27
|
||||
|
||||
|
Re: Compact rio not being able to use C
Quote:
|
|
#28
|
|||
|
|||
|
Re: Compact rio not being able to use C
NI has never supported anything besides LabView on it's hardware, until now.
<ins>Hm, I can't find my source for where I saw this, I think it is more accurate - better to be conservative - to say NI has not extensively supported this type of programming on this type of hardware before FIRST, at the very least. I was aware there were articles published on calling shared/dynamic object code from LabView, though I am not sure to what extent it is used in reality. In addition, NI is merely supporting the C/C++ effort, it is WPI doing the development of the library. In addition, I completely forgot about interrupts writing this post, and how that will be handled (it shouldn't matter as far as C vs C++ is concerned, however, LabView changes it up because it supports interrupts seamlessly and natively, so LabView could be appealing for teams who want to take advantage of those features and not spend hours in front of a C or C++ debugger which probably won't even work well in a real time environment.</ins> On the topic of C versus C++, I think this post by Linus Torvalds to the linux-kernel mailing list is entirely relevant: http://kerneltrap.org/node/2067 His full post is about halfway down the page. He talks about using C++ to write operating system kernels (FRC programming is for embedded systems, roughly equivalent), and how it is a "BLOODY STUPID IDEA". That isn't the point I will jest at though and I am not supporting one over the other (frankly I don't like the NI-RIO at all, even if it does improve on some things, like floating point math), rather, I point out the fact that they are more or less the same, difference being that C++ has made things much more easier (or as Linus points out, worse for some areas of programming where even moderately high level programming is bad, e.g. operating system kernels). C has most all of the stuff C++ does, most coders don't realize it though. Structs are the same thing as classes, and can (with work) be inherited, and polymorphism is (roughly) supported with function pointers. C has functions that operate on structures (function(object, arg)), C++ has methods that operate on structures (object.function(arg)). C++ just has member visibility, operator overloading, and extended function names (so you can define multiple functions with the same name but different arguments). It is hard but entirely possible to create byte code that has both a struct-and-function interface for C and (formal) OO interface for C++. There is no reason not to use the OO interface using C++, it is simpler, memory management becomes easier, and error handling with Exceptions improves code cleanliness. Unfortunately, if we go all out on C++ (as opposed to using OO and Exceptions sparingly), it makes it difficult to write plain old C if you are intent on doing your own memory management and error handling. We aren't working with kernels or doing data mining or multi-threading, and are working on a UNIX-like OS (thankfully), so C++ imo is perfectly adequate. I am more worried about people not being able to deal with malloc and free, say, in C more then I am the OO features of C++. OO is pretty simple to grasp if you are only using it. Last edited by Nibbles : 09-04-2008 at 12:22 AM. |
|
#29
|
|||
|
|||
|
Re: Compact rio not being able to use C
I really don't want to get sucked into a language discussion, but let me throw in a clarification.
Quote:
Greg McKaskle |
|
#30
|
|||
|
|||
|
Re: Compact rio not being able to use C
Quote:
How close is the new library to existing WPILib? I want to get my team up and running as soon as possible and I was wondering if it is worth it to learn the old WPILib on the old controller? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| First CROSSING not being scored? | jgannon | Rules/Strategy | 22 | 03-09-2008 11:08 AM |
| CMUCam Forum messages are not being poseted as recent activity in the portal | Bob22341 | CD Forum Support | 3 | 01-31-2007 10:34 PM |
| Ethics 101: To re-use or not to re-use? | aaeamdar | General Forum | 87 | 12-07-2006 07:10 PM |
| Anyone concerned about the possibility of not being allowed to go to Nationals? | skrussel | Championship Event | 41 | 04-03-2003 11:35 AM |
| EDU RC not being recognized... | Caleb Fulton | Programming | 5 | 03-24-2003 09:29 AM |