.NET and C++ Interoperation
Name
Andres Traks
Abstract
C# is a modern programming language aimed at code robustness and development productivity, but it cannot compete with C++ in performance. The best of both worlds can be had by interoperating between the two languages.
However, C# as a .NET language follows a different paradigm than C++ in many ways. For example, .NET cleans up memory using automatic garbage collection while C++ requires memory to be freed explicitly. Low-level memory access is natural in C++, but is strictly controlled in .NET. Not to mention differences in naming conventions and semantics.
This paper describes two approaches to creating an intermediate layer between .NET and C++ (Platform Invoke and C++/CLI) by making a wrapper interface around C++ code, explains how to overcome memory management and performance issues and introduces a framework for automatically generating the interface.
By combining .NET and C++, developers can build their application in a safe and productive manner without sacrificing speed in performance-critical parts of the code.
However, C# as a .NET language follows a different paradigm than C++ in many ways. For example, .NET cleans up memory using automatic garbage collection while C++ requires memory to be freed explicitly. Low-level memory access is natural in C++, but is strictly controlled in .NET. Not to mention differences in naming conventions and semantics.
This paper describes two approaches to creating an intermediate layer between .NET and C++ (Platform Invoke and C++/CLI) by making a wrapper interface around C++ code, explains how to overcome memory management and performance issues and introduces a framework for automatically generating the interface.
By combining .NET and C++, developers can build their application in a safe and productive manner without sacrificing speed in performance-critical parts of the code.
Graduation Thesis language
English
Graduation Thesis type
Master - Computer Science
Supervisor(s)
Siim Karus
Defence year
2016