zFFI
CBindgen FFI test
How to run
Execute:
$> zig build cargo # to build rustlib
$> zig build run # to run
CBindgen FFI test
License: The Unlicense
CBindgen FFI test
Execute:
$> zig build cargo # to build rustlib
$> zig build run # to run
union
and struct
supportunion
| struct
, only anonymous literals (requires review)This experiment refers to the development of the zig-bindgen
branch.
Below you will find errors during the translation that should be corrected.
generated/binding.zig: [ FFI Work]
const std = @import("std");
pub const Doggo = extern struct {
age: i32,
name: [*:0]const u8,
};
pub extern fn call_name(ptr: ?*Doggo, name: [*:0]const u8) anyopaque;
pub extern fn is_whitespace(byte: u8) bool;
pub extern fn mul(value1: usize, value2: usize) usize;
pub extern fn add(value1: usize, value2: usize) usize;
Generated:
const std = @import("std");
pub const Doggo = extern struct {
age: i32,
_name: ?fn, // type error
};
// missing pub keyword to public functions
extern fn call_name( _ptr: ?fn, const constname: ?fn) anyopaque; // flags type error
extern fn is_whitespace(byte: u8) bool;
extern fn mul(value1: usize, value2: usize) usize;
extern fn add(value1: usize, value2: usize) usize;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.