How fus3n/pyle works
Pyle is an embeddable C++ scripting language. Its principal workflow takes script text through lexing, parsing and bytecode compilation, then executes it in a stack-based VM with native bindings and standard modules. The repository also provides a CLI, a language server and a VS Code extension. The README documents these product capabilities; sampled source supports some internal calls, while unsampled modules are represented by their exact tree paths and their connections are omitted or marked unverified.
Main entry points: main.cpp Pyle CLI · std_core.cpp Core functions · lsp_server.hpp Language server · parser.cpp Parser
Components 22
Language Runtime
- Embedding API
libpyle/src/pyle.cpp - Lexer
libpyle/src/lexer.cpp - Parser
libpyle/src/parser.cpp - Syntax tree
libpyle/include/pyle/ast.hpp - Bytecode compiler
libpyle/src/compiler.cpp - Bytecode format
libpyle/include/pyle/bytecode.hpp - Virtual machine
libpyle/src/vm.cpp - Values and heap
libpyle/include/pyle/value.hpp - Native bindings
libpyle/include/pyle/binder.hpp
Native Capabilities
- Core functions
libpyle/src/std/std_core.cpp - Collections
libpyle/src/std/std_array.cpp - Coroutines and futures
libpyle/src/std/std_future.cpp - Process support
libpyle/src/std/std_proc.cpp - HTTP module
pyle/src/std/http - JSON and crypto
pyle/src/std
Developer Tools
- Pyle CLI
pyle/src/main.cpp - Language server
pyle-lsp/src/lsp_server.hpp - Document resolver
pyle-lsp/src/lsp_resolver.hpp - Language analyzer
pyle-lsp/src/lsp_analyzer.hpp - LSP transport
pyle-lsp/src/lsp_transport.hpp
Editor Integration
- VS Code extension
editors/vscode/src/extension.js
Other components
- Script author
Connections 22
- Script author → Pyle CLI: runs script
- Pyle CLI → Embedding API: executes source
- Embedding API → Lexer: tokenizes
- Lexer → Parser: supplies tokens
- Parser → Syntax tree: builds tree
libpyle/src/parser.cpp - Parser → Bytecode compiler: provides syntax
- Bytecode compiler → Bytecode format: emits instructions
libpyle/src/compiler.cpp - Bytecode compiler → Virtual machine: loads executable code
- Virtual machine → Values and heap: manages values
libpyle/src/vm.cpp - Pyle CLI → Core functions: registers natives
pyle/src/main.cpp - Pyle CLI → HTTP module: registers module
pyle/src/main.cpp - Pyle CLI → JSON and crypto: registers modules
pyle/src/main.cpp - Core functions → Native bindings: binds host functions
libpyle/src/std/std_core.cpp - Core functions → Coroutines and futures: uses futures
libpyle/src/std/std_core.cpp - Core functions → Collections: provides collections
- Pyle CLI → Process support: initializes workers
pyle/src/main.cpp - Script author → VS Code extension: edits scripts
- VS Code extension → Language server: uses language services
- Language server → LSP transport: exchanges messages
pyle-lsp/src/lsp_server.hpp - Language server → Document resolver: loads documents
pyle-lsp/src/lsp_server.hpp - Language server → Language analyzer: analyzes documents
pyle-lsp/src/lsp_server.hpp - Document resolver → Language analyzer: uses analysis
pyle-lsp/src/lsp_resolver.hpp