Skip to content
NewA calmer, faster ZeroHour

Simon Willison compares C vs Rust for SQLite parse_number extension

Original title: parse_number() as a SQLite extension: C vs Rust

Simon Willison ()1 · 1 read
AI summary · x-ai/grok-4.7Summaries by Vani AI

The author prompts Claude to explore building a custom SQLite function that parses strings like '-$1,234.56' into numbers, comparing C and Rust implementations on performance and code size.

Simon Willison wondered how easy it would be to write a SQLite C extension adding a parse_number() function. He used Claude to compare building it in C versus Rust, focusing on performance, code complexity, and size of the resulting code. The function would strip commas, dollar signs, pounds, and percent signs, handle a leading minus, and return NULL for unparsable values.

Unconfirmed: No code samples or benchmarks are provided; only the prompting framework and comparison goals.

Key facts
  • Function strips ',', '$', '£', '%' and handles leading '-'
  • Returns NULL for unparsable inputs
  • Compares C and Rust implementations
  • Uses Claude Opus 5.5 for exploration
Explain this AI news with Vani AIWhat was announced, what is new and why it matters, in a new chat

From the original article

Research: parse_number() as a SQLite extension: C vs Rust I was out walking the dog when I got curious about how easy/difficult it would be to write a SQLite C extension that adds a parse_number() function for turning strings like -$1,234. 56 or '12. 5%' into numeric values that could be summed and sorted.

Simon Willison

simonwillison.net

Read the full article at Simon Willison

A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.