How klemmbaustein/dsharp works
D# is an embeddable, statically typed scripting-language library. Its principal workflow is host- or file-supplied script text, parsed and compiled into bytecode, then run by the runtime; native bindings and standard-library modules extend what scripts can access. The repository also includes JIT/debugging and editor-language-service capabilities. Edges are limited to relationships explicit in the supplied excerpts or README; some implementation links, especially around JIT and library registration, remain unverified.
Main entry points: parser.hpp Parse context · system.cpp System modules · bytecode.hpp Bytecode stream · justInTimeCompiler_x64.cpp JIT compiler
Components 24
Parsing and types
- Parse context
include/ds/parser/parser.hpp - File scanning
include/ds/parser/parseFile.hpp - Class parsing
include/ds/parser/parseClass.hpp - Type system
include/ds/parser/types/type.hpp - Type registry
include/ds/parser/typeRegistry.hpp
Bytecode compilation
- Bytecode compiler
include/ds/parser/bytecode/compileBytecode.hpp - Bytecode stream
include/ds/bytecode.hpp
Execution
- Interpreter
src/interpreter.cpp - Runtime core
src/baseRuntime.cpp - JIT compiler
src/jit/justInTimeCompiler_x64.cpp - x64 JIT code
src/jit/justInTimeCode_x64.cpp
Embedding and libraries
- Native module API
include/ds/native/nativeModule.hpp - Standard library
src/modules/standardLibrary.cpp - System modules
src/modules/system.cpp - Filesystem module
src/modules/system.fs.cpp - I/O module
src/modules/system.io.cpp - Math module
src/modules/system.math.cpp - Async module
src/modules/system.async.cpp
Debug and editor tools
- Debug states
src/debug/interpreterDebugState.cpp - JIT debug state
src/debug/jitDebugState.cpp - Language service
src/service/languageService.cpp - Scanned symbols
src/service/scannedSymbols.cpp
Other components
- Script author
- Embedding host
Connections 20
- Script author → Parse context: provides scripts
- Embedding host → Parse context: embeds scripts
- Parse context → File scanning: parses files
include/ds/parser/parser.hpp - Parse context → Class parsing: parses classes
include/ds/parser/parser.hpp - Parse context → Type registry: uses registry
include/ds/parser/parser.hpp - Parse context → Bytecode compiler: compiles with
include/ds/parser/parser.hpp - Parse context → Bytecode stream: produces bytecode
include/ds/parser/parser.hpp - Bytecode stream → Interpreter: executes in
include/ds/bytecode.hpp - Embedding host → Native module API: adds bindings
- Standard library → System modules: provides modules
- System modules → Filesystem module: includes filesystem
- System modules → I/O module: includes I/O
- System modules → Math module: includes math
- System modules → Async module: includes async
- Bytecode stream → JIT compiler: may compile
- JIT compiler → x64 JIT code: emits code
- Interpreter → Debug states: supports debugging
- JIT compiler → JIT debug state: supports debugging
- Embedding host → Language service: requests editor data
- Language service → Scanned symbols: uses scanned data