r/programming • • 28d ago

How curl was accidentally Turing-complete for nine months

https://seriot.ch/computation/curl.html
787 Upvotes

46 comments sorted by

317

u/tsammons 28d ago

I love how the first paragraph reads like my first recitation in college. Then it dives into discrete math midterm.

45

u/DogsAreAnimals 28d ago

Oh god. Thanks for the warning. Discrete math was the only class I ever dropped.

45

u/CompC 27d ago

Huh, that’s the only math class I ever enjoyed…

7

u/IHaarlem 27d ago

Yeah, discrete was great. Analysis was hell

2

u/siegfriedthenomad 23d ago

Was about to comment this

-14

u/Kafigoto 27d ago edited 27d ago

actual insane take

edit: apparently a lot more people than I thought enjoyed using induction to demonstrate a theorem that was proven before algebra was invented

2

u/DogsAreAnimals 27d ago

I think there's a big difference between theoretical/abstract discrete math classes (in the math department) vs more applied discrete math (e.g. engineering or CS classes). The former was what crushed me. So many proofs... I took the CS version later and it was a lot more accessible (but still hard...)

12

u/NotStanley4330 28d ago

I can't believe I passed that class. I still don't understand any of it

4

u/SkoomaDentist 27d ago

I got super lucky because the exam asked about the very few things I had any idea of and I barely got the minimum points required to pass. Fuck that course. I have no idea why it was mandatory for EE students.

6

u/GaimeGuy 27d ago

Boolean algebra, logic gates, state tables, data compression, DSP, graph theory for circuit layouts and signals routing, proofs for circuit behavior correctness in general and at edge cases.

2

u/SkoomaDentist 27d ago

None of those were covered on our discrete math course. Data compression was very lightly touched upon and that was it. I did my masters in DSP and none of those courses had anything whatsoever to do with what was taught on the discrete math course.

4

u/DogsAreAnimals 27d ago

Was that discrete math course in the math department or cs/eng? That's the mistake I made (taking a Math dept class instead of the EECS version)

3

u/SkoomaDentist 27d ago

It was for EE dept but as far as I’ve been able to tell (after 20 years in the industry) had nothing to do wih actual EE or telecoms related things except for some relation to theoretical cryptography.

1

u/DogsAreAnimals 27d ago

Weird. Well good job passing it haha. I occasionally have those dreams where you show up to class totally unprepared, and it's usually that discrete math class.

1

u/GaimeGuy 27d ago

I was pointing out how discrete math ties into electrical engineering

1

u/SkoomaDentist 27d ago

There’s the larger concept of math on discrete numbers and then the university subject Discrete Math. They are very different things.

7

u/MushinZero 27d ago

Dropped? Discrete math is like a survey of all the most useful techniques in mathematics. It's incredibly useful.

4

u/DogsAreAnimals 27d ago

Word. For some reason I decided to take the math department version of the class and it was just too abstract and theoretical for me. I replaced it with the CS version which made a lot more sense (both to my brain and to my major), though it was still the worst grade I ever got 😅

3

u/notevolve 26d ago

this makes me curious, did your university not have required proof-based CS courses? Discrete math was like a warmup for some of the classes I took later, in both math and CS

2

u/DogsAreAnimals 24d ago

I definitely did a lot of proofs, but I don't recall it being as overwhelming as it was in that math dept class. My major was in the engineering department, which was separate from the CS major/dept, so maybe that was a reason.

8

u/Own-Flight-9974 26d ago

I feel like the reason most people dont like this class or did poorly was they had bad teachers who didnt really understand the material themselves or understood it TOO well to the point everything is trivial and they dont understand how to explain the concepts to students effectively.

1

u/becircus 26d ago

Still read it

97

u/sigma914 28d ago

I feel like for something as old and featureful as curl not being turing complete is harder than being turing complete. Staying bounded, finite and decidable requires actual effort in that kind of program.

1

u/michael-2948 14d ago

Turing completeness comes from what state and control flow the options permit; sheer feature count is a poor proxy.

227

u/hongooi 28d ago

Hmmm, so could we use curl to rewrite curl in Rust?

127

u/Tmfeldman 28d ago

Why not use curl to rewrite curl in curl?

80

u/backfire10z 28d ago

Bootstrap a curlpiler

38

u/Oralitical 28d ago

In Rust? Does that mean the program you're writing in Curl configs is a Rust compiler?

37

u/hongooi 28d ago

You're right. Clearly I meant to ask if we could use curl to rewrite Rust in curl

6

u/Smallpaul 28d ago

I think all you need is a transpiiler, not a compiler.

5

u/Oralitical 28d ago

Is there a compiler backend for Curl configs?

3

u/Gold-Part4688 28d ago

call it gingerfro

12

u/ToaruBaka 27d ago

curl was getting too smart so they had to kneecap it. smh.

1

u/ElletteBarbedor-21 18d ago

Wait so did someone actually manage to write a working program in the flags before it got patched out, or was this just a theoretical proof during an audit?

1

u/Dull_Replacement8890 14d ago

Someone did (after the patch) see 2026-10-30 update on the article

5

u/wangtutx 28d ago

What kind of fun things can do with this?

17

u/Ma4r 27d ago

You could implement curl in curl

5

u/garanvor 27d ago

You just gave a basement nerd somewhere an idea

7

u/juhotuho10 28d ago

anything you can do on a computer really

2

u/Longjumping_Feed3270 27d ago

Quake 3 how many FPS?

1

u/huangsara-43824 14d ago

Turing-complete is a capability threshold, not a usability endorsement; computing anything in principle doesn't make curl a pleasant language.