Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I just started a new job that uses microcontrollers, real time systems (touch screen displays and "fly-by-wire" controls), and small Pentium processors to handle the control and operation of deep sea drilling rigs and large industrial mining equipment. (http://www.letourneau-inc.com/) Since speed is a priority, 95% of their software is written in C or Assembly. Also, the systems have no hard drives: The OS resides on 126 MB of flash memory; DOS is initially loaded, but during the boot stage, a 3rd party OS takes over all of the interupts.

 

Is there any way that I can use Visual Studio .NET to code and maybe even compile my programs? The code relies heavily upon C's pointer notation, but I am unaware of a method to create a new C project in VS.NET. Further, if I were to open a new C project, would I truely have access to memory via pointers?

 

This company currently uses Borland 6.0, and is considering moving over to Visual Studio .NET. I really would like a lot of firepower to battle against Borland, but I also know that Microsoft does not like Developers having full control of memory. Due to safety, the equipment requires calculatable presentation of feedback from sensors down to the microsecond.

 

Can Microsoft's Visual Studio .NET do this? I am looking for any feedback, ideas, or suggestions.

 

Regards,

Joe

Posted

It isn't really a qestion of Microsoft not wanting developers to have control over memory, it's a matter of developers not ALWAYS wanting control over memory. Let's face it, there's tons of overhead when managing your own memory that just bogs down the dev process. A garbage collector can do all the *mundane* memory work (malloc, alloc, realloc) for you without you having to worry about any of it.

 

That said, if there were such a thing as C.net then you would have direct control over memory the same as you do in regular C. C++ is the same way (though I am unsure how much traditional (and standard) C MSVC++ currently supports. The main difference is that if you were compiling using a .Net C compiler you would compile to some IL. Check the MSVC++ .Net features page for more information.

 

So if you switch over to C++.Net, you will probably have porting issues (though I don't know for sure). On the performance side, you can't get much faster than well optimized C code. You pay a price for the interoperabilty (.Net virtual machine) and managed code (bloat but maintenence made easy - a progression I would say). In addition you would have the option (at least I beleive so...can someone please verify? You have a GC so I think memory management is optional) of managing your own memory. You'll have to experiment to see if .Net will be fast enough for you. There is a lot of "middle man" operation in .Net that you don't get when talking directly to the kernel via C. Again, though, maintanence is rough in that super speedy environment.

 

Another point of contention -- will you be able to install the .Net framework on the targe machines? I have seen third party apps that will compile your .Net program to native (win32) code so that might be something to explore as well...

 

Anyway, I hope I answered your questions. good luck and let me know what you learn and decide.

  • *Experts*
Posted

You can definitely do C programming with Visual Studio, no question. By default, if your files have a .c extension, VS will assume the file is C and not C++. Here's a link to Microsoft's KB.

 

You can also definitely create and compile unmanaged C++ programs, which is just a "standard" C++ program including access to maloc, pointers, etc. By going unmanaged, you lose access to the .NET framework, garbage collection, etc., but it sounds like you know that and it's not much of a concern.

 

There is one major difference between Visual Studio and Borland's product - one that may make a big difference to you and your company: the compiler. All compilers do NOT create the same code. I have no direct knowledge of the compiler differences, but I hear that the IBM compiler generally creates faster code and that MS is one of the slower ones. I think Norton makes a compiler in addition to Borland. And there's always the free compiler, gcc.

 

As a note, there's nothing stopping you from using Visual Studio for development and have it hook to another company's compiler. I would assume Borland's IDE works the same way.

 

By the same token, if you want to use SourceControl but don't like Visual SourceSafe, Visual Studio allows integration with other source control systems.

 

So, there are lots of options. The good news is that you don't have to go "all Microsoft" just because you like their IDE, if that's the route you take.

 

Good luck and happy hunting :)

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Slightly off subjuct, but still along the same thread...

 

Can you do the same with C# compilers and different frameworks? Example: Compile C# code using the Mono compiler and Mono .Net framework from within Visual Studio.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...