SShortSingh.
Back to feed

Elixir Tutorial Builds OTP-Style Supervisor From Scratch Using Core Primitives

0
·5 views

A hands-on tutorial series on building distributed systems in Elixir has reached its fifth installment, focusing on constructing a basic process supervisor without using OTP or GenServer. The guide demonstrates how exit trapping via Process.flag(:trap_exit, true) converts crash signals into mailbox messages, enabling a parent process to detect and respond to worker failures. Using only spawn_link, send, and receive, the tutorial builds a manual supervisor that manages two worker processes and restarts only the one that crashes, leaving healthy siblings unaffected. This minimal one-for-one restart strategy mirrors the policy provided by OTP's built-in Supervisor module. The stated goal is to help developers understand the underlying mechanisms that OTP abstracts, rather than to replace the framework itself.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Hybrid RRF Retrieval Beats Pure Vector Search for Kannada Literary RAG System

A developer building a retrieval-augmented generation (RAG) agent for 'Heli Hogu Kaarana', a 346-page scanned Kannada novel by Ravi Belagere, found that the initial pipeline using multilingual embeddings and ChromaDB produced confident but factually wrong answers. The core challenge stemmed from Kannada's agglutinative grammar, poor OCR quality from scanned pages, and sparse literary vocabulary that multilingual models handle poorly. The rebuilt system combined BM25 sparse retrieval with dense vector search, fused via Reciprocal Rank Fusion (RRF), and added a deterministic regex router to handle page-specific queries through direct metadata lookup. This hybrid architecture achieved 0.92 faithfulness and 0.89 context recall on a 50-query evaluation set, with a median end-to-end latency of 2.8 seconds on serverless infrastructure. The project concludes that retrieval architecture, not the language model itself, was the primary bottleneck in RAG performance for low-resource, morphologically complex languages.

0
ProgrammingDEV Community ·

Developer Builds VS Code-Inspired Portfolio with Cinematic Boot Sequence

Ahmad Akmal, a Malaysia-based software developer with a multimedia background, built a portfolio website designed to resemble a fully functional IDE rather than a conventional developer portfolio. The project uses React, Next.js, Tailwind CSS, GSAP, and dotLottie to deliver a cinematic loading experience where the screen splits open to reveal a VS Code-style workspace. A file-tree sidebar serves as the site's primary navigation, dynamically swapping content panes when files like about.html or projects.js are selected. The mobile experience was specifically engineered to auto-collapse the sidebar the moment a file is clicked, preventing navigation from obscuring content. The site is deployed on Vercel with a custom .dev domain, leveraging its edge network and serverless infrastructure for fast, automated builds.

0
ProgrammingDEV Community ·

Developer Builds Lottery Simulator to Visualize Centuries of Financial Loss

A developer has launched howtolosemoneyfast.com, a satirical lottery analysis tool designed to make the poor odds of winning feel tangible rather than abstract. The client-side simulator supports EuroJackpot and Lotto 6aus49, allowing users to run thousands of draws spanning up to 1,000 years while a live chart tracks cumulative losses against a growing ETF comparison. Users can configure ticket frequency, strategy, and duration, with a special 'Until Billionaire' mode that continues simulating until winnings reach one billion — a milestone that strains browser resources before it is reached. The tool also lets users check their personal numbers against every real historical draw, with 6aus49 data going back to 1955 and EuroJackpot records from 2012. The self-hosted site rebuilds automatically after each draw day via a CI pipeline that pulls official lottery results and compresses them into embedded data modules.

0
ProgrammingDEV Community ·

Developer publishes 17 real attempts to bypass a merge gate, with full test code

A developer building an open-source merge gate — a tool that blocks pull requests touching protected file paths — documented 17 distinct attempts to evade it, distinguishing those from 5 validity checks included to ensure the gate does not simply reject everything. The attacks covered scenarios such as renaming files, changing letter case, and exploiting Unicode encoding differences like NFC versus NFD, each designed as a hypothesis that the gate could be beaten. The project is publicly available on GitHub under the Apache-2.0 license, allowing anyone to verify the test suite directly. The gate works deterministically, checking only whether a diff contains a protected path, with no AI model involved in the decision. The author emphasized that honest test accounting matters, noting that inflating 17 attacks to 22 by including non-attack tests would undermine the credibility of the work.