c++ just in time compiler.more info at: http://www.jyt.io/guide
10K+
Jyt is an LLVM based just-in-time compiler for C++ 14.
Jyt enables you to iterate quickly over your ideas and explore APIs by providing you with an interactive programming experience in a REPL. We also support hot-module reloading, with a few limitations.
sudo apt-get install -y wget bzip2 make cmake g++-5 clang-3.6 llvm-3.6 opensslsudo dpkg -i Jyt.debJyt.app to /Applicationsjyt into usr/local/binType the following to get into the Jyt REPL:
sudo docker run -it loopperfect/jyt jyt
If you would like to mount a local folder, use the following:
sudo docker run -v `pwd`/src:/src -it loopperfect/jyt jyt
All arguments you append to the end will be passed to jyt.
If you ommit the jyt at the end of the command, it will go straight to your container's bash.
Launch Jyt at the command line, or double-click the app:
$ jyt
Start writing C++!
"Hello world"
There is currently no way to clear history or undo executions.
Close Jyt and relaunch it for a blank slate.
We support a limited form of hot-reloading for files in the working directory. Hot-reloading is where the compiler detects changes to your source files and integrates them automatically. You can see a demo of this on our YouTube channel.
To use hot-reload, specify the --hot flag when you start Jyt. Now when you save a file, it will automatically be re-compiled into the running program.
Currently, the hot-reloader simply re-evaluates files that have changed. If you have an include guard, this will have no effect. However, Jyt will define JYTTER, when using Jyt, and JYT_HOT when hot-reload is enabled. These preprocessor flags will allow you to control the hot-reload process.
We also do not allow you to redefine functions or classes; only lambdas can be modified. This is a limitation that will be fixed in later versions. You can see how a program can be written in this style on our GitHub.
Lets call meaning() from meaining.cpp and jump into interactive mode (-i):
//meaning.cpp
#include <iostream>
void meaning() {
std::cout << 42 << std::endl;
}
jyt meaning.cpp -i # prints 42
$ meaning(); // write more c++
Jyt enables meta-programming capabilities at run-time through a run-time object. For example, you can evaluate a C++ string:
$ jyt
#include <string>
#include <jyt/runtime.hpp>
std::string inc = "iostream";
std::string s = "std::cout << 42 << endl;";
jyt.include(inc);
jyt.eval(s); // prints 42
$ jyt
#include <jyt/runtime.hpp>
jyt.addIncludePath("/path/to/includes");
jyt.addIncludePath("/path/to/libs");
jyt.linkLibrary("myLib.so");
#include <myLib.h>
myLib::func();
The current implementation of std::thread and std::async doesn't run in a seperate thread.
However, we implemented void Async(auto func);, which does run in a real thread. In the future we intend to make this function obsolete and fix std::thread.
$ jyt
#include <jyt/runtime.hpp>
#include <iostream>
auto f = [](){ std::cout << "Hello from another thread" << std::endl; }
jyt.async(f)
Usage: jyt -x a.cpp b.cpp c.cpp
Includes all listed files and executes functions with share the filename e.g. jyt -x primes.cpp executes primes() from primes.cpp
Usage: jyt -e a.cpp b.cpp
Includes all listed files and executes in script mode. This means basicallly an line-by-line execution within a "virtual" main function. If you want to define a function you need to mark it as extern.
extern template<class T> auto test(T){ return sizeof(T); }
Usage: jyt -x a.cpp -e b.cpp -i
Starts the REPL after executing all files. Jyt starts in this mode if you don't pass any arguments
#define main main_tstd::map and std::vector are slowjyt -x a.cpp a.cpp doesn't work. Work-around: include and call in script modeJyt may be used for commercial or non-commercial use. However, you may not modify it or sell it. We provide no warranty for Jyt. Please refer to the full license for more information.
The beta version of Jyt collects usage statistics. These are:
The code you send to Jyt is never collected.
Jyt is built using the following open-source components:
Content type
Image
Digest
Size
457.8 MB
Last updated
over 10 years ago
docker pull loopperfect/jyt