Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SymbIONet: Neuro-Symbolic Parser Prototype

Traditional AST parsers (like Tree-sitter) are highly optimized for context-free syntax, but they are fundamentally blind to dynamic runtime environments (e.g., metaprogramming, macros, dynamic evaluations).

SymbIONet is a Python-based proof-of-concept that bridges this gap. It combines traditional deterministic syntax trees with localized, predictive inference routines to map hidden runtime structures before execution.

🚀 How it Works

  1. Symbolic Phase: Maps explicit definitions using deterministic AST trees.
  2. Boundary Detection: Flags structural dynamic code expressions (like injection loops).
  3. Inference Phase: Uses a simulated execution-inference engine to calculate the resulting runtime objects and appends them as virtual tokens to the AST.

📦 Quick Start

git clone https://github.com/aditya-8108/symbionet.git
cd symbionet
python3 engine.py

🧠 Handling Complex Scope Resolution

SymbIONet is designed to handle complex runtime scope tracking that traditional deterministic parsers miss. For example, consider this dynamic boundary where constants are splatted and evaluated inside an iteration block:

class Foo
  LIST_1 = [:bar, :baz]
  LIST_2 = [:qux, *LIST_1]

  LIST_2.each do |name|
    define_method(name) do
      puts "hello"
    end
  end
end

How SymbIONet resolves this without freezing the LSP:

  • Synchronous Fast-Path: The static parser maps class Foo instantly on the main thread.
  • Boundary Isolation: The engine detects define_method(name) is receiving a non-literal variable and flags the LIST_2.each block as a dynamic boundary.
  • Asynchronous Inference: The isolated boundary—along with its local constant dependencies (LIST_1, LIST_2)—is routed to the background inference worker.
  • Virtual Node Injection: The worker evaluates the array splat ([:qux, :bar, :baz]), predicts the three resulting runtime signatures, and injects DefNode(:qux), DefNode(:bar), and DefNode(:baz) back into the Foo AST scope.

This allows the editor to maintain sub-millisecond responsiveness while asynchronously resolving highly dynamic metaprogramming boundaries.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages