SShortSingh.
Back to feed

Developer builds Rust CLI tool that cuts JS/TS codebase token usage by 83%

0
·30 views

A developer has released urai-ecma, an open-source command-line tool written in Rust that compresses JavaScript and TypeScript codebases before they are fed into large language models. The tool uses SWC (Speedy Web Compiler) to parse code into Abstract Syntax Trees, stripping out syntactic noise such as Tailwind CSS class strings and imperative loops while preserving architectural structure. In testing, it reduced a 209,757-token React codebase to roughly 36,000 tokens — an 82.7% reduction — in milliseconds. The project was motivated by the creator's own experience building an agentic Chrome extension, where oversized prompts caused slow inference, rate-limit exhaustion, and model hallucinations. The tool is designed to help developers avoid wasted API costs and attention degradation when using LLMs for codebase-level reasoning tasks.

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 ·

Repurposing One Tutorial Into a Week of YouTube Shorts Without Re-Filming

The article explains how creators can turn a single long tutorial into several Shorts over a week without shooting new footage. It recommends starting from a local MP4 copy of a video you own or have permission to reuse, since streamed screen recordings lose quality and are harder to edit. Good clips are described as standalone moments such as a single step, a mistake followed by its fix, or a before-and-after, with intros and recaps removed. The guide advises using a 1080x1920 vertical format, keeping cuts short, checking captions manually, and linking viewers back to the full video. It also suggests reviewing which clips held attention to pick topics for future long-form videos.

0
ProgrammingDEV Community ·

Why passwords must be hashed, not encrypted, and how salting and slow hashing defend against breaches

The article is a starter guide for backend developers on storing passwords and handling secrets safely. It argues that passwords should never be stored in readable form, since breaches are common and reused passwords spread the damage across services. Encryption is described as reversible and therefore unsuitable for passwords, while hashing is one-way and only needs to verify a match at login. General-purpose hashes like SHA-256 are criticized as too fast, making guessing attacks and precomputed rainbow tables practical. The piece recommends purpose-built algorithms such as bcrypt, scrypt, and Argon2, which add salting, deliberate slowness, and a tunable cost setting.

0
ProgrammingDEV Community ·

Designing Multi-Store Retail Systems: Key Technical Considerations for Developers

Retail businesses with several locations often struggle when separate point-of-sale, inventory, order, and reporting applications cannot share information reliably. The article argues that building such systems requires attention to data consistency, integration, scalability, security, and performance, not just dashboards and basic CRUD features. It recommends a multi-tenant architecture that keeps each store's records logically separate within a shared environment, with stores potentially needing distinct pricing, tax rules, or permissions. Inventory synchronization is highlighted as especially difficult, calling for atomic transactions, concurrency control, stock reservations, and audit records, with event-driven designs helping coordinate changes across services. Finally, it advises using well-structured APIs and webhooks to connect third-party tools, with proper error handling, retries, authentication, and rate limiting.

0
ProgrammingDEV Community ·

How to Calculate the True Cost of Enterprise AI Agents Using Observability

Token rate cards understate what enterprise AI agents actually cost, because agents make many model calls, invoke tools, retry, and sometimes loop. The guide proposes measuring cost per completed task, which divides total spend, including failed and abandoned attempts, by the number of tasks that actually finished. Total spend should cover model tokens, retries, tool and API fees, shared infrastructure, evaluation and telemetry overhead, and human review. Accurate figures require tracing every step to its parent task and labeling each task's outcome. An AI observability platform supplies that linked record, which makes the full cost measurable.