Meet Clang REPL, a C++ command prompt

🚀 Suitable for exploratory programming and in places where time to gain insights is important.


Meet Clang REPL, a C++ command prompt


We have already published about Cling which has similar features to Clang REPL, but Clang REPL is an alternative already available for those who already have Clang/LLVM installed on their own system. If you don’t have it installed yet, see the links below:

Clang-Repl is an interactive C++ interpreter that allows incremental compilation.

Clang-Repl is suitable for exploratory programming and in places where time to gain insights is important. Clang-Repl is a project inspired by the work of Cling, a C/C++ interpreter based on LLVM.


Usage

To start Clang REPL, just type this command in the terminal:

clang-repl

A sub-shell will automatically start where you can run the commands, but first you need to include the desired library. For example, to use std::cout we need to include the iostream library:

clang-repl> #include <iostream>

And then, just test it by printing something:

clang-repl> std::cout << "Hello, CLANG REPL!\n";

Hello, CLANG REPL!
clang-repl>

To exit clang-repl just press %quit:

clang-repl> %quit

In other words, simple and intuitive! > Remember that clang-repl does not interpret [Backspace] and does not use the readline lib to store commands in the history.


For more information, visit: https://clang.llvm.org/docs/ClangRepl.html.


clang llvm cpp clanguage


Share


YouTube channel

Subscribe


Marcos Oliveira

Marcos Oliveira

Software developer
https://github.com/terroo

Related articles