Reddit Programming
206 subscribers
1.22K photos
122K links
I will send you newest post from subreddit /r/programming
Download Telegram
Execute code snippets in isolated containers.
https://www.reddit.com/r/programming/comments/1l9ptba/execute_code_snippets_in_isolated_containers/

<!-- SC_OFF -->I wanted to share a project I've been working on called Taylored Snippets Web. It's an Angular-based web application that lets you create, manage, and run code snippets in a worksheet-style interface. The main goal was to create a secure and isolated environment for code execution for each user. Key Features Isolated Execution: The application has two distinct modes that can be launched using Docker Compose profiles: Multitenant Mode: This is the core feature. It uses a Node.js orchestrator service to spin up a dedicated, isolated Docker container for each user session. This ensures that one user's code can't interfere with another's. Singletenant Mode: A simpler mode for local development that uses a single, shared runner instance for all users. Broad Language Support: The runner can execute code in a wide variety of languages using shebangs, including python3, node, bash, java, ruby, php, and more. Snippet Management: Users can add both text snippets (for annotations) and compute snippets (for executable code) to a worksheet. These can be reordered on the page via drag-and-drop. Live Output: Standard output and errors from code execution are displayed directly in the UI. Tech Stack Frontend: Built with modern Angular using standalone components, zoneless change detection, and Angular Material for the UI. Backend: A Node.js/Express Orchestrator that uses dockerode to manage the lifecycle of runner containers. A Node.js Runner that executes code snippets and communicates results. Communication: Real-time communication between the frontend and the runner is handled with Socket.IO. Deployment: The entire stack is defined in a docker-compose.yml file, making it easy to launch with either the multitenant or singletenant profile. I've put a lot of work into the architecture and would love to hear your thoughts or answer any questions about the implementation. The repo has all the source code, including the CI workflow and Docker setup. <!-- SC_ON --> submitted by /u/sasizza (https://www.reddit.com/user/sasizza)
[link] (https://github.com/tailot/taylored-snippets-web) [comments] (https://www.reddit.com/r/programming/comments/1l9ptba/execute_code_snippets_in_isolated_containers/)
When Google Sneezes, the Whole World Catches a Cold | Forge Code
https://www.reddit.com/r/programming/comments/1la5u5j/when_google_sneezes_the_whole_world_catches_a/

<!-- SC_OFF -->Today's Google Cloud IAM outage cascaded through major platforms including Cloudflare, Anthropic, Spotify, Discord, and Replit, highlighting key reliability issues. Here's what happened, how it affected popular services, and key takeaways for developers aiming for more resilient architecture. TL;DR: Google Cloud outage took down Cloudflare, Anthropic (Claude APIs), Spotify, Discord, and many others. Key lesson: don't put all your eggs in one basket, graceful fallback patterns matter! <!-- SC_ON --> submitted by /u/West-Chocolate2977 (https://www.reddit.com/user/West-Chocolate2977)
[link] (https://forgecode.dev/blog/gcp-cloudflare-anthropic-outage/) [comments] (https://www.reddit.com/r/programming/comments/1la5u5j/when_google_sneezes_the_whole_world_catches_a/)
Mastering CRUD Operations with Knex.js and PostgreSQL
https://www.reddit.com/r/programming/comments/1la77oe/mastering_crud_operations_with_knexjs_and/

<!-- SC_OFF -->Knex.js is a powerful, open-source SQL query builder for Node.js that simplifies database interactions by allowing developers to write database queries using JavaScript. In this article, we'll explore how to perform CRUD (Create, Read, Update, Delete) and various other operations using Knex.js with a PostgreSQL database. <!-- SC_ON --> submitted by /u/ram-foss (https://www.reddit.com/user/ram-foss)
[link] (https://www.blackslate.io/articles/mastering-crud-operations-with-knex-js-and-postgresql) [comments] (https://www.reddit.com/r/programming/comments/1la77oe/mastering_crud_operations_with_knexjs_and/)
Mochi v0.7.0 — Go+Python interop, self-eval, and agent streams
https://www.reddit.com/r/programming/comments/1la7m84/mochi_v070_gopython_interop_selfeval_and_agent/

<!-- SC_OFF -->We just released Mochi v0.7.0 (https://github.com/tamnd/mochi), a small statically typed scripting language for agents, real-time data, and working alongside Go, Python, and TypeScript. This update brings a few solid improvements: Agent messaging
Agents now have stream-backed mailboxes. You can send and wait with deterministic ordering — useful for simulations, coordination, or async systems. Go and Python in the same file
You can now call Go and Python together. Go FFI supports structs and method calls: import go "strings" as strings auto import python "math" as math let name = strings.ToUpper("alice") let area = math.pi * math.pow(3.0, 2.0) Dynamic eval
You can now evaluate Mochi code at runtime — including code generated on the fly: let code = generate text { prompt: "Write mochi code to calculate 2+2?" } let result = eval(code) print(result) // 4 Local imports
You can import files and folders using ./ and ../, no registry required. Still early, but if you're into lightweight scripting, cross-language interop, or agent-based workflows, it might be worth a look.
We’d love feedback — https://github.com/mochilang/mochi (https://github.com/tamnd/mochi) <!-- SC_ON --> submitted by /u/Adept-Country4317 (https://www.reddit.com/user/Adept-Country4317)
[link] (https://github.com/mochilang/mochi/releases/tag/v0.7.0) [comments] (https://www.reddit.com/r/programming/comments/1la7m84/mochi_v070_gopython_interop_selfeval_and_agent/)
Developer patterns and practices as a mood stabiliser for hypomanic AI
https://www.reddit.com/r/programming/comments/1laa92i/developer_patterns_and_practices_as_a_mood/

<!-- SC_OFF -->(I can maybe use this insensitive title as I have bipolar disorder). My AI is often like a super psyched junior developer, I ask for a new command line flag and it creates a monster changes, tonnes of comments saying all the clever stuff it’s done, doesn’t clean up old code, doesn’t think about testing, doesn’t follow obvious conventions. More code = more maintenance and tech debt, smaller is better. Don’t change without discussion. Review changes. I encoded this in “golden rules” in a developer guide, which can be used with a simple prompt (if your LLM has web access) or an MCP server (more efficient for fetching “sub guides”. I’d love feedback on the approach or any suggestions of the best next additions. I’m focusing on basic idioms for good practices, rather than specifics that are more opinionated. But it’s early days work in progress. <!-- SC_ON --> submitted by /u/dwmkerr (https://www.reddit.com/user/dwmkerr)
[link] (https://github.com/dwmkerr/ai-developer-guide) [comments] (https://www.reddit.com/r/programming/comments/1laa92i/developer_patterns_and_practices_as_a_mood/)
AI Generated Books
https://www.reddit.com/r/programming/comments/1laayqu/ai_generated_books/

<!-- SC_OFF -->If you're looking for good books on programming, please avoid this author. The content is clearly AI generated, and created simply to farm purchases from those who don't know any better. Pick any of the books and just read the sample. It's barely readable. I'm worried that people who are looking and don't know any better will buy them. Just posting here to spread awareness. <!-- SC_ON --> submitted by /u/ctrtanc (https://www.reddit.com/user/ctrtanc)
[link] (https://www.amazon.com/s?i=digital-text&rh=p_27%3AMaxwell%2BVector) [comments] (https://www.reddit.com/r/programming/comments/1laayqu/ai_generated_books/)