fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: How works the Compiler

How works the Compiler 1 year 8 months ago #2870

  Horst's Avatar Topic Author Horst Offline Posts: 78
Hi

I have a little question.
I have a project and this project needs function.prg with 100 functions inside. But my project needs only one of this 100 function. What is the compiler doing ? He put all into the EXE or only the one ? What's about classes and methods ?

Horst

Please Log in or Create an account to join the conversation.

How works the Compiler 1 year 8 months ago #2871

  wriedmann's Avatar wriedmann Offline Posts: 1545
Hi Horst,

AFAIK in .NET all code is linked in. And the .NET runtime does not knows functions anymore, they are translated to static methods of a static class.
Of course, you can call all methods using Reflection at runtime, and the compiler cannot know that.

In VO, all classes and methods were linked in, and only the required functions from libraries were linked in. Therefore you needed the "request" statemtent or a dummy call when you had a dynamic call of a otherwise not referenced function.

In VO, all libraries are built into the exe, only DLLs remain outside, but are loaded at startup time.

In .NET there is no library as in VO, but only DLLs, and the .NET runtime loads them only when required the first time.

In VO, IMHO the best option was to build monolithic exe files, whereas in .NET you have better an EXE and DLLs to minimize build time (since there is no incremental compiler and linker anymore).

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

How works the Compiler 1 year 8 months ago #2872

  robert's Avatar robert Offline Posts: 969
Horst,

What Wolfgang says.
If you want to see what the compiler generates, then I suggest you download a product called ILSpy ( sourceforge.net/projects/ilspyportable/ ) It allows you to look in / disassemble .Net assemblies.

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

How works the Compiler 1 year 8 months ago #2873

  wriedmann's Avatar wriedmann Offline Posts: 1545
Hi Horst,

ILSpy as suggested by Robert (I'm using a similar commercial product .NET Reflector) is a tool that no .NET programmer should miss: with it you can look into most .NET assemblies if you need to understand how code is working. There are some 3rd party libs that are badly documented or not documented at all, and such a tool will permit you to look at the code.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

How works the Compiler 1 year 8 months ago #2875

  Horst's Avatar Topic Author Horst Offline Posts: 78
Hi

I did not found a working .Net ISAPI Extension example, thats why i am building CGI EXE's and this shoud be as small as possible.

So i will add only prg's i need in my project.

Horst

Please Log in or Create an account to join the conversation.

  • Page:
  • 1