Git Product home page Git Product logo

ccsharp's Introduction

CC#
===

C# -> C++ = CC#

  This is the next evolution in C# to C++ compiler based on the Q# project which tried to use attributes to inject C++ code
directly into the C# source which was a mess.
CC# instead uses extern functions which are defined in cpp source files, creating much cleaner code.
The compiler and assembly references are built directly with csc.exe (dotnet is no longer required).
The extern functions do not require a [DllImport ...] attribute so to avoid compiler warnings, include a <NoWarn>0626</NoWarn>
in your .csproj files, and add -nowarn:0626 on the command line for csc.exe.

Compiler
========

  The C# to C++ compiler is written in C# and uses the amazing Roslyn project to analyze code.
I've tried MANY times to use Java's compiler to build a similar project but it just doesn't expose enough symbol information,
and converting Java to C++ or C is impossible (even tried x64 assembly).  The Java language is just too abstract to implement.
Just look at the problems Oracle is having with Graal.

Object Ownership
================

  Object.clone()
  Object.retain() (not possible with pure pointers - need references like the R_ project)
  Object.release()
  Object.pass()

Supported C# features
---------------------

  Not all C# features are implemented yet.  But the basics are covered, including many fixes and improvements from Q#

Corelib
=======

  The Corelib already includes a garbage collector and basic classes (Thread, String, Console, etc.)
The corelib now uses standard C# names (like System.String and System.Object) since I've figured out how to
properly use the -nostdlib / -noconfig options.
You don't have to use Qt, you could use Gtk instead which provides a much easier to use C API but lacks in cross-platform support.
Q# relied too heavily on Qt which resulted in poor performance, so CC# will try to create classes in pure C# or use the C++ stdlib
as much as possible.

Windows
=======
  Download and install VS Build Tools.  Select C++ package.  Enough of C# compiler should be also installed along with it.
  Use the C# compiler in c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Roslyn\

Linux
=====
  To install C# compiler:
    Go to https://www.mono-project.com/download/stable/#download-lin to download latest version of Mono.
    The version in the default repo is probably too old.
    Note: The generated .exe / .dll files are no different than the ones generated in Windows.

Builing
=======
  Most building is done with scripts (scripts are for noobs) and ninja.  Will improve later.

Author : Peter Quiring (pquiring at gmail dot com)

Version : 0.0

Release Date : ?,? 2020

ccsharp's People

Contributors

pquiring avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.