Category: Development

The PHP Static Typing Debate: Flexibility and Efficiency of Dynamic Languages

2024-12-14

In this article, Tony Marston vehemently criticizes the enforced static type checking changes introduced in PHP 8.1. He argues that this change violates the core design principles of PHP's dynamic typing, clashing with PHP's long-standing flexible approach to data type handling and imposing a significant workload on developers. The article delves into the advantages of PHP's dynamic type system, such as automatic type conversion and flexible data handling, pointing out that the performance benefits of static typing are negligible in modern hardware, while hindering development efficiency. Marston contends that PHP's dynamic type system is better suited for handling HTML frontend and SQL backend data, and that enforcing static type checking is counterproductive, negatively impacting the PHP community.

uv: A Blazing-Fast Python Package and Project Manager

2024-12-14

uv, a lightning-fast Python package and project manager written in Rust, replaces pip, pip-tools, pipx, poetry, pyenv, twine, and virtualenv. Boasting a 10-100x speed improvement, uv offers project management, tool management, Python version management, script support, and a pip-compatible interface. Features like global caching and workspace support streamline workflows. From project creation and dependency management to running scripts and building distributables, uv provides efficient and convenient solutions for all your Python development needs.

From New Grad to Meta Staff Engineer in 3 Years: Evan King's Success Story

2024-12-14

Evan King shares his journey of rapidly advancing from a new graduate to a Staff Engineer at Meta in just three years. His six key principles for success include: prioritizing speed and efficiency to free up time for growth; broadening perspective to think strategically like a higher-level engineer; embracing uncertainty and sharing ideas freely; focusing on problem-solving over technical complexity; building goodwill and strong relationships; and maintaining a positive attitude. While acknowledging the role of luck and timing, Evan emphasizes the importance of cultivating sustainable habits that compound over time, focusing on core competencies and strategically utilizing the extra bandwidth created by efficiency.

Clojure Error Handling: No Silver Bullet, Only Choices

2024-12-14

Clojure offers a diverse range of error-handling approaches, with no single best practice. The article explores several methods: throwing native exceptions, using `ex-info` for data-carrying exceptions, returning error maps, and utilizing various libraries for more sophisticated error handling flows, such as the `anomalies` library or options like `pact` and `failjure`. The author emphasizes that the choice depends on the specific context and that a mix of approaches can coexist within a single project. Developers are empowered to select the most appropriate solution for their needs; Clojure embraces this freedom.

Development error handling

HTMX v2.0.4 Release Notes: Bug Fixes and Improvements

2024-12-14

The HTMX v2.0.4 release notes detail numerous bug fixes and improvements. This release focuses on stability and compatibility enhancements, including fixes for nested shadow root issues, improved `hx-boost` behavior on forms, better support for Web Components and Shadow DOM, and updated extensions for improved performance and reliability. Adjustments to the `htmx.ajax` function and optimizations to `hx-trigger` event handling are also included.

Development Release Bug Fixes

PhD Advisor Automates Writing Improvement with Shell Scripts

2024-12-14

To improve his PhD students' writing, an advisor created three shell scripts to detect passive voice overuse, weasel words, and duplicate words. Integrated into their LaTeX build system, these scripts encourage conscious choices for clarity and precision, rather than blind adherence to grammar rules. The advisor advocates for programmers using automation to combat writing weaknesses and recommends resources like "Style: The Basics of Clarity and Grace".

macOS 15.2 Update Breaks System Replication: Users Face Data Backup Nightmare

2024-12-14

A critical bug in macOS 15.2 has broken the system replication feature, causing data backups to fail with a 'Resource Busy' error, specifically when attempting to copy Preboot or Recovery partitions. Developer Dave Nanian explains that the problem stems from Apple's own code and currently has no easy fix. Users are forced to rely on third-party backup solutions, utilizing a 'Backup - all files' method with a Smart Update to restore their data after a clean system install. This issue is causing significant user frustration, particularly as the holiday season approaches.

Farebox: A Multimodal Routing Project in Rust

2024-12-14

Farebox is a fast RAPTOR implementation in Rust designed for memory-constrained machines. It leverages Valhalla for transfers and first/last mile routing, supporting multi-agency and timezone-aware routing. The project aims to supplement OpenTripPlanner, providing infill service for areas not covered by existing instances. Memory mapping is used for timetables to enable planet-scale coverage with a single instance and reduce hosting costs. Future plans include GTFS-RT support and potentially rRAPTOR for simultaneous itinerary calculation across various departure times.

Development Routing

Luon Programming Language: A Statically Typed Lua

2024-12-14

Luon is a new, statically-typed programming language with a syntax similar to Oberon-based languages, incorporating concepts from Lua and targeting the LuaJIT VM. Essentially a statically-typed version of Lua, it allows for the reuse of existing Lua and C libraries via external procedure declarations. Luon addresses shortcomings in Lua's error handling and code structure, offering a compiler and integrated IDE supporting procedural, generic, and object-oriented programming. The project includes extensive examples and test cases and is under active development.

Development statically typed

SCCS: The Source Code Motel After 50 Years

2024-12-13

This article retrospectively examines the influence of the Source Code Control System (SCCS) over the past 50 years. Author Larry McVoy details SCCS's unique weave format, which allows for merging by reference, avoiding the inefficiencies of patch-based copying found in other systems. He explains how SCCS leverages this weave to retrieve any file version in constant time and preserves authorship across versions. While acknowledging shortcomings like long-term locks and file-orientation, McVoy highlights the efficiency of the weave format and its preservation of authorship as groundbreaking, laying the groundwork for later systems like BitKeeper.

Hexagonal Architecture in Rails: A Path to Decoupling

2024-12-13

This article explores implementing Hexagonal Architecture (Ports and Adapters pattern) in Rails applications. The author initially struggled with the pattern until realizing that 'adapter' directly refers to the Gang of Four Adapter Pattern. The article details inbound and outbound ports, and how adapters decouple application logic from external services (databases, logging, email, etc.). Rails controllers can serve as HTTP adapters, but the author stresses avoiding direct ActiveRecord usage. Instead, custom repositories access data, improving decoupling and maintainability. The article concludes by encouraging Rails developers to adopt Hexagonal Architecture for more robust and maintainable applications.

Repurposing Old Smartphones as Kubernetes Cluster Nodes with postmarketOS

2024-12-13

The author built a functional Kubernetes cluster using discarded smartphones and the postmarketOS operating system. The article details the process, including the reasons for choosing old smartphones (substantial computing power, built-in batteries), the advantages of postmarketOS (Alpine Linux-based, uses the mainline Linux kernel), and challenges encountered during setup (kernel modules, network configuration). Solutions to these challenges are thoroughly explained. The author successfully repurposed old smartphones as Kubernetes nodes, efficiently utilizing resources and promoting sustainability.

Bypassing Windows Kernel Mitigations: A Deep Dive into Violet Phosphorus

2024-12-13

This post delves into bypassing modern Windows 10 and 11 kernel mitigations like SMEP and VBS. The author details Violet Phosphorus, a universal VBS/SMEP bypass technique, providing PoC code and a ROP chain. It explains SMEP and VBS, demonstrating how to exploit a vulnerability in the HackSysExtremeVulnerableDriver to use ROP gadgets and the MiGetPteAddress function to modify page table entries for kernel code execution. The author also shows how to use Kristal-G's SYSRET shellcode to return to user mode. This is a valuable resource for kernel exploit development and security researchers, categorized as Development.

Node.js EPUB Library @smoores/epub Released

2024-12-13

A new Node.js library, @smoores/epub, has been released. It allows developers to inspect, modify, and create EPUB 3 publications. The library offers high-level APIs that simplify interaction with the EPUB specification, such as setting the title and retrieving author information. Lower-level APIs provide granular control over the EPUB structure, enabling tasks like adding chapters and metadata. Built upon fast-xml-parser, @smoores/epub provides robust XML parsing and manipulation capabilities, facilitating efficient handling of EPUB file XML content.

Development Library

Scheduled Reboots: A Preventative Approach

2024-12-13

A university research team faced a challenging sysadmin problem: their servers had been running for too long and needed rebooting, but frequent reboots disrupt user experience. Their default was to avoid reboots, but a recent large-scale reboot due to prolonged uptime forced a change. To prevent similar issues, they've decided on a yearly reboot schedule—at least three times a year, aligning with the university's teaching schedule—balancing preventative maintenance with user experience.

Microsoft Open-Sources MarkItDown: A File-to-Markdown Conversion Tool

2024-12-13

Microsoft has open-sourced MarkItDown, a Python tool that converts various files (including PDF, PowerPoint, Word, Excel, images, audio, and HTML) into Markdown format. The tool boasts a simple API, supports a wide range of file types, and incorporates OCR and speech transcription for enhanced functionality, making it ideal for text analysis or indexing. Contributions are welcome, and the project adheres to the Microsoft Open Source Code of Conduct.

Concurrent Cycle Collection: Garbage-Collected Smart Pointers in Rust for Scheme

2024-12-13

This article details the implementation of a concurrent cycle collector in Rust for garbage-collected smart pointers (Gc) within a Scheme interpreter. Gc functions similarly to Arc>, supporting interior mutability, cloning, and sending across threads. The article thoroughly explains the implementation of Gc, including thread-safe interior mutability using semaphores and read/write locks, and the implementation details of concurrent cycle collection based on the Bacon and Rajan algorithm. This includes the Trace trait, cycle detection, and mechanisms for handling concurrent modifications.

Maker Builds Laser Shooting Game: From Legoland Ride to ESP32-Powered Halloween Fun

2024-12-13

Inspired by a Legoland Egyptian adventure ride, the author decided to create a similar shooting game. Using inexpensive ESP32 microprocessors, infrared laser guns, and homemade targets, he successfully built a Halloween-themed shooting game. Along the way, he learned Arduino and MicroPython programming, overcoming challenges in hardware connections, power supply, and communication. The game was a hit at school and home events. Future plans include improving target design, lighting effects, and circuit boards to enhance the gaming experience.

Development Maker

New Hash Functions Rain Hashes: Speed and Security Combined

2024-12-13

DOSAYGO Research has released Rain Hashes, a new family of hash functions featuring Rainbow and Rainstorm algorithms. Rainbow boasts exceptional speed, making it ideal for general-purpose hashing. Its C++ implementation has passed all SMHasher3 tests and is characterized by its concise and efficient code. Rainstorm prioritizes security; while not formally audited, its design incorporates elements from cryptographic hash functions and offers output sizes from 64 to 512 bits. The project provides C++, WASM, and Node.js implementations, along with a command-line tool and benchmark tests for easy evaluation and usage.

Development hash function

Web Origami: A New Programming Language for Simplified Website Building

2024-12-13

Web Origami is a new programming language designed to simplify the creation of small- to medium-sized websites. Using a concise syntax that complements HTML and CSS, users can describe website structure using formulas similar to spreadsheets, transforming data and files into HTML and other website resources through simple programs. Even without JavaScript knowledge, features like full-text search and RSS feeds can be created. Origami provides a command-line interface, built-in functions, and an async-tree library, with support for JavaScript extensions. Its core concept is to abstract website building as data transformation, making site creation and deployment efficient, low-cost, and easy to understand.

Security Vulnerabilities Stemming from Dart/Flutter's Weak PRNG

2024-12-13

Zellic's research uncovered multiple security vulnerabilities caused by a weak pseudorandom number generator (PRNG) in Dart/Flutter. A flaw in the initialization of the `Random()` function within the Dart SDK resulted in insufficient entropy in generated keys, making them susceptible to brute-force attacks. This allowed attackers to easily gain access to the Dart Tooling Daemon, enabling them to read or write workspace files and even execute arbitrary code. Furthermore, Proton Wallet and SelfPrivacy projects were also affected by this weak PRNG, experiencing encryption vulnerabilities and predictable password issues, respectively. While the vulnerability has been patched, developers are urged to exercise caution when using the `Random()` function and utilize `Random.secure()` when cryptographically secure random numbers are required.

Revolutionary Idea: Applying Magit Principles to the jj Version Control System

2024-12-13

The author proposes a novel approach: applying the Magit version control interface from Emacs (which uses text files as its UI) to the nascent jj version control ecosystem. The article points out that Magit's text-based UI offers efficiency and portability. By leveraging the LSP protocol, a Magit-like experience can be implemented in various editors, avoiding redundant development. The author envisions generating specific text files (such as .jj/status.jj) and utilizing LSP features like semantic tokens, folding ranges, and goto definition to achieve Magit-like version control operations. The ultimate goal is to create a cross-platform, efficient user interface for jj version control.

Development

Eventual Consistency: Challenges and Patterns in Distributed Systems

2024-12-13

Eventual consistency is unavoidable in distributed systems. This article explores four common patterns for handling eventual consistency: event-based eventual consistency, background sync eventual consistency, saga-based eventual consistency, and CQRS-based eventual consistency. Each pattern has its advantages and disadvantages. For example, the event-based pattern emphasizes loose coupling and scalability, but consistency takes time; while the saga-based pattern is suitable for complex, long-running transactions, ensuring consistency through compensating transactions. The choice of pattern depends on the specific needs and trade-offs of the system.

Mastering Ruby Debugging: From puts to Professional Tools

2024-12-13

This JetBrains RubyMine blog post delves into various approaches to debugging Ruby code, ranging from basic `puts` statements to interactive consoles (IRB and Pry) and powerful debuggers (byebug, debug, and the RubyMine debugger). Using a real-world bug example, it highlights the strengths and weaknesses of each tool, guiding developers in selecting the most appropriate debugger for improved efficiency. The article emphasizes that effective debugging isn't just about fixing errors; it's about gaining a fundamental understanding of the code to write more robust Ruby applications.

Rust Compiler: A Query-Based Incremental Compilation Architecture

2024-12-13

To address the efficiency issues of traditional pipeline-based compilation, the Rust compiler employs a query-based incremental compilation architecture. This architecture breaks down the compilation process into a series of interdependent queries, utilizing a compilation database to cache intermediate results. This allows recompilation only of necessary code sections. Similar to a build system's dependency management, this significantly improves compilation speed, especially beneficial in scenarios like IDE integration. While introducing complexity, this approach offers a more stable and efficient incremental compilation experience for Rust compared to gradual improvements to traditional methods, now default for development builds.

3

Refactoring in C++: Top Techniques and Best Practices

2024-12-13

This article explores common refactoring techniques in C++ and best practices for improving code quality. Refactoring, the process of restructuring existing code without changing functionality, enhances readability, efficiency, and maintainability. The article covers techniques like renaming variables and functions, extracting functions, simplifying conditional statements, optimizing loops, and removing code duplication. It emphasizes the importance of using IDEs with auto-refactoring capabilities and highlights best practices such as refactoring in small steps, using version control, and automated testing to minimize technical debt and improve overall code quality.

Git Project Deadlocked Over Rust Integration

2024-12-13

The Git project is embroiled in a heated debate over the integration of the Rust programming language. Proponents argue that Rust's memory safety and ease of refactoring would enhance Git's security and developer experience. However, opponents express concerns that Rust integration could compromise support for niche platforms like NonStop, potentially hindering Git's long-term viability. NonStop's prevalence in the financial sector, its reliance on Git, and the lack of a Rust compiler for the platform complicate the issue. The discussion ultimately reached no resolution, leaving the Git project grappling with a critical decision between maintaining broad platform support and improving security and developer experience.

Development Platform Support

Trinity Desktop Environment R14.1.3 Released: Lightweight, Efficient, and Ideal for Older Hardware

2024-12-13

The Trinity Desktop Environment (TDE) project team has released version R14.1.3, a lightweight, free desktop environment designed for users who prefer a lean and efficient experience. This release supports various Linux distributions, BSD, and DilOS, boasts low system requirements, making it ideal for older hardware. R14.1.3 includes numerous improvements, such as XDG Desktop Portal API integration, a new touchpad settings module, new themes and color schemes, and support for various applications and programming languages like Python 3.13. The project encourages donations to support its continued development.

Elixir/Erlang Hot Code Swapping: Zero-Downtime Deployments

2024-12-13

This article delves into Elixir/Erlang's hot code swapping capabilities, enabling the loading and unloading of code at runtime without requiring system restarts for application upgrades. A simple KV module example demonstrates manual hot swapping, while iex's c/1 and r/1 commands, and the Relups tool, are introduced for easier application and release upgrade management. The article explains Erlang applications, releases, appups, and relups, detailing the use of the Distillery tool to generate application releases and upgrade releases, ultimately achieving zero-downtime deployments and preventing service interruptions.

Development hot code swapping
1 2 3 4 5 7