Felidae is a functional logic language for .fx files where code and data share
the same shape. Facts act as a lightweight database, methods transform and query
those facts explicitly, and native modules keep heavy work outside the core
interpreter.
The repository contains two C++ products:
felidae.exe: the lean execution runtime for running programs and queries.celidae.exe: the diagnostics, debugging, analytics, LSP, and visualization host used by editor integrations.
Facts are stored data:
Person(name: "Alice", role: "Engineer")
Person(name: "Bob", role: "Manager")
Methods use explicit named inputs and immutable bindings:
main(arguments: system.stdin) =>
engineers := lambda(Person, p => p.role == "Engineer")
return (
count: count(engineers),
args: arguments.args
)
Statements end at a newline, not a trailing . — . is reserved for decimals
and same-line member access (a.b.c). Commas between goals in a body are
still accepted but are optional; a bare newline separates goals just as well.
See docs_language.md for the full grammar, and
v2_examples for reference programs. examples/ still holds
programs written for the older dot-terminated grammar.
Felidae does not implicitly scan all facts from a method call. Use
lambda(FactType, item => expression) or an explicit list/array when iteration
is required. This keeps dataflow visible and makes performance easier to reason
about.
Run a program:
build\felidae.exe examples\main.fxRun a query:
build\felidae.exe examples\main.fx "? Employee(name: name)"Check a file with structured diagnostics:
build\celidae.exe examples\main.fx --check-jsonStart the Celidae JSON-RPC language server:
build\celidae.exe --lspCreate a visualization snapshot:
build\celidae.exe examples\main.fx --visualize-data-json --load-imports
build\celidae.exe examples\main.fx --visualize-data-html --load-importsbuild\felidae_debug.exe is still built as a legacy compatibility binary for
older editor installs.
Use the platform build wrapper when possible:
./build.shbuild.sh detects Linux and macOS hosts, asks before using sudo to install
missing build dependencies, and builds build/felidae, build/celidae, and
build/felidae_debug. Supported dependency installers include apt
(Debian/Ubuntu), dnf (Fedora), zypper (openSUSE), pacman (Arch), and Apple
Command Line Tools/Homebrew on macOS.
On Windows:
.\build.cmd
.\build.cmd native --configuration production
.\build.cmd --target windows-x64 --configuration release
.\build.cmd --target windows-arm64 --configuration releaseBuild configurations are debug, release, production, and sanitize.
Production builds use -O3, NDEBUG, LTO, and lld. Build targets include
native, windows-x64, windows-arm64, linux-x64, linux-arm64,
macos-x64, macos-arm64, android, and wasm. Cross-targets require the
matching platform SDK/toolchain; for Ubuntu LTS package verification, run the
Linux target inside the intended Ubuntu 22.04 or 24.04 build container/runner.
Android is available as an NDK cross-build target when the NDK is installed:
ANDROID_NDK_HOME=/opt/android-ndk ANDROID_ABI=arm64-v8a ./build.sh --target androidBuild the browser playground runtime with Emscripten when docs code blocks need in-browser execution:
On Windows:
.\build.cmd wasmOn Linux/macOS:
./build.sh --target wasmWithout host Emscripten, use Docker:
./build/felidae wasm.fxwasm.fx calls emcc.fx, which uses the common docker.fx helpers with emscripten/emsdk:latest, mounts the repository, and runs the same ./build.sh --target wasm path inside the container.
That emits docs/wasm/felidae_wasm.js, docs/wasm/felidae_wasm.wasm, and docs/wasm/felidae_wasm.data, with core/*.fx packaged for language-native imports.
Linux packages can be created after a successful native Linux build:
scripts/package-linux.shThe package helper always creates a tarball and creates .deb, .rpm, or
.pkg.tar.zst packages when local distro packaging tools are available.
CMake targets are also provided for environments that prefer generated build files:
cmake -S . -B build
cmake --build buildRun the reusable Felidae test suite:
build\felidae.exe examples\felidae_test_suite.fxUseful focused checks:
build\celidae.exe examples\diagnostics_ast_warnings.fx --check-json
build\celidae.exe examples\invalid\undeclared_body_var.fx --check-json
build\celidae.exe examples\main.fx --visualize-data-json --load-importsRun the production quality gate:
.\scripts\run_quality.ps1 -Configuration production -RunFullExamplesOn Linux or WSL, the same quality gate can also run Valgrind when installed:
./scripts/run_quality.sh --configuration production --full-examplesThe quality scripts run the stricter compiler build, clang-tidy, cppcheck
when installed, CodeChecker when installed, Valgrind on Linux when installed,
and Felidae .fx smoke or regression programs. Reports are written to
build/quality/report.md.
Native modules are declared in core/*.fx and implemented in C++ modules under
native_modules/. The interpreter validates typed arguments before calling a
native function, so a bad user call fails at the Felidae layer rather than
crashing a shared library.
See docs_native_modules.md for the native ABI.
The VS Code extension is in vs-code-extension. It provides syntax highlighting, file icons, snippets, import navigation, hovers, CodeLens actions, debugger integration, Celidae-backed Problems diagnostics, and a data visualizer with SVG/HTML export.
Development commands:
cd vs-code-extension
npm install
npm run compile
npm run lint
npx vsce packageInstall the generated VSIX:
code --install-extension felidae-vscode-0.0.2.vsixThe IntelliJ plugin is in intellij-idea-extension. It
registers .fx files, highlights Felidae syntax, delegates diagnostics to
Celidae --check-json, and adds run/check/visualize actions.
Development commands:
cd intellij-idea-extension
.\gradlew.bat runIde
.\gradlew.bat buildPluginIf Gradle is not cached locally, the first build needs network access to fetch the Gradle distribution and IntelliJ Platform dependencies.
- docs_language.md: language notes and runtime behavior.
- docs_native_modules.md: native module loading and ABI.
- docs_github_linguist.md: GitHub language detection notes.
- tree-sitter-felidae: starter grammar for future editor and GitHub navigation work.
Felidae source files use .fx. .gitattributes marks them as Felidae, but
GitHub will show Felidae as a first-class language only after GitHub Linguist
adds upstream support for the language.