我厌倦了写锅炉板的进口 所以我建了Block: 运行Python,JS,和Lua在一个文件里

2026年8月20日1 次浏览来源:Dev.to阅读原文

正文保留英文原文(机翻易破坏代码与排版),标题/摘要已提供中文

💡 The Problem: The Import / Glue Code Headache A while ago, I was practicing importing modules across different projects.

I wanted to use Python for its rich data science libraries and Node.js for its async web performance.

Normally, if you want Python to pass a simple calculated array or dictionary to JavaScript, you have to: Spin up a local FastAPI / Flask server or write to a temporary JSON file.

Setup in Node.js, handle ports, serialization, and CORS.

Write 50+ lines of glue code just to share a single variable.

Coming from a visual block-coding mindset (where you snap blocks together and data flows naturally), I thought: "Why can't I just write and in the exact same file, and let the variables flow automatically?" So I built Block Engine. ⚡ How Block Works In Block, you write native language blocks separated by tags (, , , , ).

The underlying orchestrator (built with high-performance C# / .NET) automatically serializes and injects variables across runtime boundaries via an in-memory State Pipeline: 🎯 Running it: Output: 🚀 Key Features Zero-Glue State Pipeline: Variables declared in Python are instantly accessible in JS and Lua without manual JSON parsing.

Native Ecosystem Compatibility: Direct access to your existing host , , and libraries.

Zero-Install NPX Execution: You can run any file directly in terminal without manual installer setup: Modular Imports: Supports and custom runtime definitions with .

Open Source: Released under the MIT license. 🔗 Links & Resources GitHub Repository: https://github.com/O-O1112/Block_io NPM Package: / Official Discord Community: https://discord.gg/VeB44CD5y3 I would love to hear feedback and thoughts from the DEV community on this state-pipeline approach!

What languages would you like to see chained next?

分享