ComLightInterop

Cross-platform COM interop library for .NET Core 2.1 or newer (by Const-me)

ComLightInterop Alternatives

Similar projects and alternatives to ComLightInterop

  1. Godot

    Godot Engine – Multi-platform 2D and 3D game engine

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. zig

    General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

  4. .NET Runtime

    .NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.

  5. book

    The Rust Programming Language

  6. yuzu

    Discontinued Nintendo Switch emulator

  7. tauri

    Build smaller, faster, and more secure desktop and mobile applications with a web frontend.

  8. imgui

    Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies

  9. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  10. Ryujinx

    Discontinued Experimental Nintendo Switch Emulator written in C#

  11. csharplang

    The official repo for the design of the C# programming language

  12. serde

    Serialization framework for Rust

  13. Rocket

    A web framework for Rust.

  14. neutralinojs

    Portable and lightweight cross-platform desktop application development framework

  15. xemu

    Original Xbox Emulator for Windows, macOS, and Linux (Active Development)

  16. Windows UI Library

    WinUI: a modern UI framework with a rich set of controls and styles to build dynamic and high-performing Windows applications.

  17. pybind11

    Seamless operability between C++11 and Python

  18. SWIG

    SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.

  19. winforms

    Windows Forms is a .NET UI framework for building Windows desktop applications.

  20. ioccc-obfuscated-c-contest

    IOCCC International Obfuscated C code contest entries

  21. SQLProvider

    A general F# SQL database erasing type provider, supporting LINQ queries, schema exploration, individuals, CRUD operations and much more besides.

  22. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better ComLightInterop alternative or higher similarity.

ComLightInterop discussion

Log in or Post with

ComLightInterop reviews and mentions

Posts with mentions or reviews of ComLightInterop. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-11-16.
  • Stop Making Me Memorize the Borrow Checker
    6 projects | news.ycombinator.com | 16 Nov 2024
    > I think Rust strikes a pretty good balance with it though

    I don’t like that balance.

    For performance-critical things like BLAS and other low-level numerical stuff, C++ is safer than unsafe Rust because standard library and tooling (debug heap, debug allocators, ASAN, etc.) evolved for decades making the language usable despite the unsafety. Another thing, for numerical code you probably need SIMD intrinsics. They were defined by Intel, documentation and other learning resources almost exclusively target C language; C++ got them for free due to compatibility.

    For high-level pieces which are not that performance critical, I use C#. Due to VM, it’s safer than Rust. Due to GC and other design choices usability is way better than Rust, e.g. in C# asynchronous I/O is almost trivial with async/await. The runtime is cross-platform, I have shipped production-quality embedded ARM Linux applications built mostly with C#. Unlike Java, it’s easy to consume unmanaged C++ DLLs using C API, or even C++ API: see that library to do that on Linux which doesn’t have COM interop in the runtime https://github.com/Const-me/ComLightInterop

  • Writing GUI apps for Windows is painful
    23 projects | news.ycombinator.com | 30 Jun 2024
    I do not recommend C++ CLI.

    Can you elaborate on why?

    I looked at various ways for interop between C# and C++ over the years, and overall found C++/CLI to be the best overall for our particular application types: it's a separate layer bewteen a C++ backend (which is also used in other non-gui applications), with a windows-only WPF desktop application on top. Mainly because the C++/CLI code itself is simple, readable and fairly effortless to write and maintain. A bit repetitive at times though. Integration on the C# is seamless, with code completion etc, and C# interfaces can be implemented in C++/CLI directly for instance. The initial setup takes some work but with conversion between common types implemented (ability to e.g. IEnumerable <-> std::vector or std::iterator etc) it's all pleasant and good.

    or check this library of mine https://github.com/Const-me/ComLightInterop/

    Gotta say this looks neat, but it's exactly the type of code I'd rather not write: UUIDs, bunch of macros, unclear mapping beetween return types (HRESULT vs bool), having to declare same interfaces both in C++ and C#, ...

  • Swig – Connect C/C++ programs with high-level programming languages
    5 projects | news.ycombinator.com | 18 Jul 2023
    I have once made something remotely similar, to interop between C++ and C#: https://github.com/Const-me/ComLightInterop

    I took different approach. Because I only needed to support these two languages, there’s no separate interface definition language, and no code generator for interfaces. Instead, users are expected to write both language projections manually.

    Then there’s a runtime code generator on the .NET side of the interop which builds runtime callable proxy types for interfaces implemented in C++, also virtual tables for C# objects consumed by C++.

  • C# 11 Preview Updates – Raw string literals, UTF-8 and more
    5 projects | news.ycombinator.com | 22 May 2022
    It’s pretty fast. Likely reason for that, MS designed both language and runtime this way since version 1.0. They needed that for their Windows Forms which consumes huge chunk of WinAPI.

    I benchmarked a while ago when testing this library https://github.com/Const-me/ComLightInterop#performance On the computer I was using at that time (probably Ryzen 5 3600 CPU) the overhead was 15-20 nanoseconds per call.

  • Mach v0.1 – cross-platform Zig graphics in ~60 seconds
    4 projects | news.ycombinator.com | 27 Mar 2022
    That thing is COM, which is a small subset of C++ ABI. Technically it’s about the same as on Windows, i.e. C ABI with extra first argument for this pointer.

    Once upon a time I made this library https://github.com/const-me/comlightInterop/ The native side of the interop is idiomatic C++, here’s an example https://github.com/Const-me/ComLightInterop/blob/master/Demo... The C# side of the interop is implemented through the built-in C interop, here’s the relevant part of the library https://github.com/Const-me/ComLightInterop/blob/master/ComL... I’ve tested Linux version of that library on AMD64, ARMv7, and ARM64 CPUs, but only with gcc compiler on the native side.

  • COM+ Revisited
    2 projects | news.ycombinator.com | 30 Jan 2022
    I like many parts of COM, but I believe that example mostly demonstrates bad parts, with IDL, registrations, and over-engineered support libraries.

    There's nothing wrong with exporting factory functions from DLLs. Microsoft does it all the time, APIs like Direct3D, DirectDraw and Media Foundation don't come with type libraries are they aren't registered anywhere.

    Speaking about support libraries, I once made my own: https://github.com/Const-me/ComLightInterop/tree/master/ComL... Compare examples from that article with this one: https://github.com/Const-me/ComLightInterop/blob/master/Demo... That source file is the complete DLL which implements a minimalistic COM object.

  • The Serde Rust Framework
    14 projects | news.ycombinator.com | 14 Oct 2021
    > Does it feel "brittle" to use

    Yes and no.

    No because when you try to do unsupported things like calling a method on an object which doesn’t support one, you gonna get an appropriate runtime exception.

    Yes because if you fail lower-level things like local parameter allocation, you gonna get an appropriate runtime exception but that one is (1) too late, I’d prefer such things to be detected when you emit the code, not when trying to use the generated code (2) Lacks the context.

    Overall, when I can I’m using that higher-level System.Linq.Expressions for runtime codegen. Things are much nicer at that level. I only using the low-level thing when I need to emit new types, like there: https://github.com/Const-me/ComLightInterop/blob/master/ComL...

  • Weird
    5 projects | news.ycombinator.com | 28 Aug 2021
  • Building a shared vision for Async Rust
    4 projects | news.ycombinator.com | 18 Mar 2021
    > Do you have any good resources on writing dlls to consume via .net like you’re talking about?

    For C APIs i.e. functions, structures and strings, the good resource is Microsoft documentation, the support is built-in, see “Consuming Unmanaged DLL Functions” section: https://docs.microsoft.com/en-us/dotnet/framework/interop/

    For COM APIs i.e. sharing objects around see this library + demos: https://github.com/Const-me/ComLightInterop It’s only really needed on Linux because the desktop version of the framework has COM support already built-in, but it can be used for cross-platform things just fine, I tested that quite well i.e. not just with these simple demos.

    > How do you deal with the managed memory when using the gc from .net

    Most of the time, automatically.

    When you calling C++ from C#, the runtime automatically pins arguments like strings or arrays. Pinning means until the C++ function returns, .NET GC won’t touch these things. This doesn’t normally make any copies: C++ will receive raw pointers/native references to the .NET objects.

    Sometimes you do want to retain C# objects from C++ or vice versa i.e. keep them alive after the function/method returns. An idiomatic solution for these use cases is COM interop. IUnknown interface (a base interface for the rest of COM interfaces) allows to retain/release things across languages.

  • Experimental Nintendo Switch Emulator written in C#
    8 projects | news.ycombinator.com | 13 Mar 2021
    C++ interop is not supported in modern .NET out of the box, but wasn't too hard to implement as a library: https://github.com/Const-me/ComLightInterop
  • A note from our sponsor - SaaSHub
    www.saashub.com | 16 Mar 2025
    SaaSHub helps you find the best software and product alternatives Learn more →

Stats

Basic ComLightInterop repo stats
11
49
6.2
7 months ago

Sponsored
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai

Did you know that C# is
the 10th most popular programming language
based on number of references?