2025-12-22 14:00:24 +08:00
2025-12-20 21:40:57 +08:00
2025-12-23 11:45:50 +08:00
2025-12-19 20:38:40 +08:00
2025-12-21 11:48:46 +08:00
2025-12-19 20:38:40 +08:00
2025-12-19 20:38:40 +08:00
2025-12-20 21:54:09 +08:00

Fig Language - A Modern Scripting Language

简体中文

Fig is a statically-typed, expression-oriented programming language designed for clarity, safety, and modern development practices. With features inspired by Go, Rust, and JavaScript, Fig aims to provide a productive development experience while maintaining strong type safety.

Features

🚀 Core Language Features

  • Static typing with type inference - Strong typing with minimal annotations
  • Modern control flow - Full for loop support with proper scoping
  • First-class functions - Lambda expressions and closures
  • Rich data structures - Structs, lists, maps, and tuples
  • Memory safety - No null pointer exceptions, automatic memory management

🔧 Technical Highlights

  • Three-level scoping for loops - Proper variable isolation in iterations
  • Smart semicolon handling - Flexible statement termination with RAII guards
  • Comprehensive error handling - Detailed error messages with source locations
  • Clean C++ implementation - Modern C++23 with RAII and smart pointers

📁 Project Structure

Fig/
    ├── src/
    │ ├── lexer.cpp             # Lexical analysis
    │ ├── parser.cpp            # Syntax analysis
    │ ├── evaluator.cpp         # Interpreter/execution engine
    │ └── value.cpp             # Type system implementation        
    ├── include/
    │ ├── argparse
    │ ├── magic_enum 
    │ ├── Ast                   # Abstract syntax tree definitions
    │ ├── value.hpp             # Type system header
    │ ├── Value/                # Type system definitions
    │       ├── ...
    │ ├── AstPrinter.hpp        # Ast printer
    │ ├── context(_forward).hpp # Environment/Context system
    │ ├── core.hpp              # Core informations
    │ ├── error.hpp             # Exception system
    │ ├── errorLog.hpp          # Colored-Print error log
    │ ├── fig_string.hpp        # Fig UTF-8 string
    │ ├── module.hpp            # Package/Module system
    │ ├── utils.hpp
    │ ├── token.hpp             # Token definitions
    │ ├── lexer.hpp             # Lexical analysis
    │ ├── parser.hpp            # Syntax analysis and AST
    │ ├── evaluator.hpp         # Interpreter and Control flows
    │ ├── warning.hpp           # STD-Warnings
    ├── ExampleCodes/           # Sample programs
    ├── fig-vscode/        # vscode extension
    ├── .clang-format           # Clang format styles
    ├── test.fig                # Test file (dev)
    ├── LICENSE                 # Fig project license
    ├── xmake.lua               # XMake configurations
    └── Logo/                   # Fig's Logo

Language Philosophy

Fig is designed around several core principles:

Clarity over cleverness - Code should be readable first

Safety by default - Prevent common errors at compile time

Modern ergonomics - Developer experience matters

Gradual learning - Simple to start, powerful when needed
Description
The Fig Programming Language
Readme MIT 1.6 MiB
Languages
C++ 99.6%
Lua 0.1%
TypeScript 0.1%
JavaScript 0.1%