AI 资讯
Adding OpenAPI Support to Mummy, a Nim HTTP Framework
Nim doesn't have a lot of options for building HTTP APIs with the kind of batteries-included developer experience you get in frameworks like FastAPI or Express with Swagger middleware. mummy is a fast, solid HTTP/WebSocket server library for Nim (my fork with the additions below is at github.com/isaiahpeter/mummy ) — but out of the box, it doesn't generate OpenAPI specs, validate request bodies, or give you typed path parameters. So I forked it and added those. This post walks through what I built, why, and what I learned extending an existing Nim library instead of starting from scratch. Why mummy, and why OpenAPI I wanted a Nim backend for a few projects (a contact-form API, a todo API demo) and kept missing three things I'd take for granted in other ecosystems: Auto-generated API docs — a /docs endpoint you can actually hand to someone, generated from your routes instead of hand-written. Typed path parameters — pulling id out of /users/{id} as an int without manual parsing and error handling in every handler. Request validation — rejecting a bad JSON body before it reaches your handler logic, with a schema to back it up. mummy is fast and minimal by design, which is exactly why it was worth extending rather than replacing. What I added OpenAPI spec generation. I added openapi_schema.nim and openapi_router.nim , which let you wrap routes in an OpenApiRouter and attach a summary, tags, and a response schema via schemaOf . The router serves both /openapi.json and a browsable /docs page generated from your actual route definitions — so the docs can't drift out of sync with the code the way hand-written API docs do. Typed path parameters. pathParam[T](request, "id") pulls a path segment and parses it as the type you ask for, with a clean 400 response if parsing fails. One gotcha worth flagging if you try this yourself: in this Nim version, the generic dot-call form ( request.pathParam[int]("id") ) doesn't parse — you have to call it as pathParam[int](request, "id") in
AI 资讯
MyAnimeList-Module (NPM)
MyAnimeList Module This module is neither affiliated with nor endorsed by MyAnimeList. All data returned by this module is provided by MyAnimeList. Version 1.0.5 Installation Install myanimelist-module with npm npm install myanimelist-module Usage/Examples const { MyAnimeList } = require ( ' myanimelist-module ' ) const mal = new MyAnimeList ({ client_id : `YOUR_MAL_CLIENT_ID` // Get it here: https://myanimelist.net/apiconfig }) async function test () { const response = await mal . getAnimeInfo ({ name : " Anime name " }) if ( response . error ) { console . error ( response . error ) } else { console . log ( response . datas ) } } test () All functions new MyAnimeList() Parameter Type Description client_id string Required . Your MAL Client ID getAnimeInfo() Parameter Type Description name string Required . fields [array] Optional. More information in the "Available fields" section. limit number Optional. Number of items in the response. (Maximum of 100) offset number Optional. Default : 0 nsfw boolean Optional. Default: false getAnimeInfoByURL() Parameter Type Description api_url string Required . You must use any valid MyAnimeList API link. It also works with older responses via response.datas.paging.next and response.datas.paging.previous . getSpecificAnimeInfo() Parameter Type Description name string Required . fields [array] Optional. More information in the "Available fields" section. nsfw boolean Optional. Default: false getAnimeInfoByID() Parameter Type Description id string Required . fields [array] Optional. More information in the "Available fields" section. nsfw boolean Optional. Default: false getAnimeRanking() Parameter Type Description type string Optional. More information in the "Available ranking types" section. fields [array] Optional. More information in the "Available fields" section. limit number Optional. Number of items in the response. (Maximum of 500) offset number Optional. Default : 0 nsfw boolean Optional. Default: false getSeasonalAnime(
AI 资讯
A fantastical journey unfolds in gorgeous Wildwood trailer
"I will tear apart this forest and bring back what it took from me."
AI 资讯
The Best Cat Water Fountains of 2026: Petlibro, Petkit, Oneisall
Ensuring your cat stays hydrated is one of the best ways to keep your pet healthy. The right pet water fountain can help.
安全
US boosts drone surveillance as flesh-eating screwworms spread in Texas
Hundreds of Homeland Security drones retasked to survey wildlife and livestock.
开发者
Animating CSS border-image
Border images are an overlooked feature. One neat fact is that border image slices can run across entire borders on an element, and animating it creates beautiful effects. Animating CSS border-image originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.
AI 资讯
Dogs can tell if you're scared or sad
fMRI scans show happiness, fear, anger, and sadness have distinct brain activity patterns in doggy brains.
科技前沿
The 12 Best Anime to Watch if You Think You Hate Anime
Japan’s strongest media export makes a solid case for your attention span. Here’s what to watch.
创业投融资
Gene-Edited Puppies Will Melt Your Heart—but Won’t Trigger Your Allergies
A startup has created beagles without the gene that causes runny noses and watery eyes for allergy sufferers.
科技前沿
Cougars Lower the Risks of Car Crashes by Hunting Deer
A new study shows how the big cats cause deer to move away from roads and deeper into the forest, where they pose less of a hazard to motorists.
产品设计
Research roundup: 6 cool science stories we almost missed
Also: Cyborg diving suits for cockroaches, why sleepy sperm whales blow bubbles, Betelgeuse's companion star.
科技前沿
Don’t Get Too Attached to Jimothy
Urban wildlife biologists say the stumpy raccoon seems to have adapted well to his environment and spinal condition—but his internet fame presents a new threat.
开发者
Inside the Wild Rescue Mission That Took 4 Beluga Whales to Chicago
Beluga whales were in danger of getting euthanized after a Canadian theme park went bust. WIRED spoke with some of the scientists behind the groundbreaking rescue mission.
科技前沿
Contagious Cancer Found in North American Catfish
Scientists identified the first known cancer transmissible among freshwater fish in a lake that spans the US and Canada.
科技前沿
Orcas team up to ram sunfish until they explode
“We think this may help younger orcas feed more easily, or it could also just be for fun.”
AI 资讯
littlebag Creator Seeks User Feedback to Validate 343-Byte UI Framework's Utility Despite Performance Limitations
Introduction: Unveiling littlebag Meet littlebag , a reactive UI framework that defies conventional expectations by packing essential features into a mere 343 bytes (minified and brotlified). This isn’t just a technical curiosity—it’s a proof of concept that challenges the notion that UI frameworks must be bloated to be functional. littlebag includes: Reactive state management via state and effect , enabling dynamic updates without manual DOM manipulation. An html element factory that inherently supports reactivity, reducing boilerplate code. Conditional rendering with keyed , allowing efficient updates to specific UI segments. Reactive lists using each , simplifying the handling of dynamic data collections. TypeScript declarations , ensuring type safety and developer productivity. The framework’s size is achieved through aggressive tree-shaking and code minimization , stripping away all non-essential logic. However, this comes at a cost: performance limitations due to the absence of optimizations like virtual DOM diffing or batch updates . Each reactive update triggers direct DOM manipulation, which can lead to layout thrashing —a mechanical process where frequent reflows and repaints cause frame rate drops, making the UI feel sluggish. Inspired by VanJS (1 kB) and its dependency on an additional 1.2 kB library (Van X), littlebag aims to eliminate such overhead. Yet, its current state is experimental. Without user feedback, it risks remaining a niche project, failing to address its performance bottlenecks or evolve into a viable alternative to larger frameworks. The creator’s plan to add Server-Side Rendering (SSR) hinges on community interest, but SSR itself introduces complexity—requiring a custom DOM implementation to avoid client-side hydration costs. If users engage, littlebag could become a lightweight SSR solution; if not, it may stagnate as a curiosity. The stakes are clear: littlebag’s utility depends on whether it can balance its minimalism with practical
开发者
Dragonflies maneuver like fighter pilots
Male dragonflies' dramatic aerial combat maneuvers emerge from relatively simple vision-based rules.
科技前沿
Scientists Have Identified a New Fossil Species of Axolotl in Mexico
Ambystoma quetzalcoatli is the first fossil salamander to be formally identified in Mexico, revealing that axolotls have inhabited the country for millions of years.
AI 资讯
AI Skipped Class - Turns Out It Didn't Need To Go
What happens when a machine no longer needs to be trained to see something new? That's the quiet question sitting underneath this week's news, buried next to a less invasive brain implant and a handful of robots getting tougher for the real world. Neuralink says it's completed its first "transdural" brain implant, a surgical approach built to reduce trauma during the procedure. As someone who spends a lot of time thinking about how you get sensors close to a human eye without hurting anyone, I find these less-invasive-implant strategies worth watching, because the surgical-risk problem is basically the same one we wrestle with in ophthalmic hardware. Vision is getting less invasive too, in its own way. Roboflow rolled out text-prompt object detection built on SAM3 (Meta's latest segmentation model): you type the class of object you want "forklift," "cracked tile," whatever, and it returns boxes and masks without you collecting a single training image first. That's a real shift. For most of computer vision's history, teaching a model to recognize something new meant labeling hundreds of examples before you could even start; this collapses that step into a sentence. The same week brought several applied builds using the same detect-then-orchestrate pattern: a drone system that patrols for intrusions, a pipeline that inspects transmission lines for damaged cables, and an airport tool that spots foreign debris on the tarmac. The Robot Report's roundup of June's biggest robotics stories leaned heavily on humanoid robots companies going public, new deployments, and production milestones stacking up faster than would have seemed plausible a few years ago. Apptronik unveiled its Apollo 2 humanoid alongside a dedicated data-collection facility built so the robot keeps learning after it's deployed, not just during initial training which quietly answers one of the harder questions in robotics: how do you keep a system improving once it's out of the lab? X Square Robot raised e
产品设计
Wildwood featurette lifts the veil on building its stop-motion world
Director Travis Knight is also the creative mind behind 2016's Oscar-nominated Kubo and the Two Strings .