|
From: Per W. <pw...@ia...> - 2003-03-04 16:45:45
|
Not completely true that the Java framework is only for Java. There exists C/C++ compilers that generates the byte code, as well as suport native compilation of the Java code to x86 assembler. As long as a virtual machine is complete enough, just about any language may run against the VM. /PWM On Tue, 4 Mar 2003, Ioannis Vranos wrote: > -------Original Message------- > > From: Zodiaq > Date: =D4=F1=DF=F4=E7, 4 =CC=DC=F1=F4=E9=EF=F2 2003 11:12:50 =F0=EC > To: Dev...@li... > Subject: Re: [Dev-C++] Longhorn API > > Hello Ioannis and all Dev-C++ users, > > Tuesday, March 4, 2003, 3:03:42 AM, Ioannis wrote as follows: > > IV> "Longhorn > IV> Next major OS version > IV> Will contain Avalon the fully .NET Win32 API. > IV> OS integration with .NET reaches its conclusion. > IV> Everything that is currently in Windows will be rewritten as managed > code. > IV> " > > So, does it mean that if I want to write some progs for new windows > platform I have to (I must) learn .NET API??? Does .NET look at least > something similar to Win32 API or rather like MFC?? Damn, these are > baaaaaad news for me... but Longhorn going to be released at 2004 or > 2005?? So I have some more time... damn it! > > > That's why i informed you. :) .NET consists of a virtual machine (like > Java) and a complete API. > > .NET is an independent system, Windows and .NET will *coexist* for some t= ime > The source code does not get compiled to binary code but to intermediate > bytecode which is compiled at run-time by the virtual machine (named CLR)= =2E > > Because of this, all languages share the same API and code written in one > language can work with another. For example you can inherit a Visual Basi= c 7 > class to your C++ class, throw an exception in C++ and catch it in C# and= so > on. A programming language in .NET world is just a dialect, you can use > whichever you like (for example Oberon). > > .NET provides garbage collection so when you allocate memory on the free > store you do not have to release it. > > Since .NET is a virtual machine you can think that you write programs for= it > and not your real architecture. That's why it has its own assembly langua= ge, > the assembler MS provides is called ILASM and its disassembler is called > ILDASM. Its assembly language has the notion of objects too! > > Reference: http://www.microsoft.com/mspress/books/5771.asp > > > Since .NET was designed after Java it has advantages over it. Except of t= he > fact that it is an open framework for any language while java's framework= is > only for java, it provides options on how your code gets compiled to nati= ve > binary code at run-time when it is executed. Line by line, function by > function or it gets all compiled to native binary code at the time of > installation (but i do not know how to configure it yet). > > The API is high level and *complete*. For example: > > > (part of a real .NET program) > > #include "stdafx.h" > > #using <mscorlib.dll> > #include <tchar.h> > #using <System.dll> > #using <system.windows.forms.dll> > #using <system.drawing.dll> > > using namespace System; > using namespace System::ComponentModel; > using namespace System::Windows::Forms; > using namespace System::Drawing; > > __gc class CppForm:public Form > { > Button *btn1, *btn2; > Label *theLabel; > GroupBox *gbox; > RadioButton *rb1, *rb2, *rb3; > ComboBox *combo1; > TextBox *text1; > MainMenu *menuBar; > MenuItem *fileMenu, *item1, *item2; > > > > > // ... > > > > > void Setup_Buttons() > { > btn1=3Dnew Button; > btn1->Text=3D"OK"; > > btn1->Size=3DSystem::Drawing::Size(70,25); > btn1->Location=3DPoint(130,225); > btn1->Click+=3Dnew EventHandler(this, &CppForm::Btn1_Clicked); > Controls->Add(btn1); > > btn2=3Dnew Button; > btn2->Text=3D"Cancel"; > > btn2->Size=3DSystem::Drawing::Size(70,25); > btn2->Location=3DPoint(210,225); > Controls->Add(btn2); > btn2->Click+=3Dnew EventHandler(this, &CppForm::cancel_clicked); > > } > > > public: > CppForm() > { > Text=3D"Test Form"; > FormBorderStyle=3DFormBorderStyle::Fixed3D; > Size=3DSystem::Drawing::Size(450,350); > Setup_Menu(); > Setup_Buttons(); > Setup_Label(); > Setup_Group(); > Setup_Combo(); > Setup_Text(); > > } > > }; > > // This is the entry point for this application > int __stdcall WinMain() > { > Application::Run(new CppForm); > > > > return 0; > } > > > > .NET architecture (except of the API) is standardised by ECMA, together w= ith > its assembly language. You can download its standard for free and see its > assembly language at > > http://www.ecma-international.org/publications/standards/ECMA-335.HTM > > > An example of its assembly language: > > assembly Test {} > > > .method static int32 AddTen(int32) > { > ldarg.0 > ldc.i4 10 > add > ret > } > > > .class Test > { > .method static void main() > { > .entrypoint > ldc.i4.1 > ldftn int32 AddTen(int32) > calli int32(int32) > pop > ret > } > } > > > > Since this is the case, there are open source .NETs too. For example: > > http://www.go-mono.com/ > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL: http://run.to/noicys |