TIHan / Ferop

Ferop is a .NET library that allows inline C/C++ to compile and run on Windows/Linux/OSX. (beta, not production ready)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ferop_icon

Ferop is not maintained but still exists as a reference to the idea of having inline C/C++ code inside of .NET

Ferop is a .NET library that allows inline C/C++ to compile and run on Windows/Linux/OSX.

iOS and Android support is planned.

Quick Start

F#

open Ferop

[<Ferop>]
[<Header("""#include <stdio.h>""")>]
module Native =
    [<Import; MI(MIO.NoInlining)>]
    let printHelloWorld() : unit = C """printf("Hello World!\n");"""

[<EntryPoint>]
let main args =
    Native.printHelloWorld()
    0

C#

namespace Native
{
    using Ferop;

    [Ferop]
    [Header("#include <stdio.h>")]
    class Native
    {
        [Import]
        public static void PrintHelloWorld()
        {
            Ferop.C (@"printf(""Hello World!\n"");");
        }

        static void Main(string[] args)
        {
            PrintHelloWorld();
            System.Console.Read();
        }
    }
}

VB

Imports Ferop

<Ferop>
<Header("#include <stdio.h>")>
Module Native

    <Import>
    Public Sub PrintHelloWorld()
        Call Ferop.C("printf(""Hello World!\n"");")
    End Sub

    Sub Main()
        Call PrintHelloWorld()
        Console.ReadLine()
    End Sub

End Module

About

Ferop is a .NET library that allows inline C/C++ to compile and run on Windows/Linux/OSX. (beta, not production ready)

License:MIT License


Languages

Language:C 94.9%Language:F# 3.8%Language:C++ 1.2%Language:C# 0.0%