frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Parse, Don't Validate (2019)

https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/
120•shirian•2h ago•52 comments

"Hate brings views": Confessions of a London fake news TikToker

https://www.londoncentric.media/p/london-tiktok-fake-news-creator-hate-immigrants
14•pbshgthm•16m ago•0 comments

Mathematicians disagree on the essential structure of the complex numbers

https://www.infinitelymore.xyz/p/complex-numbers-essential-structure
23•FillMaths•40m ago•5 comments

Simplifying Vulkan One Subsystem at a Time

https://www.khronos.org/blog/simplifying-vulkan-one-subsystem-at-a-time
110•amazari•3h ago•14 comments

Clean-room implementation of Half-Life 2 on the Quake 1 engine

https://code.idtech.space/fn/hl2
196•klaussilveira•5h ago•39 comments

Oxide raises $200M Series C

https://oxide.computer/blog/our-200m-series-c
280•igrunert•2h ago•162 comments

I started programming when I was 7. I'm 50 now and the thing I loved has changed

https://www.jamesdrandall.com/posts/the_thing_i_loved_has_changed/
224•jamesrandall•2h ago•173 comments

Show HN: I built a macOS tool for network engineers – it's called NetViews

https://www.netviews.app
77•n1sni•11h ago•30 comments

Qwen-Image-2.0: Professional infographics, exquisite photorealism

https://qwen.ai/blog?id=qwen-image-2.0
232•meetpateltech•7h ago•127 comments

Frontier AI agents violate ethical constraints 30–50% of time, pressured by KPIs

https://arxiv.org/abs/2512.20798
465•tiny-automates•13h ago•302 comments

Europe's $24T Breakup with Visa and Mastercard Has Begun

https://europeanbusinessmagazine.com/business/europes-24-trillion-breakup-with-visa-and-mastercar...
208•NewCzech•5h ago•165 comments

Show HN: I made paperboat.website, a platform for friends and creativity

https://paperboat.website/home/
5•yethiel•18m ago•3 comments

Jury told that Meta, Google 'engineered addiction' at landmark US trial

https://techxplore.com/news/2026-02-jury-told-meta-google-addiction.html
283•geox•3h ago•222 comments

Redefining Go Functions

https://pboyd.io/posts/redefining-go-functions/
36•todsacerdoti•2h ago•11 comments

Show HN: Rowboat – AI coworker that turns your work into a knowledge graph (OSS)

https://github.com/rowboatlabs/rowboat
5•segmenta•29m ago•0 comments

The US is flirting with its first-ever population decline

https://www.bloomberg.com/news/articles/2026-01-30/trump-immigration-crackdown-could-shrink-us-po...
121•alephnerd•2h ago•382 comments

Ex-GitHub CEO Launches a New Developer Platform for AI Agents

https://entire.io/blog/hello-entire-world/
76•meetpateltech•1h ago•55 comments

A method and calculator for building foamcore drawer organisers

https://capnfabs.net/posts/foamcore-would-be-a-sick-name-for-a-music-genre/
20•evakhoury•21h ago•5 comments

Rust implementation of Mistral's Voxtral Mini 4B Realtime runs in your browser

https://github.com/TrevorS/voxtral-mini-realtime-rs
354•Curiositry•15h ago•47 comments

Show HN: Distr 2.0 – A year of learning how to ship to customer environments

https://github.com/distr-sh/distr
45•louis_w_gk•4h ago•13 comments

RLHF from Scratch

https://github.com/ashworks1706/rlhf-from-scratch
39•onurkanbkrc•5h ago•1 comments

Discord Alternatives, Ranked

https://taggart-tech.com/discord-alternatives/
545•pseudalopex•22h ago•340 comments

Vercel's CEO offers to cover expenses of 'Jmail'

https://www.threads.com/@qa_test_hq/post/DUkC_zjiGQh
138•vinnyglennon•2h ago•97 comments

Why is the sky blue?

https://explainers.blog/posts/why-is-the-sky-blue/
742•udit99•1d ago•247 comments

Pure C, CPU-only inference with Mistral Voxtral Realtime 4B speech to text model

https://github.com/antirez/voxtral.c
262•Curiositry•15h ago•25 comments

80386 Barrel Shifter

https://nand2mario.github.io/posts/2026/80386_barrel_shifter/
50•jamesbowman•2d ago•4 comments

Zulip.com Values

https://zulip.com/values/
219•nothrowaways•16h ago•52 comments

Converting a $3.88 analog clock from Walmart into a ESP8266-based Wi-Fi clock

https://github.com/jim11662418/ESP8266_WiFi_Analog_Clock
583•tokyobreakfast•1d ago•186 comments

MIT Technology Review has confirmed that posts on Moltbook were fake

https://www.technologyreview.com/2026/02/06/1132448/moltbook-was-peak-ai-theater/
231•helloplanets•2d ago•111 comments

Discord will require a face scan or ID for full access next month

https://www.theverge.com/tech/875309/discord-age-verification-global-roll-out
1935•x01•1d ago•1851 comments
Open in hackernews

Redefining Go Functions

https://pboyd.io/posts/redefining-go-functions/
36•todsacerdoti•2h ago

Comments

pstuart•1h ago
Yikes, I don't see any legitimate use for this, other than hacking for the sake of hacking. Interesting read though.
maccard•1h ago
Hot reloading for development loops is _the_ canonical use case for this.
throwa356262•56m ago
Well, we are on Hacker News after all...
antonvs•51m ago
wdym, now it will be possible to implement Wordpress in Go
pjmlp•5m ago
You could already do that today, via OS IPC mechanisms, at the expense of higher systems resources, with each plugin being its own process.
jerf•1h ago
Other prior art: https://github.com/bouk/monkey with accompanying blog post https://bou.ke/blog/monkey-patching-in-go/
MadVikingGod•1h ago
This is all possible and quite neat to dive into the specifics, but if you really want to be able swap a std lib call, just turn it into a variable and change it.

  // code.go
  var now = time.Now

  // code_test.go
  func TestCode(t *testing.T) {
      nowSwap := now
      t.Cleanup (func() {
          now = nowSwap
      }
      now = func() time.Time {
          return time.Date(...)
      }
  }

Examples Code: https://github.com/open-telemetry/opentelemetry-go/blob/main... Test: https://github.com/open-telemetry/opentelemetry-go/blob/490f...
antonvs•52m ago
The point of the OP is that it changes calls to `time.Now` regardless of whether the code that's calling it uses your variable or not.
Groxx•19m ago
I suspect that using a build tag (say `test`) and two function definitions (one that directly calls `time.Now()` and one test-only one that uses a mutable var) will optimize out to zero cost in the non-test case - last I fiddled with that, it was pretty good at consistently inlining trivial wrapper funcs like that.
metadat•13m ago
That is a useful pattern, though I was unclear on why `t.Cleanup` and not `defer`. In case others are curious, too:

> Parallel subtestsWith t.Run(..., func(t testing.T) { t.Parallel(); ... }), the parent test function can return (and thus run its defers) before parallel subtests actually finish.*

nasretdinov•4m ago
I've used a different approach to this: there's no real need to modify the compiled binary code because Go compiles everything from source, so you can patch the functions at the source level instead: https://github.com/YuriyNasretdinov/golang-soft-mocks

The way it works is that at the start of every function it adds an if statement that atomically checks whether or not the function has been intercepted, and if it did, then executes the replacement function instead.

My tool no longer works since it was rewriting GOPATH, and Go since effectively switched to Go Modules, but if you're persistent enough you can make it work with Go modules too — all you need to do is rewrite the Go module cache instead of GOPATH and you're good to go.