frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Interactive Programming in C (2014)

https://nullprogram.com/blog/2014/12/23/
87•ofalkaed•1d ago

Comments

lkuty•1d ago
Tsoding made a video about hot code reloading in C (https://www.youtube.com/watch?v=Y57ruDOwH1g) and also used the same concept in "My Own 3b1b Animation Engine but in C" (https://www.youtube.com/watch?v=RVwuYgXNUCM).
uticus•1d ago
> When the library loads without error, look up the GAME_API struct.... If looking up the GAME_API fails, close the handle and consider it a failure.

Error handling strategies, and what fallback state things fall into when the hot code breaks, would be great to hear about.

90s_dev•1d ago
I did something similar ones as a vs code extension for love2d which I called live2d, so that you could develop your game while it was running. It was incredibly fun, but incredibly hard to use, and nobody had any interest in it, so I abandoned it and lost the source code eventually. But it worked so well. I had invented this thing called magic tables to go along with it and make it easier to use, I forgot what they did, I just remember the name and how cool it was.
fao_•1d ago
My favourite go-to for that in Love2D has been rxi's lurker: https://github.com/rxi/lurker
binary132•5h ago
How well does this work?
RustyRussell•1d ago
Andrew Tridgell's KnightCap did this differently: it's a network chess server, and it would dump its data to a file and re-exec. The trick here is that it would keep the (network) fds open for zero downtime. IIRC he used a Perl script called datadumper to gen the code marshal/demarshal the structures.

This has the advantage that reboots can be handled fairly seemlessly too (though there will be reconnections then of).

sitkack•1d ago
https://man7.org/linux/man-pages/man2/pidfd_getfd.2.html

https://gist.github.com/kentonv/bc7592af98c68ba2738f44369208...

For those curious research "SCM_RIGHTS" (Socket-Level Control Message) and sendmsg/recvmsg

o11c•1d ago
The main disadvantage of this is that most encryption libraries don't support serializing their state.
fao_•1d ago
Eh, you could probably get away with it if you use BearSSL[0]. The only difficulty would be:

    These elements can be allocated anywhere in (writable) memory, e.g.
    heap, data segment or stack. They must not be moved while in use
    (they may contain pointers to each other and to themselves).
Which you could probably get around with by just keeping track of offsets and using mmap

[0]: https://www.bearssl.org/api1.html

zoom6628•21h ago
Maybe TinyC from Ballard et al could also be used given its ability to be a C interpreter?
mrheosuper•20h ago
iirc HolyC is an interpret language.

Anthropic teams use Claude Code

https://www.anthropic.com/news/how-anthropic-teams-use-claude-code
48•yurivish•51m ago•34 comments

Scientists may have found a way to eliminate chromosome linked to Down syndrome

https://academic.oup.com/pnasnexus/article/4/2/pgaf022/8016019
195•MattSayar•4h ago•125 comments

Graphene OS: a security-enhanced Android build

https://lwn.net/SubscriberLink/1030004/898017c7953c0946/
130•madars•4h ago•54 comments

Inter-Planetary Network Special Interest Group

https://www.ipnsig.org
99•OhMeadhbh•6h ago•26 comments

Positron – A next-generation data science IDE

https://positron.posit.co/
111•amai•3d ago•46 comments

Alto turns your Apple Notes into a website

https://alto.so/
17•colinprince•1h ago•7 comments

I wasted weeks hand optimizing assembly because I benchmarked on random data

https://www.vidarholen.net/contents/blog/?p=1160
230•thunderbong•3d ago•68 comments

There is no memory safety without thread safety

https://www.ralfj.de/blog/2025/07/24/memory-safety.html
269•tavianator•10h ago•247 comments

AMD CEO sees chips from TSMC's US plant costing 5%-20% more

https://www.bloomberg.com/news/articles/2025-07-23/amd-ceo-su-sees-chips-from-us-tsmc-plant-costing-5-to-20-more
261•mfiguiere•1d ago•443 comments

New Aarch64 Back End

https://ziglang.org/devlog/2025/#2025-07-23
65•Bogdanp•5h ago•14 comments

A GPU Calculator That Helps Calculate What GPU to Use

https://calculator.inference.ai/
39•chlobunnee•4h ago•14 comments

Revisiting Moneyball

https://djpardis.medium.com/revisiting-moneyball-074fc2435b07
59•sebg•5h ago•21 comments

PSA: SQLite WAL checksums fail silently and may lose data

https://avi.im/blag/2025/sqlite-wal-checksum/
239•avinassh•11h ago•111 comments

Visa and Mastercard: The global payment duopoly (2024)

https://quartr.com/insights/edge/visa-and-mastercard-the-global-payment-duopoly
234•bilekas•4h ago•125 comments

RE#: High performance derivative-based regular expression matching (2024)

https://arxiv.org/abs/2407.20479
20•fanf2•3d ago•5 comments

Air Force unit suspends use of Sig Sauer pistol after shooting death of airman

https://www.nhpr.org/nh-news/2025-07-23/sig-sauer-pistol-air-force-shooting-death
105•duxup•8h ago•188 comments

Use Your Type System

https://www.dzombak.com/blog/2025/07/use-your-type-system/
228•ingve•11h ago•229 comments

Vet is a safety net for the curl | bash pattern

https://github.com/vet-run/vet
177•mooreds•13h ago•164 comments

Open Source Maintenance Fee

https://github.com/wixtoolset/issues/issues/8974
222•AndrewDucker•14h ago•158 comments

Low-Temp 2D Semiconductors: A Chipmaking Shift

https://spectrum.ieee.org/cdimensions-2d-semiconductors
4•rbanffy•3d ago•0 comments

Covers as a way of learning music and code

https://ntietz.com/blog/covers-as-a-way-of-learning/
131•zdw•3d ago•69 comments

Intel CEO Letter to Employees

https://morethanmoore.substack.com/p/intel-ceo-letter-to-employees
188•fancy_pantser•5h ago•319 comments

Why concatenative programming matters (2012)

http://evincarofautumn.blogspot.com/2012/02/why-concatenative-programming-matters.html
47•azhenley•3d ago•10 comments

Bus Bunching

https://www.futilitycloset.com/2025/07/12/bus-bunching/
52•surprisetalk•4d ago•57 comments

Superfunctions: A universal solution against sync/async fragmentation in Python

https://github.com/pomponchik/transfunctions
25•pomponchik•3d ago•26 comments

Mwm – The smallest usable X11 window manager

https://github.com/lslvr/mwm
131•daureg•3d ago•54 comments

UK: Phone networks down: EE, BT, Three, Vodafone, O2 not working in mass outage

https://www.the-independent.com/tech/ee-bt-three-vodafone-o2-down-phone-networks-outage-latest-b2795260.html
196•oger•13h ago•86 comments

American sentenced for helping North Koreans get jobs at U.S. firms

https://fortune.com/2025/07/24/north-korean-it-workers-chapman-nike/
104•fortran77•6h ago•72 comments

Writing is thinking

https://www.nature.com/articles/s44222-025-00323-4
268•__rito__•3d ago•116 comments

The POSIX specification of vi

https://pubs.opengroup.org/onlinepubs/9799919799/utilities/vi.html
61•exvi•3d ago•20 comments