Flicker 1 was written in Kotlin. It used an AST and an interpreter. It was painfully slow and wasn't even finished.
Flicker 2 was written in C. It used bytecode in a VM. It was nice and fast, and it had lots of nice features.
Flicker 3 will be...
- implemented in C++
- turned into an AST, then optimized, converted into bytecode, and run in a VM
- statically typed
- (hopefully) faster in runtime
- and, above all, it will be...
click to end the suspense...
sorry, I needed a bit more suspense...
It will be FUN! Both to implement and to use!
You can't use Flicker yet, in the full sense, but you can test it. Here's what I'm implying by making this distinction: the language won't work how you expect it to, but I'd appreciate reports of non-obvious bugs.
To test flicker:
- Download or clone this repo.
- Make sure you have CMake (at least 4.0) and Ninja installed.
- Make sure you have a C++ compiler capable of using the C++20 standard.
- Only for now (because ANTLR will be removed once I have my own parser):
- Install the ANTLR 4 C++ runtime (antlr.org/download.html, scroll to C++ target). On macOS, you can download the binary; on Linux you must build from source.
- Adjust the ANTLR4 SETUP section in
CMakeLists.txt, correcting the paths for your system's installation of the C++ runtime.
- One-time setup: run
cmake -S . -B buildto configure CMake's build directory. - Run
cmake --build --target flicker_3 --preset release(use--preset debugif you prefer). - The executable will be in
build/flicker_3. Make it executable if necessary, then run it by itself for a REPL, or with a file path as an argument. - Chances are, you'll want to mess around with debug flags in
h/common.h. For example, if you'd rather just print tokens instead of exporting as a DOT tree for GraphViz. Change whatever, but remember to rebuild.
Of course, you can build with clang++ or g++ if you prefer.
CMake can make your life easier, but it can also be bothersome to set up.
Curated by none other than Someone.
It is currently unknown why this language is called Flicker. This question has sparked many debates in the hypothetical online forum. At the moment, there are a few circulating fan theories (it is important that I clarify these are only rumors):
- The Developer enjoys candles.
- The language is intended to be easy to write. Merriam-Webster, the Developer's favorite dictionary and thesaurus (citation needed), lists the following as an
example sentence for the word Flicker: "Thoughts flickered through his mind."
The intent of Flicker is to allow the user to capture their thoughts in code... as quickly as they flicker through the user's mind. - The Developer chose a random two-syllable word that was not taken.
- A flicker is a bird (Colaptes auratus). The Developer has been documented reading Crafting Interpreters by Bob Nystrom. Bob Nystrom occasionally names his programming languages after birds (Wren, Magpie, Finch, and Lark). Okay, I admit this is a stretch.