mach.net #1118
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach#1118
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dotnet bindings for mach/libmach with
Is this something you'd like to work on?
My intention is for Mach to only expose a C API (libmach, as you found) and bindings for a single other language that I feel comfortable maintaining (Go), and then letting the community maintain bindings for other languages such as DotNet
Yes. It is highly dependent on the C api however what is a good C api for C applications is not always a good API for high level applications. Call to API:s usually cost more in high level languages but is not "free" in C either. My suggestion is to think about how to avoid making C API calls and use other forms of communication such as "lock-free" lists in shared memory with the application and the api having two different threads. With this the application can lay out all the data needed to render a scene and then the api is informed that the data is ready and renders the scene. This can be significantly faster than having lots of calls building up the scene internally inside the API/engine. It can be useful to think of it as a client-server protocol where the application is the client and where modifying shared data is way faster than making a function call as different form of communication.
All of this mostly benefits clients written in languages like C and C# that has easy to use ways to work with structured data in memories.
As far as creating bindings go there are tools that does this with header files and I intend to explore that. Such tools exist for many languages and well written header files usually work in all, however it depends on not mixing headers that define the API with actual code that makes them hard to interpret. So generating bindings for C# is a very similar problem to generating bindings for Java, Python etc.