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

How do you run or compile a c file #1

Open
andre-dietrich opened this issue Nov 20, 2018 · 1 comment
Open

How do you run or compile a c file #1

andre-dietrich opened this issue Nov 20, 2018 · 1 comment

Comments

@andre-dietrich
Copy link

Hi, I was curious if it is possible to execute a simple C-file with your demo, but I could not find any way ... If it is possible, could you pass me a little javascript snippet how to interpret a C file with tcc in the browser?

Regards,

André

@kungfooman
Copy link
Owner

Hi @andre-dietrich, this was just a proof of concept. To actually make use of this, tcc would need a WebAssembly backend (or x86 to WebAssembly converter or something). I have not seen such fork yet (I would be a bit interested aswell). Till now, I can just recommend you to use emscripten. If you want to dynamically compile C in the browser, just use e.g. AJAX and return the WebAssembly ArrayBuffer full of assembly instructions and execute it.

Regards,

Hermann

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