{
  "id": 2132068,
  "title": "I got tired of writing boilerplate imports, so I built Block: Run Python, JS, and Lua in a single file",
  "url": "https://urgent.news/2026/08/20/i-got-tired-of-writing-boilerplate-imports-so-i-built-block-run",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-20T12:03:33.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/o-o1112/i-got-tired-of-writing-boilerplate-imports-so-i-built-block-run-python-js-and-lua-in-a-single-gph"
  },
  "original_language": "en",
  "account": "The author, frustrated with the time-consuming boilerplate code required when importing modules across different projects, set out to create a solution. They envisioned a system where Python, JavaScript, and Lua could be written in a single file, seamlessly sharing data between languages.\n\nThis led to the creation of Block Engine, a runtime environment that allows users to write code in native language blocks. The language blocks are separated by tags, such as \"py\", \"js\", \"lua\", \"php\", and \"server\". The engine then automatically serializes and passes variables between these blocks through an in-memory State Pipeline.\n\nThe author demonstrates the process by writing a block file named \"demo.blkp\". The Python block prepares a dataset and prints a message, while the JavaScript block calculates the average of the dataset. In the Lua block, the calculated average and a bonus value are used to compute a final score, which is then printed.\n\nTo run the file, the user simply executes the command \"block demo.blkp\". The output shows the messages printed by each language block, and confirms that the State Pipeline synchronized the variables across the three runtimes in just 320 milliseconds.\n\nOne of the key features of Block Engine is the Zero-Glue State Pipeline, which enables variables declared in one language to be instantly accessible in others without the need for manual JSON parsing. The engine also supports native ecosystem compatibility, allowing users to access existing pip, npm, and luarocks libraries directly.\n\nAdditionally, Block Engine offers zero-install NPX execution, allowing users to run .blkp files directly from the terminal using the command \"npx block-engine-runner demo.blkp\". Modular imports are also supported, enabling users to import other block files and even define custom runtimes with specific commands.\n\nThe Block Engine project is open source and released under the MIT license, encouraging community contributions and improvements. The author invites feedback and suggestions from the DEV community on which additional languages they would like to see integrated into the system.",
  "summary": "💡 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…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}