hexagonal-sun/bic logo

hexagonal-sun/bic

Free

A C interpreter and API explorer.

FreeFree tier
Type
Open Source

About hexagonal-sun/bic

Bic (short for 'C interpreter') is a tool that provides a Read-Eval-Print Loop (REPL) for the C programming language, allowing developers to interactively explore and test C APIs. It supports #including system headers, declaring variables, and executing C statements directly without needing to write a full program. Bic includes an inspector that can display detailed information about variables and types when prefixed with '?'. It is open-source and builds on Linux, macOS, and via Docker. Dependencies include GNU Readline and GNU MP. The project is hosted on GitHub under the hexagonal-sun organization.

Key Features

Interactive REPL for C programming language
Allows #include of system headers for API access
Inspector mode (prefix with ?) shows type, value, size, and declaration location
Startup file (~/.bic) for automatic environment setup
Supports building via Docker for easy deployment
Cross-platform: Linux, macOS (via Homebrew), and Arch Linux (via AUR)

Pros & Cons

Pros
  • Provides immediate feedback for C statements and expressions
  • Allows calling real C library functions (e.g., fopen, fputs) interactively
  • Inspector gives detailed information about variables and types
  • Open-source and freely available under a permissive license
  • Supports cross-platform installation via Docker and package managers
Cons
  • Requires building from source with multiple dependencies (Flex, Bison, Automake, etc.)
  • No precompiled binaries are provided for quick setup
  • As an interpreter, it may not support all C language features or edge cases
  • Primarily designed for exploration, not for production code execution

Best For

Testing C library functions and system calls interactivelyExploring and learning C APIs without writing a complete programDebugging small C code snippets in a REPL environmentPrototyping C-based software or algorithmsTeaching or demonstrating C concepts in a classroom setting

FAQ

What is bic?
Bic is a C interpreter and API explorer that provides a REPL (Read-Eval-Print Loop) for testing and exploring C APIs interactively.
How do I install bic?
Bic can be built from source using autoreconf, configure, make, and make install. Dependencies include GNU Readline, GNU MP, Flex, GNU Bison, GNU Automake, GNU M4, and GNU Autoconf Archive. It can also be built via Docker or installed from the Arch Linux AUR.
How do I use the inspector in bic?
In the REPL, prefix a variable or type name with '?' (e.g., '?stdout') to see its type, value, size, and declaration location.
Can I include system headers in bic?
Yes, you can use #include directives in the REPL to access system headers and their APIs.