Comments (15)
CubbyFlow provides APIs to support various languages such as Python, Go, Rust, and C #. If you like, I would like to help you support the Jet framework as well. Before that, I'm building a few repositories that generate code for each language in C++, like pybind11.
from fluid-engine-dev.
That would be great. What's the priority for those languages? I'm considering either Go or WinRT for the next pick.
from fluid-engine-dev.
I am considering Python > Go = C# > Rust in order. But others have asked for Kotlin, JavaScript, Lua, and so on. So I'm thinking of implementing these languages as well.
from fluid-engine-dev.
(Just thinking out loud here)
Getting C# binding will be much easier, especially if we use C++/CX (WinRT). Go/Lua binding could be quite challenging due to the difference between C++ and these languages. But if we can come up with C-style (or actual C) wrapper around Jet Framework, that would make Go/Lua binding easier. Kotlin sounds fun, especially for mobile. For JS, it should be more like a porting rather than binding (or wasm?).
I'm now leaning toward C# and pure C wrapper (for Go and Lua) for the first pick, but let's keep the discussion continue for a while before we hear more opinions.
from fluid-engine-dev.
First, I tried to use pybind11 to support the Python API. However, my code didn't use pybind11 because I used C++17 features. Therefore, we are creating pybind17 which supports it. Similarly, we are creating gobind17 and rustbind17. Of course this is not an easy challenge, but I will try to implement it once.
from fluid-engine-dev.
Update: I recently started working on CubbyFlow to support the C# API. In order to support cross-platform, I am working on binding using a library called CppSharp (https://github.com/mono/CppSharp). If I get a good result, I'll also work on the Jet framework and get a pull request.
from fluid-engine-dev.
Amazing news! Thanks for the update, @utilForever. If we can have C# API alongside with Python API, it would be extremely useful.
from fluid-engine-dev.
Update: I apologize for the delay in responding to implementation.
I was in the army for about a month and could not answer.
I'll resume work from today, so please be patient. Thanks.
from fluid-engine-dev.
@utilForever , no problem at all. Welcome back from the training.
from fluid-engine-dev.
Update: I tried to use CppSharp to generate C# or C++/CLI code, but I decided not to use it because I had difficulty using it for various reasons. Instead, I started to write my own C++/CLI code and implement it for use in C#. As a result, I saw the possibility. I've implemented the Frame class for testing, and I've found success in a C# unit test project. I'll implement C++/CLI code for the rest of the code.
https://github.com/utilForever/CubbyFlow/blob/master/Includes/API/CSharp/Animation/Frame.h
https://github.com/utilForever/CubbyFlow/blob/master/Sources/API/CSharp/Animation/Frame.cpp
https://github.com/utilForever/CubbyFlow/blob/master/Sources/API/CSharp/CMakeLists.txt
NOTE: C++/CLI currently supports only the Windows platform. If you want to support cross-platform, I need to consider other methods such as .NET Core(P/Invoke and COM Interop). Alternatively, try using CppSharp again. I wonder if the C# API is okay on the Windows platform. (Please note that in .NET Core I must export CubbyFlow as a dll file. For example, https://blog.quickbird.uk/calling-c-from-net-core-759563bab75d)
from fluid-engine-dev.
@utilForever and I had an offline discussion and decided to revive my old prototype for both C++/CLI and CX. I will create a new branch (let's call it csharp
branch) and port my old code there. It will provide the initial binding mechanism, but no actual wrapper codes. We can add actual wrappers and improve the binding code simultaneously.
The key requirements would be:
- Should support both CLR and WinRT via C++/CLI and CX.
- API should be extensible from C# (or other .NET languages), just like the existing C++ and Python API
- (optional) Once both
csharp
andgpu
branch becomes mature, DX renderer for WPF and WinRT could be added. We also have a prototype for this. Nice-to-have feature, but not a must.
from fluid-engine-dev.
I have verified that the csharp
branch has been created. It still have only an empty project, is the porting done? I would be grateful if you could inform me when it would be okay for me to start working.
from fluid-engine-dev.
Yup it is still empty. Porting would take some time. I will post my update once itβs ready :)
from fluid-engine-dev.
Proof-of-concept code is pushed to csharp
branch.
- Both CLR and WinRT shares
.cpp
files. Language(?) dependent code is controlled with macros. I know it's ugly, but again, this is just a PoC. We can develop on top of this. - Files under
src/csharp/common
contain the shared.cpp
codes. - Files under
src/csharp/clr
andsrc/csharp/winrt
contain language specific codes. You will findmacro.h
files for both projects which defines the same macro interface, but different implementations. - Both CLR and WinRT have minimal unit tests written in C#.
@utilForever please take a look.
from fluid-engine-dev.
@doyubkim Thanks. I'll look at it.
from fluid-engine-dev.
Related Issues (20)
- How do I run the examples and the animations?
- How to run the particles2obj example? HOT 14
- Compile error when compiling with Clang 10 HOT 1
- Promotion of projects/research using Jet Framework HOT 4
- How to implement the xyz to mesh generation to another code for fluid simulation? HOT 1
- How do I set up a fluid particles at rest and a fluid particles with initial velocity HOT 3
- Suggestion to replace Travis CI/Appveyor with GitHub Actions HOT 5
- Some unit tests failure on 32-bit system
- Fix Visual Studio 2017 build failure on GitHub Action
- Timer test code failure on MinGW system
- No known features for CXX compiler "Clang" HOT 5
- running the Python example show error HOT 8
- Replace Clara
- makeTranslationMatrix should be transposed HOT 8
- About the local method in the surface_to_implicit HOT 1
- GridSmokeSolver3::computeDiffusion is diffusing smokeDensity instead of temperature HOT 2
- Incorrect formula for collider boundary conditions (Equation 3.18 in the book)
- can't build cmake in win64 HOT 1
- bug in void Matrix<T, M, N>::invert() in "include/detail/matrix-inl.h" HOT 1
- Newer Versions of Flatbuffer is breaking the build in particle_system_data2.cpp HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluid-engine-dev.