Category: Development

T2 SDE: A Low-Code Cross-Compilation System Development Environment

2024-12-26

T2 SDE is a low-code, ultra-portable package manager and Linux distribution that enables fully automated, reproducible, cross-compilation of custom operating systems using up-to-date packages. It supports nearly all major CPU architectures, C libraries, GUI systems, and desktop environments, plus countless special-purpose and embedded firmware packages. The latest release, T2 24.12, boasts expanded architecture support, including LibreOffice, OpenJDK, Qemu, and even a new Rust-based desktop environment, Cosmic Desktop. T2's commitment to supporting a wide range of architectures, including legacy and niche ones like IA-64 Itanium, is complemented by ongoing improvements, including full-disk encryption and LVM support for enhanced user experience.

Tutorial: Building a Simple Unix Shell in C

2024-12-26

This tutorial walks you through creating a basic Unix shell in C. The author details the shell's lifecycle: initialization, command interpretation, and termination. Key aspects covered include reading user input, parsing commands, executing programs using fork() and exec(), and handling built-in commands like cd, help, and exit. Dynamic memory allocation using malloc() and realloc() is emphasized, and the use of getline() is explained. While simplified (no piping, redirection, or globbing), the tutorial provides a solid foundation for understanding shell programming in C.

Sub-pixel Distance Transform: A Breakthrough in High-Quality Font Rendering for WebGPU

2024-12-26

This article delves into the challenges and solutions for achieving high-quality font rendering in WebGPU. Addressing shortcomings in existing Signed Distance Fields (SDFs) generation methods, the author presents a novel sub-pixel accurate distance transform algorithm (ESDT). ESDT cleverly combines CPU and GPU strengths, employing an improved Euclidean Distance Transform to effectively solve the deviations encountered in traditional methods when handling sub-pixel accuracy and grayscale pixels. The result is precise rendering of various fonts, including emojis, significantly enhancing font rendering quality.

Build Your Own Virtual Machine: A Step-by-Step Guide

2024-12-26

This tutorial guides you through building your own virtual machine (VM) capable of running assembly language programs, such as 2048 or Roguelike games. Even if you're already a programmer, this project provides a deeper understanding of computer architecture and how programming languages work. The tutorial covers core VM concepts, the LC-3 architecture, instruction sets, trap routines, program loading, and more, with detailed code examples and explanations. The final code is approximately 250 lines of C, making it accessible to those with basic C/C++ knowledge.

Development virtual machine

Arcan 0.7 Released: The All-Tomato Desktop Update Arrives

2024-12-26

Arcan 0.7 marks the end of the second phase of the 'anarchy on the desktop' project and the beginning of the final phase. This release focuses on bug fixes and improvements to Lash#Cat9 and Xarcan. Lash#Cat9, a Lua-based command-line environment, adds features such as a Debug Adapter Protocol implementation and an interactive spreadsheet. Xarcan allows for custom window managers, utilizing Arcan as a display driver and enabling interoperability with X servers. Arcan 0.7 aims to improve performance and security, with future versions planned to feature more flexible remote programming and simpler device connection.

Development

Lua: An Underrated Programming Language

2024-12-26

Lua, a concise and efficient embedded scripting language created in 1993, remains surprisingly underrated despite its strengths. This article highlights Lua's advantages: ease of learning and mastery, an excellent C API, multi-paradigm support, and exceptional embeddability. While widely used in games and embedded systems, the author also points out some unique aspects of Lua, such as its indexing conventions (starting at 1 but not mandatory), error handling, and nil-terminated arrays, which developers should be aware of. Overall, Lua is a powerful language deserving more recognition; its efficiency is evident in applications like Neovim plugins.

Rust Library Upgrade Challenges: A Clever Way to Avoid Version Conflicts

2024-12-26

Upgrading libraries in the Rust ecosystem often causes cascading effects and significant trouble. This article introduces a technique called the "semver trick", which cleverly solves the problem of upgrading less frequently used APIs without changing commonly used ones by having a library depend on its future version. This method is particularly useful for avoiding the need for large-scale coordinated upgrades across the entire dependency chain due to breaking changes in a single library, greatly simplifying the upgrade process.

A Minimalist ELF: Stripping Complexity to the Core

2024-12-26

This article details the author's journey in simplifying a basic Linux program, culminating in a minimalist ELF file. Starting with a simple "Hello World" program, the author progressively removes complexities like standard libraries, modern security features, debugging information, and error handling. The process delves into ELF file structure, symbol tables, sections, and the role of linker scripts, using assembly language to directly manipulate system calls for program functionality. The author concludes by creating a custom linker script, loading code and data segments into specified memory addresses, demonstrating the flexibility and low-level details of ELF file construction.

Python subprocess Default Behavior Change: Enhanced Performance, Balanced Security

2024-12-26

Python's subprocess module is changing its default behavior of closing all file descriptors. This change aims to improve performance, especially when dealing with a large number of file descriptors, avoiding performance bottlenecks caused by closing each descriptor individually. However, altering the default behavior could introduce security risks. Developers are advised to choose the `close_fds` parameter based on their specific needs and take appropriate security measures, such as ensuring all file descriptors are marked as non-inheritable. This change carefully balances performance and security, aiming to provide developers with a more flexible and efficient subprocess management solution.

Development

Open-Source WebGPU Ray Tracer: Real-time Rendering from glTF Scenes

2024-12-26

The open-source project webgpu-raytracer is a software ray tracing engine built using the WebGPU API. It supports glTF scene files and renders materials with albedo, normal, and material maps. The engine utilizes BVH for accelerated ray-scene intersections and employs multiple importance sampling for efficiency. Currently, it supports environment maps and allows camera control via keyboard and mouse, but refraction is not yet supported.

Development Ray Tracing

Debian's Controversial Approach to Rust Dependency Handling

2024-12-26

Debian's integration of Rust has been a long-standing effort, but its dependency handling approach has become a point of contention. Author Ian Jackson argues that faithfully following Rust's Semantic Versioning (semver) in Debian package dependencies is impractical. Fundamental differences exist between Debian's and Rust's dependency management semantics, leading to significant manual work when directly translating Rust's version dependencies. Jackson proposes a radical solution: Debian shouldn't precisely follow upstream Rust semver dependency information, but instead optimistically try various package combinations, letting automated QA discover and fix breakages. This approach, while violating semver, is argued to be mitigated by the Rust community's emphasis on API safety and change notifications, along with Debian's QA mechanisms. The proposal aims to improve the update efficiency of Debian Rust packages, but it might also lead to some dependency combinations failing.

Development

ChatGPT Saved Chats Extension: Never Lose an Important Conversation Again

2024-12-26

Tired of losing important ChatGPT conversations in your endless chat history? The ChatGPT Saved Chats Chrome extension is here to help! This easy-to-use extension lets you save and organize your most valuable chats with a single click. Simply hover over any conversation and click the save icon to instantly store it for later access. Your saved chats are stored locally, ensuring your privacy. Say goodbye to endless scrolling and hello to easy retrieval of your important conversations.

GitHub Open Source Project Thruster: Simplifying Rails App Deployment with an HTTP/2 Proxy

2024-12-26

Thruster is an HTTP/2 proxy designed to simplify production deployments of Rails applications. It works alongside the Puma web server, providing features like HTTP/2 support, automatic TLS certificate management with Let's Encrypt, basic HTTP caching, and X-Sendfile support with compression. It aims for zero configuration; simply setting the TLS_DOMAIN environment variable enables TLS, otherwise it runs in HTTP-only mode. Thruster also wraps the Puma process, making it ideal for containerized environments. Originally created for the ONCE project, it's now used for simpler deployments of other Rails applications.

Development Deployment

Potential Issue with zpool import/export in Linux OpenZFS

2024-12-26

A potential issue exists in Linux OpenZFS versions (as of 2.3.0) regarding importing and exporting ZFS pools. Even if no filesystems within a ZFS pool have the 'sharenfs' property set, `zpool import` and `zpool export` still run `exportfs -ra`. This can wipe out manually added or modified NFS exports, impacting environments like high-availability systems using custom NFS export configurations. The problem stems from OpenZFS blindly executing `exportfs -ra`, regardless of whether NFS exports need changing.

Development

How to Handle Go Security Alerts: A Practical Guide

2024-12-26

This article provides a practical guide on handling Go security alerts. Using the December 2024 Go security vulnerabilities in golang.org/x/net and golang.org/x/crypto packages as examples, it details how to use govulncheck and Docker Scout to scan Docker images and Go source code for vulnerabilities, and how to update dependencies. The article emphasizes the importance of differentiating between potential security issues and actual risks, and recommends automating security testing and patching for efficiency and compliance with new EU cybersecurity regulations.

Programmer Tackles Advent of Code 2024 on OS/2 Warp 4 with Java 1.0.1

2024-12-26

A programmer took on the Advent of Code 2024 challenge using Java 1.0.1 on a 1996 IBM OS/2 Warp 4 system. This wasn't just a coding challenge; it was a retro journey pushing the limits of outdated hardware and software. The article details the challenges encountered, including bugs in Java 1.0.1, performance bottlenecks, and limitations of the old system, and how these were overcome. This showcases not only coding prowess but also the charm of early computing technology and the programmer's perseverance.

Development

W3C HTML Working Group: Driving HTML Standard Evolution

2024-12-26

The W3C HTML Working Group is dedicated to bringing WHATWG's HTML and DOM review drafts to W3C Recommendations. This group comprises global experts collaboratively ensuring the continued evolution and improvement of HTML standards to meet the ever-changing needs of the web. The group features a defined mission, participation process, and patent policy, and regularly publishes updates and event information.

Node.js Enables --experimental-strip-types by Default, Enhancing TypeScript Support

2024-12-26

A significant update to Node.js enables the `--experimental-strip-types` flag by default. This means developers can now execute TypeScript files without additional configuration. The change aims to improve TypeScript support and catch more bugs. While still experimental, this marks a major step towards simpler TypeScript development in Node.js, offering developers a more streamlined experience.

Development Development

Minecraft Server Crafted in COBOL: A Retro Rewind

2024-12-26

CobolCraft is a Minecraft server audaciously built using the legacy COBOL programming language. Despite COBOL's limitations in low-level data manipulation, this project surprisingly supports features like infinite terrain generation, dynamic chunk loading, and multiplayer capabilities. It even handles Minecraft's data files, showcasing the unexpected potential of this often-overlooked language and challenging perceptions of its capabilities. This project serves as a testament to programming ingenuity and an interesting experiment in using unconventional tools.

Development Server Development

Racket School 2019: Designing Your Own Languages

2024-12-26

The "How to Design Languages" track at Racket School 2019 offered a deep dive into language-oriented programming and language building using Racket. The curriculum covered core concepts like macro expansion, modules, and type checking, reinforced with hands-on labs. Participants built simple macros and typed languages, gaining a practical understanding of language design principles. Lectures and labs provided a balanced learning experience, culminating in the ability to design and build custom languages.

Design Space for Code Search Queries: ast-grep's Innovative Approach

2024-12-26

ast-grep is an Abstract Syntax Tree (AST)-based code search tool designed for ease of use, expressiveness, and precision. This blog post delves into the design space of code search queries, categorizing them into informal queries, formal queries based on existing programming languages, formal queries using custom languages, and hybrid queries. Each type's strengths and weaknesses are analyzed. ast-grep employs a hybrid approach, allowing users to write queries using familiar programming language syntax and offering more powerful expressiveness through YAML configuration files or a programmatic API for precise code search.

SiYuan: A Privacy-First, Self-Hosted Personal Knowledge Management System

2024-12-26

SiYuan is a privacy-first, self-hosted, fully open-source personal knowledge management software written in TypeScript and Go. It boasts features like fine-grained block-level referencing, Markdown WYSIWYG editing, custom attributes, SQL query embedding, web clipping, and PDF annotation link export. Available via app stores (App Store, Google Play, F-Droid) and Docker, SiYuan offers a powerful yet user-friendly experience. Most features are free for both personal and commercial use.

Development knowledge management

Coccinelle: A Powerful Tool for Linux Kernel Development

2024-12-26

Coccinelle is a powerful tool for Linux kernel development, used for pattern matching and text transformation. It enables the application of complex, tree-wide patches and detects problematic coding patterns. This document details Coccinelle's installation, usage, various modes (patch, report, context, org), and advanced features such as parallelization, using a single semantic patch, controlling processed files, debugging, and .cocciconfig support. Coccinelle leverages Semantic Patch Language (SmPL) and offers multiple modes for generating patches, reports, context information, and Org-mode reports, catering to diverse needs.

Development

egui: An Immediate Mode GUI in Rust

2024-12-26

egui is a lightweight and efficient immediate mode GUI (graphical user interface) library written in Rust. Its clean and simple API allows developers to rapidly build interactive interfaces. Unlike traditional retained-mode GUIs, egui redraws the entire UI every frame, leading to more flexible layouts and simpler state management. This makes it ideal for games, data visualization, and applications requiring high responsiveness. Its ease of use and powerful features make egui a compelling choice for Rust developers building GUIs.

Development

Black Candy: A Self-Hosted Music Streaming Server

2024-12-26

Black Candy is a self-hosted music streaming server, your personal music center. It offers easy installation via Docker, allowing you to quickly set up your own music streaming service. A demo is available for testing. While SQLite is the default database, PostgreSQL is also supported. Data persistence is managed by mounting the /app/storage directory. For improved performance, Nginx proxy is supported, and mobile apps are available.

Development self-hosted

POSIX Time: Not What You Think

2024-12-26

This article debunks a common misconception about POSIX time (Unix time): it's not simply the number of seconds since January 1, 1970, 00:00:00. Due to leap seconds, the number of seconds in a UTC day isn't a constant 86,400, leading to discrepancies between POSIX time and the actual number of seconds. The article delves into the impact of leap seconds on time calculations and recommends alternatives like CLOCK_MONOTONIC or TAI for precise timekeeping, avoiding errors caused by leap seconds.

Development POSIX time leap seconds

A 50-Year-Old Bug in C's File I/O: Unraveling a Legacy Mystery

2024-12-26

While improving a DOS emulator, a developer stumbled upon a seemingly trivial bug in file I/O: appending text to a file using the `echo` command produced unexpected results. Debugging revealed a flaw in how C runtime libraries handle switching between reading and writing, a flaw tracing back to the 1970s and even earlier UNIX systems. The article delves into the historical context, from early K&R C to modern C standards, exploring implementation differences across various UNIX versions and C compilers. The root cause is identified as limitations in early C libraries' handling of update mode, with variations in how different operating systems and compilers addressed these limitations. The author concludes that even today, for portable C code, an explicit `fseek` call is necessary when switching between reading and writing a file.

Development file I/O legacy bug

Postgres Reads Causing Writes: MVCC, Page Pruning, and Hint Bits

2024-12-25

This article delves into the seemingly paradoxical behavior in PostgreSQL where simple SELECT queries can trigger data writes. Starting with the Multi-Version Concurrency Control (MVCC) mechanism, it explains concepts like row versions, pages, and tuples. Through code examples, it analyzes how hint bit updates and page pruning cause read operations to modify pages, ultimately leading to disk writes. The article also discusses the HOT update optimization strategy and uses page inspection tools to illustrate how data is stored and updated within pages.

Development Database Performance

Server-Sent Events (SSE): An Underrated Real-time Data Streaming Solution

2024-12-25

This article explores Server-Sent Events (SSE), a simpler and more efficient one-way real-time communication solution compared to WebSockets. SSE leverages standard HTTP protocols, making it easy to implement and deploy, compatible with existing infrastructure, resource-efficient, and featuring automatic reconnection. The article details SSE's workings, advantages, and application scenarios (like real-time news, stock tickers, progress bars, etc.), showing code examples with Flask and JavaScript. Furthermore, it analyzes how LLMs like ChatGPT utilize SSE for streaming responses and points out SSE's limitations, such as unidirectional communication and data format restrictions. In short, SSE provides an elegant solution for many applications requiring unidirectional real-time data streams.

Deep Dive into CPS: A Journey into Functional Programming Compilation

2024-12-25

This article delves into Continuation-Passing Style (CPS) and its application in compiling functional programming languages. The author builds a CPS transformer step-by-step for a simple Scheme-like language, explaining optimization strategies and code generation methods. The article details the transformation of integers, variables, function calls, arithmetic operators, lambda expressions, and if expressions into CPS form. It also discusses meta-continuations and optimization techniques such as constant folding and beta reduction. Finally, it outlines several approaches to generating executable code from CPS, including generating C code, using trampolines, and employing a single large switch statement.

1 2 8 9 10 12 14 15 16 22 23