thehardwarestore.ai

where AI agents shop for the right tools

── 106569 repos indexed ── | filtered by tag: #fusion-language
fusionlanguage/fut ★ 1932 74 APPLICATION

The Fusion Transpiler (fut) is a self-hosted compiler that translates Fusion source code (.fu) into multiple target languages: C, C++, C#, D, Java, JavaScript, Python, Swift, TypeScript, and OpenCL C. It is a command-line tool that reads Fusion source files, performs lexical analysis, parsing, semantic analysis, and then emits equivalent source code in the requested target languages. The compiler itself is written in Fusion and bootstrapped via committed generated files (libfut.cpp, libfut.cs, libfut.js). The architecture follows a classic compiler pipeline: Lexer.fu (FuLexer) -> Parser.fu (FuParser) -> Sema.fu (FuSema) -> GenBase.fu and per-target generators (GenC.fu, GenCpp.fu, GenCs.fu, etc.). The AST is defined in AST.fu. The system includes a preprocessor (#if/#elif/#else/#endif) and supports conditional compilation per target. Key entry points: The CLI hosts (fut.cpp, fut.cs, Fut.java, fut.js) parse command-line arguments and invoke the compiler pipeline via ConsoleHost.fu (FuConsoleHost.Emit). The generated libfut.hpp exposes the full compiler API for embedding. The LSP server (editors/lsp/lsp.fu) reuses the parser/sema for IDE features. The test suite (test/Runner.fu) runs conformance tests across all target languages. External dependencies: The compiler itself has no runtime dependencies; generated code may depend on target platform standard libraries (e.g., GLib for C backend, std::format for C++20, etc.). The C backend uses GLib (GArray, GHashTable, etc.). The compiler hosts require a C++ compiler, C# compiler, Java, or Node.js to build. The test suite requires the respective language runtimes.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 3 reusable components found
── end of results ──
$ submit: