[Python/JS/C#] Block Language 2.2.0: Run Polyglot Workflows in One Document
I got tired of writing small glue programs around otherwise simple workflows. Python was the right tool for data preparation. JavaScript was the right tool for formatting and application logic. Sometimes Lua, PHP, SQLite, or a systems language was the right tool for another stage. The annoying part was not using multiple languages. The annoying part was keeping all the boundaries between them…
Block Language 2.2.0 allows developers to create polyglot workflows in a single document. This tool eliminates the need for glue programs to connect different languages, simplifying the workflow process. The orchestrator, written in C#, parses the file and runs each stage through its local runtime, transferring compatible state to the next stage without trying to emulate the languages.
The Block file consists of native language blocks, such as Python, JavaScript, HTML, and others. Each block runs in its respective runtime, maintaining visibility of the runtime boundaries. For instance, Python runs through Python, JavaScript through Node.js, and HTML is rendered independently.
To run an example, save the file as demo.blk and execute it using the Standard engine. The local host runtimes must be installed, as Block orchestrates the order and state transfer but does not bundle every language runtime. The console output demonstrates the total and average results, as well as an HTML output.
Block supports Lite (.blkl) and Plus (.blkp) editions when a smaller or broader runtime surface is needed. Additionally, native syntax is available for small scripts, allowing direct use of variables and control flow within the file.
In version 2.2.0, Block offers a one-readable entry point, shared state pipeline, progressive editions, native ecosystem access, and visible boundaries for runtime startup, state transfer, and errors. It is MIT licensed, and the engine, website, and editor integrations are available in the repository.
However, a security note is essential: Block invokes host runtimes, so it is crucial to review the script and its dependencies before execution. This ensures that untrusted .blk, .blkl, or .blkp files are not executed, as the engine includes import limits, path checks, runtime policy controls, and validation for malformed blocks.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.