All Projects → ASDAlexander77 → Cs2cpp

ASDAlexander77 / Cs2cpp

C# to C++ transpiler (Cs2Cpp) (Powered by Roslyn)

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Cs2cpp

Ts Llvm
TypeScript to LLVM compiler (abandoned)
Stars: ✭ 230 (+48.39%)
Mutual labels:  compiler, native
Retyped
Access 3600+ libraries from C# and let Bridge.NET compile your project into JavaScript.
Stars: ✭ 216 (+39.35%)
Mutual labels:  compiler, roslyn
Bridge
♠️ C# to JavaScript compiler. Write modern mobile and web apps in C#. Run anywhere with Bridge.NET.
Stars: ✭ 2,216 (+1329.68%)
Mutual labels:  compiler, roslyn
Roslynclrheapallocationanalyzer
Roslyn based C# heap allocation diagnostic analyzer that can detect explicit and many implicit allocations like boxing, display classes a.k.a closures, implicit delegate creations, etc.
Stars: ✭ 492 (+217.42%)
Mutual labels:  compiler, roslyn
Scala Native
Your favorite language gets closer to bare metal.
Stars: ✭ 4,053 (+2514.84%)
Mutual labels:  compiler, native
basgo
basgo compiles BASIC-lang to Golang. Then 'go build' can translate code to native executable binary.
Stars: ✭ 31 (-80%)
Mutual labels:  native, binary
Dmd
dmd D Programming Language compiler
Stars: ✭ 2,498 (+1511.61%)
Mutual labels:  compiler, native
ezinject
Modular binary injection framework, successor of libhooker
Stars: ✭ 47 (-69.68%)
Mutual labels:  native, binary
Red
Red is a next-generation programming language strongly inspired by Rebol, but with a broader field of usage thanks to its native-code compiler, from system programming to high-level scripting and cross-platform reactive GUI, while providing modern support for concurrency, all in a zero-install, zero-config, single 1MB file!
Stars: ✭ 4,725 (+2948.39%)
Mutual labels:  compiler, native
Delta
Programming language focused on performance and productivity
Stars: ✭ 77 (-50.32%)
Mutual labels:  compiler, native
Typelang
🌳 A tiny language interpreter implemented purely in TypeScript's type-system
Stars: ✭ 149 (-3.87%)
Mutual labels:  compiler
Xcrash
🔥 xCrash provides the Android app with the ability to capture java crash, native crash and ANR. No root permission or any system permissions are required.
Stars: ✭ 148 (-4.52%)
Mutual labels:  native
Ebooks
A repository for ebooks, including C, C plus plus, Linux Kernel, Compiler, OS, Algorithm, Security, Database, Network, ML and DL
Stars: ✭ 151 (-2.58%)
Mutual labels:  compiler
Jpegkit Android
Efficient JPEG operations for Android without the risk of an OutOfMemoryException.
Stars: ✭ 154 (-0.65%)
Mutual labels:  native
Binpp
🔢 Erlang Binary Pretty Printer
Stars: ✭ 148 (-4.52%)
Mutual labels:  binary
Ropa
GUI tool to create ROP chains using the ropper API
Stars: ✭ 151 (-2.58%)
Mutual labels:  binary
Slang
SystemVerilog compiler and language services
Stars: ✭ 145 (-6.45%)
Mutual labels:  compiler
Wah
a slightly higher-level language superset of webassembly
Stars: ✭ 147 (-5.16%)
Mutual labels:  compiler
Glslang
Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Stars: ✭ 2,034 (+1212.26%)
Mutual labels:  compiler
Reshade
A generic post-processing injector for games and video software.
Stars: ✭ 2,285 (+1374.19%)
Mutual labels:  compiler

C# to C++ transpiler (Cs2Cpp)

The Cs2Cpp repo contains the complete source code implementation for Cs2Cpp. It includes CoreLib, and many other components. It is cross-platform.

Chat Room

Want to chat with other members of the Cs2Cpp community?

Join the chat at https://gitter.im/ASDAlexander77/cs2cpp

Engage, Contribute and Provide Feedback

Some of the best ways to contribute are to try things out, file bugs, and join in design conversations.

License

Cs2Cpp is licensed under the MIT license.

Quick Start

Prerequisite: CMake 2.8+, .NET 4.6.2+, GCC 5.0+ or Microsoft Visual C++ 2017 Community Edition

  1. Build Project
cd Il2Native
MSBuild Il2Native.sln /p:Configuration=Release /p:Platform="Any CPU"

or open Il2Native.sln in Visual Studio 2017 and compile it

  1. Build CoreLib (aka mscorlib)
cd CoreLib
MSBuild CoreLib.csproj /p:Configuration=Release /p:Platform="AnyCPU"
  1. Create a temporary folder to build projects/files
cd ..\..
mkdir playground
cd playground
  1. Generating CoreLib C++ project
..\Il2Native\Il2Native\bin\Release\Cs2Cpp.exe /release ..\Il2Native\CoreLib\CoreLib.csproj
  1. Compile it
cd CoreLib
build_prerequisite_vs2017_release.bat 
build_vs2017_release.bat

Now you have compiled CoreLib (mscorelib)

  1. Compile HelloWorld.cs
cd ..

create file HelloWorld.cs

using System;

class X {
	public static int Main (string [] args)
	{
		Console.WriteLine ("Hello, World!");
		return 0;
	}
}
..\Il2Native\Il2Native\bin\Release\Cs2Cpp.exe /release HelloWorld.cs /corelib:..\Il2Native\CoreLib\bin\Release\CoreLib.dll
cd HelloWorld
build_vs2017_release.bat

Now you have HelloWorld.exe

How to compile CoreCLR and CoreFX projects

  1. Build Core Lib
Cs2Cpp.exe /release <path_to_git>\coreclr\src\mscorlib\System.Private.CoreLib.csproj
  1. Build any Library project, for example System.Private.Uri
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Private.Uri\src\System.Private.Uri.csproj /corelib:System.Private.CoreLib.dll /p:Configuration=netstandard2.0-Windows_NT-Release
  1. Compile it

First Core library

cd System_Private_CoreLib
build_prerequisite_vs2017_release.bat 
build_vs2017_release.bat

Then your targeted library

cd System_Private_Uri
build_vs2017_release.bat

How to compile CoreFX Console project

  1. Generating source code for each reference
Cs2Cpp.exe /release <path_to_git>\coreclr\src\mscorlib\System.Private.CoreLib.csproj
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Collections\src\System.Collections.csproj /p:Configuration=netstandard2.0-Windows_NT-Release
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Diagnostics.Contracts\src\System.Diagnostics.Contracts.csproj /p:Configuration=netstandard2.0-Windows_NT-Release
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Diagnostics.Tools\src\System.Diagnostics.Tools.csproj /p:Configuration=netstandard2.0-Windows_NT-Release
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Resources.ResourceManager\src\System.Resources.ResourceManager.csproj /p:Configuration=netstandard2.0-Windows_NT-Release
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj /p:Configuration=netstandard2.0-Windows_NT-Release /corelib:System.Private.CoreLib.dll
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Runtime.InteropServices\src\System.Runtime.InteropServices.csproj /p:Configuration=netstandard2.0-Windows_NT-Release
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Text.Encoding.Extensions\src\System.Text.Encoding.Extensions.csproj /p:Configuration=netstandard2.0-Windows_NT-Release
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Threading\src\System.Threading.csproj /p:Configuration=netstandard2.0-Windows_NT-Release
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Threading.Tasks\src\System.Threading.Tasks.csproj /p:Configuration=netstandard2.0-Windows_NT-Release
Cs2Cpp.exe /release <path_to_git>\corefx\src\System.Console\src\System.Console.csproj /p:Configuration=netstandard2.0-Windows_NT-Release /corelib:System.Private.CoreLib.dll
  1. Generate source code for "Hello World" executable
Cs2Cpp.exe /release helloworld.cs /ref:System.Console /corelib:System.Private.CoreLib
  1. Compile all projects one by one calling
cd <System.*>
build_vs2017_release.bat

How to compile CoreRT project

  1. Prepare CoreRT to build, run
init-tools.cmd
build.cmd

This should generate 'AsmOffsets.cs'. Ensure it is placed into folder <path_to_git>\corert\bin\obj\Native\Windows_NT.x64.Release\Runtime\Full\

  1. Build Core Lib
Cs2Cpp.exe /release <path_to_git>\corert\src\System.Private.CoreLib\src\System.Private.CoreLib.csproj /p:Platform=x64
  1. Compile it
cd System_Private_CoreLib
build_prerequisite_vs2017_release.bat 
build_vs2017_release.bat
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].