Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on libtcc #50

Closed
bentxt opened this issue Feb 25, 2023 · 2 comments
Closed

Question on libtcc #50

bentxt opened this issue Feb 25, 2023 · 2 comments

Comments

@bentxt
Copy link

bentxt commented Feb 25, 2023

Hi
I'm interested in cyber, but there a few points in the documention that raises a fundamental question on the 'philosophy' behind the extensibility of cyber.

I had the expectation that with the help of the host beeing written in Zig, the simple extensibility of cyber would be an important feature. But instead there is this whole bit on C compatibility and the introduction of the libtcc dependency.

https://fubark.github.io/cyber/docs/toc/ffi/

Cyber supports binding to an existing C ABI compatible library at runtime.
and
Cyber uses libtcc to JIT compile the bindings so function calls are fast

Why? Sounds pretty complicated, I mean there is Zig ...

On the other hand there is no documentation on Embedding yet.

Could you help me to understand on how this is thought out? It's very good possible I get something wrong here, or at least I miss something here.

Thanks

@fubark
Copy link
Owner

fubark commented Feb 25, 2023

FFI is for your scripts to call into libraries. Embedding is for adding the Cyber compiler and interpreter into your own app. For that there are examples: https://github.com/fubark/cyber/tree/master/examples/c-embedded and https://github.com/fubark/cyber/tree/master/examples/web-playground

@fubark
Copy link
Owner

fubark commented Mar 30, 2023

Please open another issue if you are still having issues/questions. I am aware that Embedding docs is not available, I want to use it myself in an actual project before I finalize the API. But you can definitely use Cyber for embedding.

@fubark fubark closed this as completed Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants