Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tremus/cjit

Repository files navigation

CJIT logo

CJIT is a C interpreter based on tinyCC that compiles C code in-memory and runs it live. It is released as a small, all-in-one executable that can do a lot, including call functions from any installed library on Linux, Windows, and MacOSX.

Homepage at Dyne.org/CJIT.

πŸš€ Quick start

Download the latest CJIT release for your system.

Launch CJIT from a terminal console command prompt: one can mix c source files and dynamic libraries as arguments:

./cjit.exe mysource.c mylib.dll

Take a tour with the CJIT tutorial.

πŸ“¦ Download the demo

The CJIT demo package comes with running examples

πŸͺŸ On Windows

iex ((New-Object System.Net.WebClient).DownloadString('https://dyne.org/cjit/demo'))

🍎 / 🐧 On Apple/OSX and GNU/Linux

curl -sL https://dyne.org/cjit/demo.sh | bash

πŸ“– and follow the The CJIT tutorial

βš™οΈ Build from source

There are various build targets, just type make to have a list:

✨ Welcome to the CJIT build system
πŸ›Ÿ Usage: make <target>
πŸ‘‡ List of targets:
 _
 ------ __ Production targets
 linux-x86 🐧 Build a dynamically linked cjit using libs found on Linux x86
 win-wsl πŸͺŸ Build cjit.exe for WIN64 on an Ubuntu WSL VM using gcc-mingw-w64
 win-native πŸͺŸ Build cjit.exe for WIN64 on Windows Server
 apple-osx 🍎 Build cjit.command for Apple/OSX using clang static
 _
 ------ __ Debugging targets
 debug-gdb πŸ”¬ Build using the address sanitizer to detect memory leaks
 debug-asan πŸ”¬ Build using the address sanitizer to detect memory leaks
 self-host πŸ’Ž Build a CJIT that builts itself (embed its source)
 _
 ------ __ Testing targets
 check πŸ§ͺ Run all tests using the currently built binary ./cjit
 check-ci πŸ§ͺ Run all tests using the currently built binary ./cjit
 _
 ------ __ Installation targets
 install πŸ”Œ Install the built binaries in PREFIX
 clean 🧹 Clean the source from all built objects

Manpage

When installed on UNIX systems, CJIT(1) has a manpage! try man cjit after installing.

It is also visible online at dyne.org/docs/cjit.

This manual gives you insights about the CJIT command-line options.

πŸ”¬ Internals

CJIT is a bit complex inside.

  1. It relies on tinycc to compile C code in-memory and run it immediately.
  2. It detects automatically the system on which its running and auto-configures to support most features.
  3. It embeds all C code and headers in cjit/assets making them available to all running code.
  4. To embed them creates a tar.gz of assets at build-time and decompresses them at run-time in a temporary dir.
  5. It ships a non-exclusive, opinionated selection of libraries useful to quickly script advanced applications in C.

The CJIT's Frequently Asked Questions page may provide more information.

πŸ“‘ Acknowledgements

CJIT is copyright (C) 2024-2025 by the Dyne.org foundation. Designed, written and maintained by Jaromil. Free and open source (GNU General Public License v3).

The TinyCC core component is copyright (C) 2001-2004 by Fabrice Bellard. TinyCC is also free and open source (GNU Lesser General Public License).

The CJIT manual offers more information on CJIT licensing.

software by Dyne.org

About

Just in time interpreter for C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

  • C 91.3%
  • Shell 5.7%
  • Makefile 1.1%
  • Assembly 0.9%
  • C++ 0.5%
  • Perl 0.2%
  • Other 0.3%

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /