frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

More Tailscale tricks for your jailbroken Kindle

https://tailscale.com/blog/jailbroken-kindle-proxy-tun-modes
51•Error6571•55m ago•1 comments

User Interfaces of the Demo Scene

https://www.datagubbe.se/scenegui/
39•zdw•1h ago•4 comments

Codex Security

https://github.com/openai/codex-security
445•bakigul•9h ago•136 comments

LearnVector – Andrew Ng's AI company building one‑to‑one learning experiences

https://learnvector.ai/
124•ajhai•4h ago•64 comments

Transformer Transformer: A Unified Model for Motion-Conditioned Robot Co-Design

https://transformer-transformer.github.io/
23•ilreb•2h ago•0 comments

Show HN: I was tired of opening 2 tabs for every HN link, so I made a userscript

https://github.com/twalichiewicz/HNewhere
218•twalichiewicz•7h ago•63 comments

Substack writers, you need a website

https://elizabethtai.com/2026/06/10/substack-writers-you-need-a-website/
479•speckx•12h ago•227 comments

Half-Life ported to Mac OS 9

https://mac-classic.com/news/half-life-ported-to-mac-os-9/
200•freediver•8h ago•96 comments

Cracking Windows Open: Porting RADV to Win32

https://www.collabora.com/news-and-blog/news-and-events/cracking-windows-open-porting-radv-to-win...
10•zdw•1h ago•0 comments

Truth is not a direction: a Tarski attack on LLM probes

https://abeljansma.nl/2026/07/10/truth-is-not-a-direction.html
67•abelaer•1d ago•18 comments

Teach yourself programming in ten years (1998)

https://www.norvig.com/21-days.html
98•vinhnx•2d ago•42 comments

Multiple Mouse Cursors in Wayland

https://blinry.org/multi-seat-wayland/
72•marvinborner•4h ago•45 comments

Hubble: Open-source notetaking app for you and your agents

https://www.hubble.md/
79•handfuloflight•5h ago•21 comments

ReFrame – The EPaper Camera

https://reframe.camera/
79•phil294•6h ago•18 comments

Kimi K3 Architecture Overview and Notes

https://sebastianraschka.com/blog/2026/kimi-k3-architecture-notes.html
363•ModelForge•14h ago•62 comments

Steel Bank Common Lisp version 2.6.7

https://sbcl.org/all-news.html?2.6.7
214•tmtvl•12h ago•91 comments

Beyond Greece and Rome

https://aeon.co/essays/uncovering-a-global-ancient-history-beyond-greece-and-rome
21•diodorus•1d ago•10 comments

Hooray for the Sockets Interface

https://blog.apnic.net/2026/07/28/hooray-for-the-sockets-interface/
19•jruohonen•3h ago•14 comments

Delayed Gratification – Proud to Be 'Last to Breaking News'

https://www.slow-journalism.com/
266•speerer•14h ago•154 comments

Log is non-monotonic in PHP and Lua

https://purplesyringa.moe/blog/log-is-non-monotonic-in-php-and-lua/
27•ibobev•5d ago•16 comments

The iPhone Upgrade Program is being replaced by Apple Upgrade

https://www.apple.com/shop/iphone/iphone-upgrade-program
156•lkurtz•12h ago•306 comments

Interview with Boris Cherny [video]

https://www.youtube.com/watch?v=qyPCVqFUyDo
48•knighthacker•1d ago•50 comments

Zig's Incremental Compilation Internals

https://mlugg.co.uk/posts/incremental-compilation-internals/
216•garyhtou•14h ago•150 comments

Show HN: Lean4 Datalog DSL Based on Google Zanzibar for AI Projects

https://github.com/jagg-ix/zil-lean
11•kbradero•3h ago•2 comments

The Difference Between a Button and a Link

https://unplannedobsolescence.com/blog/buttons-vs-links/
59•alexpetros•5h ago•39 comments

Una GPS smart watch – Repairable, USB-C charging, developer-friendly

https://unawatch.com/
167•pimterry•15h ago•111 comments

Lightweight Spring Boot Monitoring Without Prometheus and Grafana

https://pvrlabs.xyz/articles/lightweight-spring-boot-monitoring.html
20•ejboy•5h ago•2 comments

Now is the time to give LLMs access to the ACM digital library

https://cacm.acm.org/opinion/now-is-the-time-to-give-llms-access-to-the-acm-digital-library/
140•rbanffy•14h ago•115 comments

New HIV vaccine shows unprecedented success in preclinical study

https://www.lji.org/news-events/news/post/new-hiv-vaccine-shows-unprecedented-success-in-preclini...
609•codebyaditya•16h ago•262 comments

Discovering Cryptographic Weaknesses with Claude

https://www.anthropic.com/research/discovering-cryptographic-weaknesses
199•gslin•12h ago•138 comments
Open in hackernews

Log is non-monotonic in PHP and Lua

https://purplesyringa.moe/blog/log-is-non-monotonic-in-php-and-lua/
27•ibobev•5d ago

Comments

dmitrygr•5d ago

  > you can compute any logarithm from two base-e ones.
They need not be base e. Any base will do as long as it is the same for both the numerator and the denominator
purplesyringa•5d ago
Yeah, I simplified it a little. Though I must say I'm surprised pretty much every library I looked at uses the natural logarithm specifically, and not log2, which would seemingly be easier to compute with floats. Does anyone here know why, by any chance?
stackghost•5d ago
Not sure why they wouldn't use log2 internally, but the mathematical reason is that e^x is the function whose derivative is itself, so it and the natural logarithm are fundamental to lots of other theories/operations like Euler's formula.
AlotOfReading•5d ago
You can change base with a single multiplication by special constants if you accept 1ULP error, so working in one or the other doesn't really gain you much. But exp/logs are often implemented as a combination of a table lookup and polys, so you can just bake it into the constants even more easily.
lioeters•5d ago
Recently I was reading an article on the EML operator (exp-min-log) that uses exponentiation and logarithm to build elementary math functions including arithmetic operations. There was a table of results from testing across languages.

  Language         Result of 2 x 3    Error
  ---
  Node.js v25.3.0  6.000000000000000  0
  Python 3.9.6     6.000000000000001  8.88e-16
  PHP 8.5.1        6.000000000000001  8.88e-16
  Go 1.26.2        6.000000000000000  0
  Rust             6.000000000000001  8.88e-16
It was speculated that this miniscule margin of error, 1 ULP (unit in the last place), is likely due to the difference in how log() is implemented by the language. Supposedly Python, PHP, and Rust use LLVM's libm (C math library) but maybe Go and Node.js internally compile to CPU instructions directly? There was no evidence presented, so I was skeptical of this explanation.
purplesyringa•5d ago
Python, PHP, and Rust do indeed use libm. Not LLVM's libm specifically, though, but rather just about anything they can find in runtime, and those libraries can have suboptimal accuracy.

Node uses V8, which notably implements a ton of math manually, because it needs the results to be deterministic across devices. It seemingly uses LLVM's libm, which IIRC promises 0.5 ulp for most operations. (https://github.com/v8/v8/blob/f24c62fbc342d616032734b714116e...)

Go avoids dynamic linking, so they also have their own implementation. (https://github.com/golang/go/blob/543ead71a8e7acc2bd6f326327...) They only promise 1 ulp, but I guess in this specific case it works out better than approximations used by the default libm on their system by pure chance?

lioeters•5d ago
Nice, thanks for tracking down those links, fascinating. Apparently being off by 1 ULP is within IEEE 754 floating-point spec, and "effectively negligible".
cwt137•5d ago
I find it interesting the blog author tied PHP and Lua together. PHP uses a JIT from Lua. Is this related to the log issue?
purplesyringa•5d ago
> PHP uses a JIT from Lua.

Wow, TIL! I was certain this is a mistake, but apparently PHP uses DynAsm (https://wiki.php.net/rfc/jit), which was developed for LuaJIT (https://luajit.org/dynasm.html). Cool stuff!

To answer your question, probably not. I dated the PHP change that added this "optimization" back to 2014 (https://github.com/php/php-src/commit/b547e1358d3846fad4cd0c...), while DynAsm only started being used around 2019 (https://wiki.php.net/rfc/jit). I think this is just convergent evolution.

(I'm putting "optimization" in quotes because it changes semantics.)

kristianp•5d ago
Wouldn't a more applicable title be that the log base is non-monotonic?
purplesyringa•4d ago
The log base is a parameter, not a function, so that doesn't typecheck. Multivariate monotonicity isn't really a popular term, as far as I'm aware, so I'm not aware of good terminology for this. Maybe "log is non-monotonic with respect to the base"?
kstrauser•29m ago
I was prepared to read how its console logging function could reorder writes so that

  log('a');
  log('b');
could result in

  b
  a
or something, which would've been no less surprising.
ReactiveJelly•24m ago
> Everyone already knows floating-point operations are imprecise and it wouldn’t be fun to blog about.

Wellll... Yes and no. And I want to nitpick "FP ops are imprecise" because it's important sometimes.

It does come up in Lua - Lua uses 64-bit double floats for everything, _even array indexing_, because they have 53 bits of mantissa and they're guaranteed to represent all 32-bit integers with 100% precision.

I just opened Lua and got `2 ^ 32 == 4294967296.0` and `2 ^ 32 + 1 == 4294967297.0`. You can store 4 billion things in a Lua table and access them with double float indexes.

The usual "0.1 + 0.2 != 0.3" is _not_ imprecision. You could dedicate 1,000 bits to a float and still find some example of a number that's trivial to represent in decimal but repeats forever in binary.

While I'm on it, fixed-point and floating-point aren't magically different. Floats work better on very big values. Fixed-points are more predictable but run out of range easily when squaring numbers. This comes in 3D math when finding the length of vectors or normalizing vectors.

The PlayStation 1 didn't have jiggly vertices and warpy textures because of fixed-point. It had jiggly vertices because its GPU didn't have subpixel-precise rendering, and it only had 16 bits of precision. It had warpy textures because it had affine texture mapping. The N64's GPU had more bits of precision and it had perspective-correct texture mapping. There's no 16-bit floating-point format that would have saved the PS1 from wobbling.

Also floats aren't the cause of T-junctions or "sparklies" that are common in 3D game levels. That will happen in any system with finite precision, and if fixed-point would fix it, we'd use fixed-point.

AlotOfReading•5d ago
Correctly rounding transcendental functions is very difficult because of something called the table maker's dilemma, so the standard didn't want to impose a potentially extreme performance cost if they didn't have to.

Correctly rounded single precision functions at a reasonable cost are much easier these days. LLVM 18+ implements them, but the gnu libraries have been slower to improve.

ReactiveJelly•36m ago
"The Table-Maker's Dilemma"

https://people.eecs.berkeley.edu/~wkahan/LOG10HAF.TXT

This is the best source I could find, funny enough the author doesn't explain the name "table maker".

I suppose it's from the parable of a table maker who finds that one leg is too long, so they sand down that leg, only to find that another leg is too long, so they sand that down... slowly sanding away all the legs.

As a simple programmer I don't understand the dilemma. I do understand that sin, tan, sqrt, etc., take one argument, so you can guarantee a certain precision for them, at least in 32-bit floats, whereas a log in arbitrary base has two inputs, so its input space is huge and it's hard to guarantee anything, especially for 64-bit doubles.

If someone could write up a good explanation that could be its own HN post

thirdhaf•7m ago
My assumption is it's referring to mathematical tables and the historical makers of them. https://en.wikipedia.org/wiki/Mathematical_table