Urgent.News

What's breaking now, across thousands of outlets.

Tech

I Rewrote One Function in Squirrel, Then in C. One Line of Python Was Just as Fast.

I maintain a 2D game engine in Python called ABS Engine. Last week I decided it needed C. Not because anything was slow. That is the embarrassing part. I wanted to drop a .c file into a folder and call it from Python with no build step anyone has to know about. It took 197 lines, most of them docstrings. The first function I moved over was clamp . Keep a number between a low and a high. Three…

In the ABS Engine, a 2D game engine, a Python programmer rewrote the clamp function, initially in Python, then in Squirrel, and finally in C. The function's purpose was to constrain a number within a specified range. The C version of clamp, containing only three comparisons, proved to be as fast as the Python and Squirrel implementations.

The Python implementation called the function with three float() conversions, while the C version required only a call without the conversions. The C function was implemented in mathutil.h, and the CFFI library was used to load the compiled C code into Python. This approach eliminated the need for a build step, and the programmer could simply edit the C code, run the program, and see the changes take effect immediately.

The programmer aimed to streamline the process of incorporating C code into the Python game engine, allowing for seamless integration without the burden of build configurations.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Review time is up 441% under vibe coding. That is the real problem.

A state-of-the-art review of the first body of evidence on AI-assisted development was posted to arXiv on 20 Aug 2026. It is a preprint, not itself peer reviewed, though the field experiments it…

  • Code-review time increased by 441% under vibe coding workflow
  • Productivity records show mixed results: 26% more tasks per week vs 19% slowdown
  • Authors suggest measurement method, scope, and horizon affect productivity perception

Architecting a Low-Power Geofencing Engine for Android

It happened during a quiet, mid-afternoon meeting. The room was deathly silent, the air thick with the weight of a quarterly review, when my phone decided to belt out an aggressive, high-decibel…

  • Speaker found phone disrupting meeting with loud ringtones
  • Implemented geofencing engine using Google Play Services Location API
  • Added hysteresis buffer and foreground service for reliability

Oracle Integration Cloud Integration Patterns

Twelve reusable patterns, real-world examples, and implementation guidance for Oracle Integration 3 About this field guide I wrote this guide to connect Oracle Integration features with the…

  • Oracle Integration Cloud provides twelve practical integration patterns
  • Synchronous request-reply pattern used for immediate caller response
  • API facade and protocol mediation hides protocol differences

More from Saturday 12 September →