Call the compiler, fax it your code
ฝัง
- เผยแพร่เมื่อ 18 พ.ค. 2024
- Hi, I'm Lex (they/them)
I made a very silly fax service.
In the video it is running on York Hackspace's internal phone system.
It also ran at EMFCamp 2024 on the copper telephone network.
Source code is here: github.com/lexbailey/compilerfax
Enjoy :)
--- Explanation of what's going on in this video ---
This is a regular fax machine sending a normal fax to fax service that I built. The service runs on a Raspberry Pi that has a fax modem attached to it. It appears to any other fax machine just like a normal fax machine. Both the Raspberry Pi and the fax machine in the video are connected to a PABX (a local telephone exchange) in York Hackspace. The phone exchange there is not connected to the public network at all (at the time of filming, at least), and so you can only make local calls.
The Hackspace PABX is very old, and only supports pulse dialing (it doesn't support the more modern DTMF dialing). As far as I can tell, the fax machine can only do DTMF, and can't do pulse. This is why there is a hamburger phone attached to the same phone line. The hamburger phone can do pulse dialing. At the start of the video, I put the printed source code on the fax scanner glass, and then pick up the hamburger phone and dial the number for the fax service running on the Raspberry Pi. The Pi is connected to extension 8, so I dial 8.
Once I hear that the Raspberry Pi has accepted the incoming call, I press the button on the fax machine to start sending a fax. The Raspberry Pi listens to the incoming fax and saves it to the SD card. The fax service running on the Pi then performs OCR on the incoming fax. The result of the OCR is saved as a C file. That C file is then compiled with GCC, and then the resulting binary is executed. Of course, compilation might fail, in which case the program will not run.
Regardless of the result of the compilation and execution, the fax service will generate a report and fax it back to the sender. (This can only happen if the sender included a reply number in the program. That's what the //REPLY=7# line is for. The fax machine is connected to extension 7. Unfortunately I couldn't figure out how to get caller ID working.) The report will contain any compiler errors or warnings, and any output from the program, if it ran.
--- FAQ ---
Q: What happens if you send a program that doesn't terminate? (An infinite loop)
A: At the time of filming, it would have waited forever for the program to complete, and thus it would not reply at all and would stop processing incoming faxes. I have since added some time limits. You get 20 seconds to compile, and 60 seconds to run. After that the program is terminated and the report is sent back with a message indicating that a timeout occured.
Q: What if you need more than one page to send all your code?
A: You can send a multi-page fax, but I'm not sure what will happen after it is received. Whatever happens it certainly won't work correctly. It will either: just ignore all pages after the first one, or try to OCR them all at once and fail to read the code. I would like to fix that though. Support for multipage sources would be nice.
Q: Is it sandboxed?
A: Yes.
Q: Is the sandbox actually secure?
A: I've done the best I can to secure it, but there might still be issues. Try and break it for yourself! The code is all on github: github.com/lexbailey/compilerfax
Q: Can you specify the compilation options? If so how?
A: No, unfortunately. I could maybe add in a way to do this, perhaps a special comment at the top of the file. For now though it will always compile with a fairly simple command: gcc -lm program.c -o program - วิทยาศาสตร์และเทคโนโลยี
the hamburger phone makes it perfect
and it's so funny because i literally just made a doublestacker cheeseburger 5 minutes ago
Hamburger, cheeseburger, Big mac, whopper
I’m happy to be the person that ticked this comment over to 1k likes from 999, really, this made my day
@@jakint0sh Must have been a really satisfying feeling. Congrats man!
Well it's faster than compiling a rust program locally.
As much as it pains me to admit as a rust user, you're right
I still don't know why Rust's compiler is so slow lol. Zig's compiler runs about as fast as gcc and it also (for now) uses LLVM like Rust does so I don't get it.
@@thezipcreator I mainly program in Python and C, but I like Zig and expect Zig to replace my C usage once the inline assembler issues are both addressed and stabliized.
@@thezipcreator1. Rust's trait solver is a proof engine, the type system is Turing complete (or very nearly), and library authors love to do horrible things with it.
2. Rust's proc-macros are compiler plugins that have to be compiled separately, *linked,* and then dynamically loaded. This is probably where most of the overhead is coming from if your project is slow to compile.
3. Every proc macro is independently responsible for parsing code, transforming the resulting AST, and re-"serializing" it back into a token tree which the compiler then parses into Rust code (which can then call another proc macro, repeating the whole process)
It's all pretty cursed, tbh. The general rule is more proc macros = more pain, but everyone loves derive macros so much.
4. Monomorphization (stamping out non-generic copies of generic code) also has a lot of overhead, and in the worst case, the compiler will give LLVM a ton of redundant or entirely dead code, which may or may not get cleaned up by the optimization passes
5. The compiler treats an entire crate as a C compiler treats a single C file; that is, a *crate* is the Rust compiler's compilation unit.
The only true use for fax now in this day and age is doing stuff like this. This is one of the worst things i've seen as a programmer, I love it.
i disagree
In Germany we call a Fax high-tech
Nope you are wrong. It's still used in hospitals and by doctors because it's fast, can handle non-electronic documents and gives you confirmation of delivery or at least acceptance at the other end.
@@hoofie2002 You just discribed somthing that can be done better and more securely via email. It is unfortunately still used in many places but fax really should not be used on anything of importance in 2024. I think @kyium_ 's point was that it's the only "good use" of fax.
still used by ISP in Italy to close the subscription.
"We're hoping that it's gonna print Hello World 10 times"
> literally prints it on a piece of paper
lol
I was hoping for 10 Pages each with "Hello World"
@@Beredro SAME LOL
@@Beredro that would've been even funnier
That was the original meaning of print, a long long long time ago
I wanted 10 pages of 1 line hello world
Hot diggity! Maybe one day we'll be able to hook our computers up to the phone lines directly and have them communicate without needing to print and fax stuff!
🌚
Hah! What next, washing machines and televisions talking to each other?
Maybe one day we can do computer stuff like spreadsheets, word processing and networking on portable telephones directly! Who knows?
Pah! That’s never going to happen!
@@fishyc43sar _Yeah, but your scientists were so preoccupied with whether or not they could, they didn't stop to think if they should._ - Dr. Ian Malcolm
Now I know what my computer scientist friend, a German civil servant, does all day long.
Ah so that is why faxing is still so common around here
No we are actually using modern tech - in between binge-watching TH-cam, drinking coffee and having ultra-long, completely useless online meetings ... which reminds me to go and get my next batch of coffee ... brb
@@ololh4xx "we are actually using modern tech"
Meanwhile, Deutsche Bahn is hiring Windows 3.11 engineers... or so I've been told, at least
@@commander3494 nah, they only require the will to *use* this tech, not to develop it further. Thats because they *will* phase it out once it breaks ... problem with that : it doesnt break. We also use ancient tech to some extent but it also doesnt get any new development. Have you heard of the expression "never change a running system"? This is the result of that.
@@ololh4xxstagnation is death, just prolongated then usual.
This is what's wrong with EU, they are trying to find an excuse for museum relics that are still working- these are dangerously outdated, they cannot handle requests, they are not reliable or at least doesn't follow adequate reliability needs.
Like Italian doctor appointment system CUP that most of the time is down and everyone is handling papers with barcodes that no scanner produced only for this purpose cannot read them.
Then you go somewhere like Uzbekistan, 3rd world poor post-soviet country: the only paper that you will have in appointment system is a ticket with exact date and number in queue, rest is made electronically
Does it falls down?
First 2 month it was, after a year it mostly works.
As by today, on 23rd may of 2024 for the appointment to the doctor in Italy you had to find sometime, take 1 hour off, sit in the queue and then make an appointment that will take at least for 3 month for any kind of doctor.
In contrary, in Uzbekistan, this will take 1 week if this is very specific, rare doctor.
The other way around is just an old-fashioned queue.
Why it is like that?
Outdated IT, outdated practices, outdated spendings, outdated approaches for solving the problems(basically, restyle of 100 years old ways of looking on things), outdated requirements and projections for resource-planning.
Why nothing is changed?
OH, it it just works, why then we should change that!?
Oh yes, "works".
It is so miserable that it takes years to do a small job that in normal case will take a month, but instead will take 6 month because of outdated quazi-paper burocacy, understaff, business-only-stimulation and so on.
Even people working there feel so miserable by situation, just in order to compensate that they have printed a banner with amount of materials changed or work done.
But small building restructurization: change windows, change insulation, change roof sealant, paint exteriors is already took 3 years to do.
A single building to do the scheduled repair.
In poor countries it takes 3 years to build a skyscraper in historic center 500 years old in the city.
It is all outdated, everything is old.
You go to the flea market: freshest used computer is 10 years old, they do sell casually what should be in museum because it is 40 years old computer hardware or 24 years old phone.
When you start speaking with people they don't even realise that they are living in 2024, not in 2002 or 2010.
Stagnation and probably decadance in everything is how nowadays eu can be described.
Damn, the entire airspace industry holds on shitty excel tables: how many it guys are produced by university annually?
The damn army of people know how to write a code for a tracker software like oversimplified jira.
It just works!
Yeah, until the certified fuel tank of upcoming rocket made by ESA is thrown on dump like some trash.
The miserable shame is so high that people just escape from their mind to paper marryworld pretending that nothing happens, just one more deadline shift for couple od weeks this month: one more, one another, unfortunately one more, so sudden one more deadline shift...
The government of Germany would like to speak with you.
what it feels like waiting for jenkins to schedule your job
Imagine having to wait a whole 10 minutes of compiling C++ just for it to decline your fax
This is exactly how it used to be, give the mainframe sysops your code on paper or magnetic tape, wait up to 48 hours for them to load and compile it to see if it was right, maybe have the sysop call you and scream that it created an infinite loop and used up a whole bunch of paper tape or boxed tractor feed paper.
@WelshProgrammer No time limit for loops? smh 😔
That's a... C-fax.
Found the British people 🤣
Oh no 😂
c fax fax
gives a new meaning to the print function
Faxed the code to the compiler, now I'm just waiting for the hamburger to ring.
We are not caveman, we have technology.
The technology:
This actually pretty fit the theme of a SaaS stuff, will be nice if some body combine fax and OCR to make a remote build service for fun
“That’ll be the compiler now” got me laughing out loud. Good work!
I was hoping for Segmentation Fault, but awesome anyway!
This is amazing. Programmers have gotten soft, with their rapid build cycles; they don’t check their code for errors before compiling any more. This will make them better programmers.
Imagine same thing but with a build system and maybe a copy served over http
Or getting a crappy 4 Gigabyte HDD laptop and forcing them to use it for development will do that
Working at a life insurance company using a mainframe implementation that’s barely been updated since the 60s, this hits differently.
This is amazing! Just think of the time saved compared to typing out all those punched cards and posting them off to the computer centre for compilation.
What happens if you ask it to compile and run an endless loop?
It'll spend all your paper in revenge.
just program the fax to detect any infinite loops, _easy_
@@X-3Klaughs in Gödel's Incompleteness Theorem
read description bruv
A true hacker, here's me with my own local dial-up ISP, this guy goes one step further and puts OCR and a Compiler on the other end of the line. Fantastic.
This is the kind of _forward-thinking_ protocol we need to instantiate at our University levels
This is so perfectly cursed. I love it completely.
Japan resident here, can confirm this is how things work in Japan /j
Now I know how German public offices write and compile their software 😆
Call the corn piler, fax it your cob
Average day of an engineer that is working on electronics and computing.
I had an absolutely psychotic college professor who demanded that we print out our source code and turn it in. I have a feeling they would use this.
Still a faster compile time than Rust
Ayo, new tech job interview hoop to jump through just dropped
Welcome to the world of enterprise software development!
i love everything about this
This is so stupid. I love it. Thank you for making this.
thats probably a boomers' dream come true. Best be adding a batch-processing arrangement of sorts and you've got your successful boomer-product
tfw your boomer boss gives you a piece of paper with code, asks you to fax it, and place the paper with the output at his desk
Szinte teljes lyukkártya érzés. Csak túl gyors.
Almost full punch card feel. It's just too fast.
Time to hire a senior-level compiler with 7-year of experience.
This is certainly one of the achievements of all time.
Thats a microservice if I've ever seen one.
Me telling my grandkids how computing was like before smartphones. Had to walk uphill and downhill through the snow to get to the fax machine too.
Thanks, I need a burger phone now.
I was hoping that it really prints 10 pages of Hello World
I love the spider sticker :3
ikr :3
:3
:3 wonderful indeed
Awesome! I need one so I could actually think on what I've coded. And optimized for less space immediately. Beautiful.
"whats your library calling convention? extern C?"
"Extern FAX"
in Poland on final matura examination from IT which we write after completing highschool we must write our code with a PEN on a piece of PAPER. You have some high tech equipment there imagine if everyone had access to that stuff.
actual compilation took 0 seconds, but most of the time here was spent waiting for the fax to go back and forth
I absolutely adore this
Wow now i can compile code from the comfort of my own home!
When the compiler phones back:
Boomers: "ahh the sweet sound of a phone call in the morning 🥰"
Millenials: *panic attack*
I’ve never had a good excuse to fax things, but well, I guess I now have a new thing to setup so I’ll finally have one. This is wonderful (also nice enby flag sticker)
This is just lovely
I thought he was gonna eat the hamburger 💀
It's so absurd and I love it!
finally the japanese can begin to code
Germany approves this method 🇩🇪
I thought this was going to be a philosophy video about pretending that compilers aren't super fast so that you pay attention to your code more.
OMG THE BURGER PHONE
I was expecting it to fax back machine code.
Congratulations you just made a complicated terminal
Great visualization of standard input stream being something besides the keyboard and standart output not being shown in a screen.
Brillant !!! Like a first mainframes almost ;)
Hello, I would like to suggest this at work, but I'm afraid we don't have a hamburger phone. Will it work with a non-hamburger phone too?
yes! you can also use a banana phone 🍌
You should set up a phone number and an instance for the public to fax their code to and see what people send in
I would love to do that. Right now that would require me to have access to a landline, and unfortunately I don't. It's quite expensive to get one too. I am going to take this to EMF Camp very soon, so if you're going there you can play with it during the weekend. :) After that I might try hooking it up to the public phone system via a SIP service, if I can get one cheap enough that it's worth doing.
@@computingthedetails you can get a service for 10 bucks a month, so you could probably make a patreon or such to fund it.
or given the probably very low amount of people interested in that, using your own sip server and use local numbers for each project.
@@computingthedetails you may want to not have foreign code run as root/admin and you might want to have either a os backup and image or use a vm in case someone tries to do the c code equivalent of rm -rfd /
This was somewhy beautiful
If a service like this actually did exist, I guarantee somebody would send it a system("format C:") request.
Still, this has gotta be the most cursed usage of the fax machine I've seen in a decade. at least. So I love it.
more like rm -rf /
@@mini_bombaakshually rm -rf / -no-preserve-root
This is incredible
The nerdiest thing I've seen in a while. Absolutely love it.
This is ridiculous and silly.
I love it ^_^
That’ll be the compiler now.
To be fair, the "print" command is named after actual printing. Just like New Lines are preceded by Carriage Return (CRLF) on windows.
I definitely expect a "missing semicolon in line 3027"
Modern aspiring programmers have to write code in a copybook with a pen
Hamburger Phones look legit unique & it looks relaxin' to call :O
Excellent!
Maybe Caller ID will work in a newer phonesystem?
imagine after waiting like 2 minutes for it to run your code it just prints out: "Segmentation fault"
Ive never wanted a fax machine... until now.
This is beautiful
The hamburger phone is so OP I liked the video before i even finished it
Ain't heard PSK noises for a long time...
The project has a dial-up mainframe feel for sure.
Real IT, not this artificially hyped AI. I love it.
Besides, you can send off your colleagues, saying you wait for an important call from the compiler.
Win-win.
this is what compiling c looked like back in the day
That hamburger phone is awesome 😭
Remote code execution at it's finest :)
Fax machines are awesome it’s too bad that they’re not as popular anymore
I love it. Please come to next cccamp so I can try it out🥺👉👈
I have never been to CCC, but that is something I want to fix. I'll certainly try to be at the next one :)
nice enby spider
this is what elon musk expected twitter programmers to do
then you get the compiled binary fax'd back to you! brilliant!
What? This is actually dope you can play with coding without a computer
Ah yes, cloud computing over fax
I was torn between expecting some modern OCR contraption and an actual service from like IBM back in the day lamo
Damn that’s very cool
The print function should print pages
Fax like the old days
This would have probably been very convenient in 1964
i love this
Finally! I can code with a typewriter!!!
It's so dope 😆
"This is so dumb... I love it!"
All we need to do now is fax it a kernal and await the matrix!
Am wondering if I can add a fax noise whenever I commit code to the cloud?
Seems like you’re using a c++ compiler because in c, a return 0 in the main function isn’t implicit
I'd enjoy seeing a version of this that can work on handwriting, so you wouldn't have to use a computer at any stage in writing your code