frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Show HN: A daily question to train positive thinking and boost your mood

https://apps.apple.com/us/app/daily-optimist-think-positive/id1466175138
1•nikodunk•4m ago•0 comments

Bash Style Guide

https://style.ysap.sh/
1•smartmic•8m ago•0 comments

Weeklong MathWorks outage due to cyberattack

https://news.ki.se/operatinginfo/service-status-mathworks
1•ayhanfuat•10m ago•0 comments

Show HN: DeepShot – NBA game predictor with 71% accuracy using ML and stats

https://github.com/saccofrancesco/deepshot
1•francescosacco•12m ago•0 comments

What It's Really Like to Face Off with a Grizzly Bear–and Live to Tell the Tale

https://www.rollingstone.com/culture/culture-features/grizzly-bear-attack-survival-1235333910/
1•bookofjoe•14m ago•1 comments

What Is the Bank of the Future

1•misiak•14m ago•0 comments

LLMs Are Weird, Man

https://surfingcomplexity.blog/2025/05/25/llms-are-weird-man/
1•ingve•15m ago•0 comments

George Hotz's Advice to Tenstorrent

https://github.com/geohot/tt-tiny
3•lexoj•16m ago•0 comments

Researchers claim ChatGPT o3 bypassed shutdown in controlled test

https://www.bleepingcomputer.com/news/artificial-intelligence/researchers-claim-chatgpt-o3-bypassed-shutdown-in-controlled-test/
2•wrayjustin•17m ago•0 comments

Retirees, Get Ready to Need Long-Term Care. Here's What to Know

https://www.nytimes.com/2025/05/24/business/retirement-long-term-care.html
1•whack•20m ago•0 comments

We Forked MinIO

https://github.com/OpenMaxIO/openmaxio-object-browser
2•jnfinitym•21m ago•2 comments

Bitmap Images in 1965 – Mariner 4

https://oliverkwebb.github.io/articles/bmp-1965/
2•oliverkwebb•24m ago•0 comments

The Lycurgus Cup

https://en.wikipedia.org/wiki/Lycurgus_Cup
1•Jimmc414•24m ago•0 comments

Looking for Keys Under the Lamppost

https://www.johndcook.com/blog/2025/05/25/lamppost/
2•zdw•29m ago•0 comments

I built Repostify: Post once, grow everywhere – it reposts whatever you post

https://repostify.io/
1•sumner250•29m ago•1 comments

Stock Simplifed for You

https://www.yourwealthsignal.com
1•its_bey•33m ago•1 comments

Riffing on Apple Jam Packs

https://512pixels.net/2025/05/riffing-on-apple-jam-packs/
1•herbertl•34m ago•1 comments

Gen Z's new side hustle: selling data

https://www.axios.com/2025/05/20/gen-z-data-privacy-generation-lab-verb-ai
1•herbertl•44m ago•0 comments

We automated 100% of our outbound calls using AI agents

https://outboundapi.com
1•agrassb•45m ago•0 comments

Car Physics for Games

https://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html
3•romes•46m ago•0 comments

The $3,300M CIA Salvage of AZORIAN (Waterline stories) [video]

https://www.youtube.com/watch?v=M2gT1FqLBCc
1•zeristor•46m ago•2 comments

Show HN: Waitlister – The best software for creating product launch waitlists

https://waitlister.me/
1•coldsummeragain•47m ago•0 comments

Understanding Cost Models (2020)

https://justinjaffray.com/understanding-cost-models/
2•tanelpoder•48m ago•0 comments

Interactive Post-Training for Vision-Language-Action Models

https://arxiv.org/abs/2505.17016
3•badmonster•48m ago•0 comments

OpenAI's Stargate Megafactory with Sam Altman [video]

https://www.youtube.com/watch?v=GhIJs4zbH0o
2•aresant•50m ago•0 comments

U.S. Dept of Defense GitHub marked as archived, with it projects like ATAK-CIV

https://github.com/deptofdefense
6•the-anarchist•51m ago•3 comments

Poo-Poo Project Saves Wyoming Owls, Other Birds Horrible Public Toilet Deaths

https://cowboystatedaily.com/2025/05/24/poo-poo-project-saves-wyoming-owls-other-birds-from-horrible-public-toilet-deaths/
2•Bender•52m ago•0 comments

CISA warns of attacks on Commvault's Microsoft Azure environment

https://www.scworld.com/news/cisa-warns-of-attacks-on-commvaults-microsoft-azure-environment
2•Bender•55m ago•0 comments

You could have invented Transformers

https://gwern.net/blog/2025/you-could-have-invented-transformers
5•jxmorris12•55m ago•0 comments

AI may soon account for half of data center power use if trends persist

https://techxplore.com/news/2025-05-ai-account-center-power-trends.html
3•geox•56m ago•0 comments
Open in hackernews

Writing a Self-Mutating x86_64 C Program (2013)

https://ephemeral.cx/2013/12/writing-a-self-mutating-x86_64-c-program/
56•kepler471•4h ago

Comments

belter•3h ago
I guess in OpenBSD because of W ^ X this would not work?
akdas•3h ago
I was thinking the same thing. Usually, you'd want to write the new code to a page that you mark as read and write, then switch that page to read and execute. This becomes tricky if the code that's doing the modifying is in the same page as the code being modified.
timewizard•3h ago
The way it's coded it wouldn't; however, you can map the same shared memory twice. Once with R|W and a second time with R|X. Then you can write into one region and execute out of it's mirrored mapping.
rkeene2•3h ago
In Linux it also needs mprotect() to change the permissions on the page so it can write it. The OpenBSD man page[0] indicate that it supports this as well, though notes that not all implementations are guaranteed to allow it, but my guess is it would generally work.

[0] https://man.openbsd.org/mprotect.2

Retr0id•2h ago
It's not required on linux, if the ELF headers are set up such that the page is mapped rwx to begin with. (but rwx mappings are generally frowned upon from a security perspective)
mananaysiempre•2h ago
Not as is, but I think OpenBSD permits you to map the same memory twice, once as W and once as X (which would be a reasonable hoop to jump through for JITs etc., except there’s no portable way to do it). ARM64 MacOS doesn’t even permit that, and you need to use OS-specific incantations[1] that essentially prohibit two JITs coexisting in the same process.

[1] https://developer.apple.com/documentation/apple-silicon/port...

alcover•2h ago
I often think this could maybe allow fantastic runtime optimisations. I realise this would be hardly debuggable but still..
Retr0id•2h ago
It already does, in the form of JIT compilation.
alcover•2h ago
OK but I meant in already native code, like in a C program - no bytecode.
Retr0id•1h ago
I mean that, too.
connicpu•6m ago
LuaJIT has a wonderful dynamic code generation system in the form of the DynASM[1] library. You can use it separately from LuaJIT for dynamic runtime code generation to create machine code optimized for a particular problem.

[1]: https://luajit.org/dynasm.html

vbezhenar•2h ago
I used GNU lightning library once for such optimisation. I think it was ICFPC 2006 task. I had to write an interpreter for virtual machine. Naive approach worked but was slow, so I decided to speed it up a bit using JIT. It wasn't a 100% JIT, I think I just implemented it for loops but it was enough to tremendously speed it up.
userbinator•1h ago
Programs from the 80s-90s are likely to have such tricks. I have done something similar to "hardcode" semi-constants like frame sizes and quantisers in critical loops related to audio and video decompression, and the performance gain is indeed measurable.
alcover•1h ago
> "hardcode" semi-constants

You mean you somehow avoided a load. But what if the constant was already placed in a register ? Also how could you pinpoint the reference to your constant in the machine code ? I'm quite profane about all this.

ronsor•1h ago
> Also how could you pinpoint the reference to your constant in the machine code?

Not OP, but often one uses an easily identifiable dummy pattern like 0xC0DECA57 or 0xDEADBEEF which can be substituted without also messing up the machine code.

mananaysiempre•22m ago
If you’re willing to parse object files (a much easier proposition for ELF than for just about anything else), another option is to have the source code mention the constants as addresses of external symbols, then parse the relocations in the compiled object. Unfortunately, I’ve been unable to figure out a reliable recipe to get a C compiler to emit absolute relocations in position-independent code, even after restricting myself to GCC and Clang for x86 Linux; in some configurations it works and in others you (rather pointlessly) get a PC-relative one followed by an add.
userbinator•8m ago
All the registers were already taken.

You use a label.

oxcabe•1h ago
It's impressive how well laid out the content in this article is. The spacing, tables, and code segments all look pristine to me, which is especially helpful given how dense and technical the content is.
ivanjermakov•1h ago
I had a great experience writing self modified programs is a single instruction programming game SIC-1: https://store.steampowered.com/app/2124440/SIC1/