Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
In C++, Either C++ code can be compiled by a compiler or used in a C++ framework like Platinum. I mean, you have the choice to run C++ independently without frameworks. The same story goes for python and other languages. But come to C# world, I think (maybe I am wrong) you have no choice to run C# independetly by a compiler; it's coupled to dotNet framework or mono. Are there other languages that behave like C# and need its framework to run? Or only C# behave that way?
I think there are two answers to this question.
The framework
I think this is just a battle of words.
Python has an interpreter and comes with "batteries included" meaning a large standard library. That interpreter and libraries included by default is python's runtime environment.
.NET is the runtime environment for C#. It for example includes the virtual machine required to run C# programs.
Please also remember that framework is just a term and it's used at many levels. For example, ASP.NET is also a framework but it's meaning is different to .NET Framework, it's a framework on another level.
Mono is not .NET Framework
It is important to point out. mono is not .NET Framework and it's a real life proof that C# is not coupled to .NET Framework.
Why C# not completely independent of .NET?
C# was created as part of and for .NET.
I want to know that if I can run C# without .Net. I want to separate the framework concept from the language.
If you look into the C# spec, ECMA 334, you'll see that it says:
Although Microsoft’s implementation of C# relies on CLI for library and run-time support, other implementations of C# need not, provided they support an alternate way of getting at the minimum CLI features required by this C# standard (see Annex C).
CLI (Common Language Infrastructure) is based on a subset of the .NET Framework, as the standard says, so C#, the language, indeed does not rely on .NET. It only relies on the things listed in "Annex C", which you can see for yourself.
However, Microsoft's C# compiler, a specific implementation of the C# language does rely on .NET.
Also note that C# with only the things listed in Annex C is not going to be very powerful. I can't even find the System.Console class there. I wouldn't think that you will be able to write any practical program with only the things in Annex C, so at a practical level, yes C# does rely on .NET very much.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have been wanting to create my own programming language and I am looking to start writing a basic compiler. I am doing this purely for learning purposes.
I will be writing the compiler in C#.
I have been trying to decide whether or not to generate IL or another high-level language. From articles and tutorials I have seen/read it seems C and MSIL (by way of reflection.emit) are the most popular.
I am wondering which approach will make my programming language faster? (assuming they were implemented optimally). Ideally I'd like the language to be able to run on both MS and Linux/OSX - I also understand that there may be better alternatives out there I am not considering
Your decision generaly depends on the design and paradigms of your language. If your language will be small and will not include complex object-oriented features, than only non "object-oriented" features of IL will be used, and the difference is about:
The availability of.NET virtual machine and BCL vs C standard library for purpose of language implementation. This includes the memory management capabilities and implementation of primitive types, such ints and strings.
The code generation: stack-based IL vs high-level C syntax. Of course, it can be easier to generate high-level constructs of another language (you should not embrace all the grammar of C, you can just use what you need), but for learning puproses it is more useful to learn how to generate low-level instructions like IL opcodes. And don't forget: it will be cool, if you split your tool into frontend and backend, as it is done in every solid compiler. Than you can just use different backends for code generation.
PROS for IL:
more solid learning process and the complete result: your compiler will not require any other tools and will be self-sufficing;
the presense of BCL and resource-management layers in CLR;
ability to bootstrap your compiler by interaction with C# code.
the unique experience with .net platform - the useful thing if you plan to raise your C# and .net skills.
PROS for C:
the ability to utilize existing backends to generate platform code
and to perform optimizations; you can compile your C output for every
platform C compiler can;
absense of the dependency from CLR: you will not need .net fw or Mono to run the produced output. Today Mono is mature thing and is running both on Mac and Linux, but it is always the choice: IL or platform code.
A lot of modern languages compile to another high-level languages (oh god, there is tons of something-to-js tools today!), and some of the languages is even DESIGNED to be compiled to another high-level language (CoffeeScript to JavaScript), but don't forget that you have another options too, for example, LLVM intermediate representation.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Today I have read an article about the new .Net Native on MSDN.
"Windows Store apps start up to 60% faster with .NET Native and have a
much smaller memory footprint. Our first release is a Developer
Preview that allows you to develop and test apps with this new
compiler. This preview release of .NET Native offers you the
performance of C++ with the productivity of C#".
Of course, this is really interesting but If .Net Native is a new compiler which gives good performance then why we needs to go for RyuJIT. What is this new .Net Native? What is the difference between new .Net Native and RyuJIT, also Microsoft released compiler as a service called Roslyn. So how Roslyn supports this new .Net Native.
.NET Native is not part of the Roslyn project as such. Roslyn is a re-implementation of the C# and VB compilers and language services. Remember these compilers produce managed assemblies. In order to run, they have to be translated to platform specific code. This is typically done through the JIT compiler in the .NET runtime.
.NET Native allows you to turn .NET projects into native binaries similar to what NGEN does, but with a few important differences. .NET Native uses a different native compiler part than NGEN that produces faster and smaller code in general. It also allows a kind of static linking that is not available for regular .NET apps.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
There's a lot of buzz around C# 6
However, I wanted to know that if they work in asp.net and asp.net mvc?
I mean, C# 6 cannot just run in framework 4.5 (Or can it?)
Should we use C# 6 for backend of asp.net/(mvc), because mostly all doesn't have private servers.
So, should we wait for hosters like godaddy to upgrade their system, before we could use much anticipated c# 6?
The preview-release of the C# 6.0 compiler is just that - a compiler. It doesn't target a new version of the .NET Framework. As such, there's nothing new that needs to be installed on your server - you just compile your code with the new compiler, upload it, and you're done.
Of course, this doesn't mean that all features will be available if you're not using a sufficiently up-to-date version of .NET - if you're targeting .NET 2.0, obviously you don't get to use LINQ since that was introduced in .NET 3.5.
Also, a lot of the features you've heard "buzz" about haven't even been implemented yet, even in the preview-release. They're planned, that's all. If there's a particular feature you've heard about that you're wanting to make use of, you should check whether it's even been implemented before you even bother downloading it.
The point though is that the C# compiler and the .NET framework are two completely separate things. There has not (yet) been any announcement of a new version of the .NET framework.
Another point worth bearing in mind though is that the preview-release compiler is exactly what it says - a preview-release. This is NOT the final release, and you need to be aware that features could change or even be removed from under you by the time the final release comes around. How likely that is, I can't say, and the risks involved in using new features introduced with a preview compiler for a production application are for you to weigh.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
What are the possible ways to convert a windows form application (c# , .net) to a cross platform project?
My GOAL is have a project that can run in both Linux base os and windows.
I really like .net but it's not compatible with all OS (for example Linux) because of .Net Framework installation.
what is your suggestions?
As #paqogomez pointed out, IronPython does not take away the need for some sort of .net since, as it's stated on the website http://ironpython.net/ : "IronPython is an excellent addition to the .NET Framework, providing Python developers with the power of the .NET framework."
Since your goal is to run your existing winforms-c#-application on both, windows and linux, you might get away by just using mono (http://www.mono-project.com/).
If this doesn't work out (please refer to http://mono-project.com/Compatibility for compatability issues), you could manually rewrite your existing C# application in pure python. But then, it might well be possible to use any other unmanaged, managed or scripted language which can be used on both systems and which is either easier to translate manually or for which even automated translators exist (however, I don't know if there are any for C#).
Thinking about the last point, I did a quick websearch for "c# cross compiler" which shows some esoteric results which might be interesting for you depending on your project type.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am going to program a GUI under windows (will be about 10,000 line code with my estimates) and don't know C# or C++ (QT library) to choose for my needs. Please help me to choose.
If you have to debate on using C# or C++ then the correct answer is probably C#. I would stay away from a low level language like C++ unless you absolutely have to as the amount of time required to develop/debug with it will be much greater. C# has a lot of GUI functionality that it harnesses from the .NET framework. There isn't a lot you can't do with it right out of the box as opposed to C++ which you'll have to hand code a lot of functionality.
If you are developing a Windows application I'd suggest using C# and the .Net Framework as they are the 'native' solution. Using QT is just going to add complexity as it's a cross-platform library and has additional concerns therein. I'd also suspect the support for the .Net Framework is likely to be greater and more widespread.
The overarching question would be, which programming language are you most familiar with. If there is a Windows compiler for it then use that!
Use .NET if your only target is Windows. It is much more productive and you have better IDE support for development of GUI. The disadvantage is that you need to have .NET framework installed on the machine your application will run on.
If you consider going cross platform, or you think you master Qt (and C++) more than .NET, then go on with Qt.
I'd prefer C#.. In some cases is easier to distribute (windows 7 comes with .NET). Microsoft showed that the future is in WPF, so why wait to adopt it
Choose the GUI toolkit based on your requirements, then choose the language.
if QT fits the bill, then C++, if WinForms looks good, C#, if MFC (and the new feature pack) is good enough, C++ ....
Also, depending on your skill (and the skill of your team) of one language or the other, your decision might be easier.
What are the requirements? If the performance is not an issue then I would go with C#.
I think the question should be using c++, .net winforms or wpf.
You will never use c# lonely to build it, you will use the IDE.
If you need something visual I should use wpf, otherwise I would use .net winforms. You can mix them too.
Regards.
One other option you may want to consider is gtksharp if you want to use c# but would like to target multiple platforms.