Call the compiler, fax it your code [video]

150 points
1/20/1970
a month ago
by ayoreis

Comments


faxmeyourcode

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
a month ago

deepspace

> OCR bugs

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

a month ago

skitter

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_...

a month ago

jabbany

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.

a month ago

playingalong

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.

a month ago

eru

You might be right in a practical sense, but for an art project like this, maybe not?

a month ago

lupire

Need a proper preprocessor to take a code file and make it OCR-safe by substituting for dangerously glyphs.

a month ago

simcop2387

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 ++

a month ago

OnlyMortal

Amateur! Use a barcode font!

a month ago

landgenoot

monospace font OCR-B

a month ago

JoshTriplett

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.

a month ago

Denvercoder9

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...

a month ago

khaki54

Have fun troubleshooting when the OCR keeps mis-identifying one of the semi-colons as a greek question mark!

a month ago

M4v3R

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.

a month ago

joebob42

The past meets the future

a month ago

jabbany

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.

a month ago

reaperducer

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.

a month ago

skissane

RMS was still doing that this century

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

I wonder if he still is today

a month ago

Dutchie987

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...

a month ago

hasmanean

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….

a month ago

eru

I'm not sure where Adobe Acrobat comes in here?

a month ago

fortran77

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.

a month ago

kazinator

With Common Lisp, we don't need an infinite roll of paper to prank the faxed compiler. Just

  (progn . #1=((print 'foo) . #1#))
a month ago

odo1242

It would honestly be even funnier if the compiler just sent back your code in x86 assembly.

a month ago

fanf2

If godbolt.org had a fax number…

a month ago

rickreynoldssf

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.

a month ago

nehal3m

Computer floop noises. Nice.

a month ago

l0rn

it would be a cool competition who makes the nicest program using the fax compiler

a month ago

davidkunz

Nothing new, we've been doing it like that for ages here in Germany. But it's a cool Hamburger phone.

a month ago

xyst

Can it also compile rust ;)

a month ago

throwway120385

I don't understand. Is this not how everyone browses the web?

a month ago

jzombie

FaxGPT

a month ago

hasmanean

The length of common LLM responses is perfectly able to fit on a sheet of paper.

a month ago

ruined

no it's more typical to fax a complete browsing service

a month ago

ManWith2Plans

Possibly inspired by this stack overflow question:

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

a month ago

dang

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)

a month ago