Call the compiler, fax it your code [video]
150 points
1 month ago
| 14 comments
| youtube.com
| HN
faxmeyourcode
1 month ago
[-]
So my username is a little less ridiculous than I originally thought? :)

The fact that this can introduce OCR bugs into your C code is hilarious, and this is diabolical:

    #define one ( 4 - 3 )
    #define eleven ( 3 + 4 + 4 )

Source code is here https://github.com/lexbailey/compilerfax
reply
deepspace
1 month ago
[-]
> OCR bugs

Especially if your fax machine uses JBIG2 compression. See: https://googleprojectzero.blogspot.com/2021/12/a-deep-dive-i...

reply
skitter
1 month ago
[-]
I think it's appropriate linking directly to Kriesel's blog¹ or his talk, as that's about the scanner creating fake data and not about rce. Though technically it too is not an OCR bug as there's no ocr in JBIG2.

¹: http://www.dkriesel.com/en/blog/2013/0802_xerox-workcentres_...

reply
jabbany
1 month ago
[-]
I wonder if OCR could be improved by adding a "language model" of sorts...

Like, sure, maybe it's hard to tell apart a "1", "i", or "l" purely visually, but if you knew it was supposed to be code, I'd suspect one could significantly improve the recognition accuracy if the system just worked in the probability of each confusable option given the preceding (and following) text.

reply
playingalong
1 month ago
[-]
This would also have a higher risk of introducing some nasty, hard to spot errors.

It's actually better for the compilation to fail than for the Clippy to make up something syntactically and compilation correct, but wrong.

reply
eru
1 month ago
[-]
You might be right in a practical sense, but for an art project like this, maybe not?
reply
lupire
1 month ago
[-]
Need a proper preprocessor to take a code file and make it OCR-safe by substituting for dangerously glyphs.
reply
simcop2387
1 month ago
[-]
This might be a good reason to support trigraphs again! https://en.wikipedia.org/wiki/Digraphs_and_trigraphs_(progra...

edit: fixed link, copy paste fail dropped the ++

reply
OnlyMortal
1 month ago
[-]
Amateur! Use a barcode font!
reply
landgenoot
1 month ago
[-]
monospace font OCR-B
reply
JoshTriplett
1 month ago
[-]
This is awesome. Using computers for what they're best at: fax and figures.

I'm curious why this requires a reply number in the program, rather than relying on something like Caller ID and sending the reply back to the number that sent the fax.

reply
Denvercoder9
1 month ago
[-]
It was probably just easier to implement. The build script[1] already has the source code, extracting the number from a comment is trivial, while retrieving out-of-band data like Caller ID from the fax server is likely more complicated. For a joke it's not compelling to do that, especially if you've already been fighting the fax server...[2]

[1] https://github.com/lexbailey/compilerfax/blob/main/build_and...

[2] https://github.com/lexbailey/compilerfax/tree/main?tab=readm...

reply
khaki54
1 month ago
[-]
Have fun troubleshooting when the OCR keeps mis-identifying one of the semi-colons as a greek question mark!
reply
M4v3R
1 month ago
[-]
I wonder if this is a perfect use case for an LLM. I bet that if you did submit he code to Claude/ChatGPT with a prompt to „fix any typos in the code that was read using OCR” it would have a pretty high rate of success.
reply
joebob42
1 month ago
[-]
The past meets the future
reply
jabbany
1 month ago
[-]
So, as someone who has lived in regions with pretty severe internet censorship in the past and built circumvention software back in the day, I've always pondered the idea of whether one could build a fax-based thing like this for browsing the web. Kind of as like a "last resort" system.^

Could have a form that you fax in with, like a URL and session info (cookies and stuff), and then it faxes back the page, and you can circle stuff and fax the page back to interact and "click on" things.

Plus, since computers can ingest faxes, you wouldn't need to waste paper printing everything out, and could just do everything digitally. But you still had the option to use paper and a fax machine if you really need to.

^: Yes, I know faxes are unencrypted and phone lines can be tapped. But I've always found the idea intriguing. Plus having some emergency point-to-point communication to bootstrap things like key exchange could still be neat.

reply
reaperducer
1 month ago
[-]
Slightly related:

There was a time when web browsing was crazy slow and expensive, but there were e-mail services that were also crazy slow, but free.

There were mail to web gateways that you could e-mail a URL to, which would then reply with the contents of the web page. You'd then send another URL from that page, and get another reply, and so on. Free slow-motion web browsing.

I say "slow-motion" because this was back when getting a response to an e-mail took hours or days, not seconds. So you were lucky to get through three or four links in a day. But it was free, and we had other things to do than surf the web anyway.

reply
skissane
1 month ago
[-]
RMS was still doing that this century

https://lwn.net/Articles/262570/

I wonder if he still is today

reply
Dutchie987
1 month ago
[-]
There where even mail-to-ftp gateways. I vaguely remember using bitftp (?) to get a copy of the Utah Raster Toolkit that way. Long time ago...
reply
hasmanean
1 month ago
[-]
If you had a ham radio connection and wanted to broadcast emergency bulletins to people, radio fax would be quite useful.

It’s push rather than pull like the web. Email works too, but fax has more utility in an emergency situation. Beats having to download adobe acrobat on every computer….

reply
eru
1 month ago
[-]
I'm not sure where Adobe Acrobat comes in here?
reply
fortran77
1 month ago
[-]
This is similar to the workflow for my CS101 class at college in the 70s.

I submitted my deck of cards to a person in the computer center at one of the times the PL/C compiler was scheduled to run (10 AM and 2 PM), I sat and waited, and then my output would be handed to me after it was compiled and run.

reply
kazinator
1 month ago
[-]
With Common Lisp, we don't need an infinite roll of paper to prank the faxed compiler. Just

  (progn . #1=((print 'foo) . #1#))
reply
odo1242
1 month ago
[-]
It would honestly be even funnier if the compiler just sent back your code in x86 assembly.
reply
fanf2
1 month ago
[-]
If godbolt.org had a fax number…
reply
rickreynoldssf
1 month ago
[-]
That's got to be actually useful. I can't think how but there's got to be some situation where that is the best solution.
reply
nehal3m
1 month ago
[-]
Computer floop noises. Nice.
reply
l0rn
1 month ago
[-]
it would be a cool competition who makes the nicest program using the fax compiler
reply
davidkunz
1 month ago
[-]
Nothing new, we've been doing it like that for ages here in Germany. But it's a cool Hamburger phone.
reply
xyst
1 month ago
[-]
Can it also compile rust ;)
reply
throwway120385
1 month ago
[-]
I don't understand. Is this not how everyone browses the web?
reply
jzombie
1 month ago
[-]
FaxGPT
reply
hasmanean
1 month ago
[-]
The length of common LLM responses is perfectly able to fit on a sheet of paper.
reply
ruined
1 month ago
[-]
no it's more typical to fax a complete browsing service
reply
ManWith2Plans
1 month ago
[-]
Possibly inspired by this stack overflow question:

https://stackoverflow.com/questions/5508110/why-is-this-prog...

reply
dang
1 month ago
[-]
Related:

Why is this program erroneously rejected by three C++ compilers? - https://news.ycombinator.com/item?id=22798602 - April 2020 (1 comment)

Why is this program erroneously rejected by three C++ compilers? - https://news.ycombinator.com/item?id=6504442 - Oct 2013 (1 comment)

Why is this program erroneously rejected by three C++ compilers? - https://news.ycombinator.com/item?id=3727717 - March 2012 (7 comments)

reply