.NET 內嵌.NET Embedding


.Net 內嵌可讓您從其他程式C#設計F#語言和各種不同的環境中使用現有的 .net 程式碼(、和其他專案)。.NET Embedding allows your existing .NET Code (C#, F#, and others) to be consumed from other programming languages and in various different environments.

這表示如果您有想要從現有 iOS 應用程式使用的 .NET 程式庫,您可以這麼做。This means that if you have a .NET library that you want to use from your existing iOS app, you can do that. 或者,如果您想要將它與原C++生程式庫連結,您也可以這麼做。Or if you want to link it with a native C++ library, you can also do that. 或使用 JAVA 的 .NET 程式碼。Or consume .NET code from Java.

.NET 內嵌以Embeddinator-4000開放原始碼專案為基礎。.NET Embedding is based on the Embeddinator-4000 open source project.

環境和語言Environments and Languages

此工具同時察覺它將使用的環境,以及將取用它的語言。The tool is both aware of the environment it will use, as well as the language that will consume it. 例如,iOS 平臺不允許即時(JIT)編譯,因此 .NET 內嵌會以靜態方式將您的 .NET 程式碼編譯成可在 iOS 中使用的機器碼。For example, the iOS platform does not allow just-in-time (JIT) compilation, so .NET Embedding will statically compile your .NET code into native code that can be used in iOS. 其他環境則允許 JIT 編譯,而在這些環境中,我們選擇進行 JIT 編譯。Other environments do allow JIT compilation, and in those environments, we opt to JIT compile.

它支援各種語言取用者,因此會以目的語言呈現 .NET 程式碼為慣用程式碼。It supports various language consumers, so it surfaces .NET code as idiomatic code in the target language. 這是目前支援的語言清單:This is the list of supported languages at present:

  • 目標-c -將 .net 對應至慣用的目標-c apiObjective-C – mapping .NET to idiomatic Objective-C APIs
  • JAVA –對應 .net 以慣用 JAVA apiJava – mapping .NET to idiomatic Java APIs
  • C –將 .net 對應至物件導向,例如 C apiC – mapping .NET to object-oriented like C APIs

稍後會提供更多語言。More languages will come later.

快速入門Getting Started

若要開始使用,請參閱我們的其中一個指南,以取得目前支援的每一種語言:To get started, check one of our guides for each of the currently supported languages:

  • 目標-C –涵蓋 MacOS 和 iOSObjective-C – covers macOS and iOS
  • JAVA –涵蓋 MacOS 和 AndroidJava – covers macOS and Android
  • C –涵蓋桌面平臺上的 c 語言C – covers C language on desktop platforms