frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Show HN: Mermaid Formatter – CLI and library to auto-format Mermaid diagrams

https://github.com/chenyanchen/mermaid-formatter
1•astm•14m ago•0 comments

RFCs vs. READMEs: The Evolution of Protocols

https://h3manth.com/scribe/rfcs-vs-readmes/
2•init0•20m ago•1 comments

Kanchipuram Saris and Thinking Machines

https://altermag.com/articles/kanchipuram-saris-and-thinking-machines
1•trojanalert•20m ago•0 comments

Chinese chemical supplier causes global baby formula recall

https://www.reuters.com/business/healthcare-pharmaceuticals/nestle-widens-french-infant-formula-r...
1•fkdk•23m ago•0 comments

I've used AI to write 100% of my code for a year as an engineer

https://old.reddit.com/r/ClaudeCode/comments/1qxvobt/ive_used_ai_to_write_100_of_my_code_for_1_ye...
1•ukuina•25m ago•1 comments

Looking for 4 Autistic Co-Founders for AI Startup (Equity-Based)

1•au-ai-aisl•36m ago•1 comments

AI-native capabilities, a new API Catalog, and updated plans and pricing

https://blog.postman.com/new-capabilities-march-2026/
1•thunderbong•36m ago•0 comments

What changed in tech from 2010 to 2020?

https://www.tedsanders.com/what-changed-in-tech-from-2010-to-2020/
2•endorphine•41m ago•0 comments

From Human Ergonomics to Agent Ergonomics

https://wesmckinney.com/blog/agent-ergonomics/
1•Anon84•45m ago•0 comments

Advanced Inertial Reference Sphere

https://en.wikipedia.org/wiki/Advanced_Inertial_Reference_Sphere
1•cyanf•46m ago•0 comments

Toyota Developing a Console-Grade, Open-Source Game Engine with Flutter and Dart

https://www.phoronix.com/news/Fluorite-Toyota-Game-Engine
1•computer23•48m ago•0 comments

Typing for Love or Money: The Hidden Labor Behind Modern Literary Masterpieces

https://publicdomainreview.org/essay/typing-for-love-or-money/
1•prismatic•49m ago•0 comments

Show HN: A longitudinal health record built from fragmented medical data

https://myaether.live
1•takmak007•52m ago•0 comments

CoreWeave's $30B Bet on GPU Market Infrastructure

https://davefriedman.substack.com/p/coreweaves-30-billion-bet-on-gpu
1•gmays•1h ago•0 comments

Creating and Hosting a Static Website on Cloudflare for Free

https://benjaminsmallwood.com/blog/creating-and-hosting-a-static-website-on-cloudflare-for-free/
1•bensmallwood•1h ago•1 comments

"The Stanford scam proves America is becoming a nation of grifters"

https://www.thetimes.com/us/news-today/article/students-stanford-grifters-ivy-league-w2g5z768z
3•cwwc•1h ago•0 comments

Elon Musk on Space GPUs, AI, Optimus, and His Manufacturing Method

https://cheekypint.substack.com/p/elon-musk-on-space-gpus-ai-optimus
2•simonebrunozzi•1h ago•0 comments

X (Twitter) is back with a new X API Pay-Per-Use model

https://developer.x.com/
3•eeko_systems•1h ago•0 comments

Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better

https://github.com/dmtrKovalenko/zlob
3•neogoose•1h ago•1 comments

Show HN: Deterministic signal triangulation using a fixed .72% variance constant

https://github.com/mabrucker85-prog/Project_Lance_Core
2•mav5431•1h ago•1 comments

Scientists Discover Levitating Time Crystals You Can Hold, Defy Newton’s 3rd Law

https://phys.org/news/2026-02-scientists-levitating-crystals.html
3•sizzle•1h ago•0 comments

When Michelangelo Met Titian

https://www.wsj.com/arts-culture/books/michelangelo-titian-review-the-renaissances-odd-couple-e34...
1•keiferski•1h ago•0 comments

Solving NYT Pips with DLX

https://github.com/DonoG/NYTPips4Processing
1•impossiblecode•1h ago•1 comments

Baldur's Gate to be turned into TV series – without the game's developers

https://www.bbc.com/news/articles/c24g457y534o
3•vunderba•1h ago•0 comments

Interview with 'Just use a VPS' bro (OpenClaw version) [video]

https://www.youtube.com/watch?v=40SnEd1RWUU
2•dangtony98•1h ago•0 comments

EchoJEPA: Latent Predictive Foundation Model for Echocardiography

https://github.com/bowang-lab/EchoJEPA
1•euvin•1h ago•0 comments

Disablling Go Telemetry

https://go.dev/doc/telemetry
1•1vuio0pswjnm7•1h ago•0 comments

Effective Nihilism

https://www.effectivenihilism.org/
1•abetusk•1h ago•1 comments

The UK government didn't want you to see this report on ecosystem collapse

https://www.theguardian.com/commentisfree/2026/jan/27/uk-government-report-ecosystem-collapse-foi...
5•pabs3•1h ago•0 comments

No 10 blocks report on impact of rainforest collapse on food prices

https://www.thetimes.com/uk/environment/article/no-10-blocks-report-on-impact-of-rainforest-colla...
3•pabs3•1h ago•0 comments
Open in hackernews

Binfmtc – binfmt_misc C scripting interface

https://www.netfort.gr.jp/~dancer/software/binfmtc.html.en
103•todsacerdoti•8mo ago

Comments

zx2c4•8mo ago
Similar project of mine from a long while ago: https://git.zx2c4.com/cscript/about/
Surac•8mo ago
So lovely
elitepleb•8mo ago
similar to http://www.iq0.com/duffgram/com.html
JSR_FDED•8mo ago
C is still my first love. You can hold the whole language in your head, and it’s fast. Yes there are footguns but it’s a libertarian programming language - you’re responsible for what you build. No hand holding.
ykonstant•8mo ago
I like that too, but the problem is that C doesn't keep its end of the deal. No hand holding, but make what you are doing transparent. It used to be the case back in the 80s, but not anymore. Not with our optimizing compilers and oodles of UB and spec subtleties and implicit actions.
radiospiel•8mo ago
Amazing; when I tried something similar I used a "#!" line pointing to a C compiler + runner of sorts (https://github.com/radiospiel/jit). https://git.zx2c4.com/cscript/about/ is also following that approach.

What is the benefit of registering an extension via binfmt_misc?

lmz•8mo ago
It's still valid C source code? Is the #! sequence valid C?
enriquto•8mo ago
was surprised that "sudo apt install binfmtc" works out of the box on my box (linux mint) and i can do the magic just as described here
rwmj•8mo ago
You can already do this without using binfmt ...

  #if 0
  gcc "$0" -o "$@".out && exec ./"$@".out
  #endif
  #include <stdio.h>
  int main () { printf ("hello, world\n"); return 0; }
Usage:

  $ chmod +x print.c
  $ ./print.c
  hello, world
(Could be better to use a temporary file though.)

There's a similar cute trick for compiled OCaml scripts that we use with nbdkit: https://libguestfs.org/nbdkit-cc-plugin.3.html#Using-this-pl...

mananaysiempre•8mo ago
Compiler errors won’t cause as many funny consequences with

  gcc "$0" -o "$@".out && exec ./"$@".out || exit $?   # I'd use ${0%.c} not $@
Love this trick too, but the difference, as far as I understand, is that it only works with a Bourne(-compatible) shell, whereas shebangs or binfmt_misc also work with exec().
AlotOfReading•8mo ago
You can also #embed the compiler binary, and execve it to much the same effect as binfmtc. I explored that trick for an IOCC entry that was never submitted because it ended up far too readable.
ckastner•8mo ago
Oh this is neat. Took me a bit.

The shell treats the first line as a comment. It executes the second line, which eventually exec's the binary so the rest of the file do not matter to the shell.

And the compiler treats the first line as a preprocessor directive, so it ignores the second line.

I initially misread/mistook the first line for a shebang.

teo_zero•8mo ago
The use of $@ doesn't look right to me.

In the trivial case exposed here where there are no additional arguments to pass to the .c program, the shell executes

  gcc "print.c" -o .out && exec ./.out
and it works "by chance".

In a more complex scenario where print.c expects some parameters, it won't work. For example,

  ./print.c a b c
will result in the shell trying to invoke

  gcc "print.c" -o "a" "b" "c".out && exec ./"a" "b" "c".out
which makes no sense.

Are you sure you didn't intend $0 instead of $@ ?

rwmj•8mo ago
It's true, that's a mistake!

OTOH we're trying to write self-compiling executable C scripts, so the safety, correctness and good sense ships sailed a while back.

suprjami•8mo ago
Is there a way to do this and have the shell remove the temporary file after exec?
1vuio0pswjnm7•8mo ago
There are many, no doubt

   #if 0
   cc -static -pipe -xc "$0"||exit 100
   exec ./a.out
   #endif
   int puts(const char *);
   int unlink(const char *);
   int main(int argc,char *argv[]){ 
   puts("it works"); 
   unlink(argv[0]);
   return 0; 
   }
teo_zero•8mo ago
Yes, but it's not worth it. It's better to forget gcc and use tcc instead, which has the -run flag to compile and run without creating any intermediate file. It's also much quicker than gcc.
pwdisswordfishz•8mo ago
Or even

    /*bin/true ; exec tcc -run "$0" "$@" # */
nrclark•8mo ago
I'd have expected this to need a hashbang (#!/bin/sh) at the beginning. Why doesn't it?
rwmj•8mo ago
Because your shell will execute anything that looks like a text file & has +x bit set as a shell script.
monocasa•8mo ago
There's also tcc, which has a shebang compatible extension to allow it to be used by scripts.
kazinator•8mo ago
This is doable entirely without a Linux-specific binfmt-misc hack.

https://rosettacode.org/wiki/Multiline_shebang#C

enriquto•8mo ago
This is a neat hack, but the whole file is not a valid C program.
kazinator•8mo ago
You mean it consists of a C program, plus non-C cruft to get it running?

Isn't that already legitimized by configure scripts, compiler command lines and Make files?

enriquto•8mo ago
of course it is legitimized. I just meant that the selling point of binfmtc is that the same .c file can either be compiled by any C compiler, or executed directly.
kazinator•8mo ago
We could perhaps split it into a two-file system where a "foo.sh" containing certain boilerplate will execute a "foo.c" that doesn't require any special conventions at all.

"foo.sh" could be identical for any .c file, and so we could symbolically link them all to a common file.

Of course, neither that file nor symlinks to it require a .sh suffix.

The contents might look like this:

  #!/bin/sh
  c_file=${0%.sh}.c
  x_file=${0%.sh}.bin

  # If cached executable file is missing, or out of date w.r.t.
  # the source file, compile it:

  if [ "$c_file" -nt "$x_file" ]; then
    cc $CFLAGS "$c_file" -o "$x_file"
  fi

  # Run cached executable file
  $x_file
codr7•8mo ago
I did a simple hack for doing the same thing from inside a C program for my book:

https://github.com/codr7/hacktical-c/tree/main/dynamic

rurban•8mo ago
(2006)