News for hackers. Stuff that matters.
Re:Python's Preprocessor – Pydong by btown on Thursday August 22, 2024 @03:19PM (#41323566)

    >>> from __future__ import braces
      File "<stdin>", line 1
    SyntaxError: not a chance
For those interested in how this (hilarious) error text came to be, it's been hardcoded in cpython since 2001!

https://github.com/python/cpython/commit/ad3d3f2f3f19833f59f...

The author, Jeremy Hylton, is now a Principal Engineer at Google working on AI search quality. It's quite remarkable that in 24 years, a single person's career has gone from a tongue-in-cheek memorialization of certain syntax being forbidden, to working on ubiquitous query systems that don't require dedicated syntax at all!

Re:Python's Preprocessor – Pydong by SkiFire13 on Thursday August 22, 2024 @05:04PM (#41324385)
Reminds me of `break rust;` causing the Rust compiler to emit an internal compiler error. I wonder which other languages have similar easter eggs.
Re:Python's Preprocessor – Pydong by bch on Thursday August 22, 2024 @11:53PM (#41326055)
Tcl really became “Enterprise-ready”[0] at this time.

[0] https://stackoverflow.com/a/1026619

Re:Python's Preprocessor – Pydong by shakna on Friday August 23, 2024 @06:25AM (#41327762)
> The Stardate time format had nothing to do with Sun. I added it to Tcl while working at Scriptics, as an easter egg for the then-upcoming Tcl2K Conference. One of the conference events was a competition to implement a standard-to-stardate conversion utility, using an arcane formula. Only one guy entered the event. He spent a couple hours agonizing over the implementation (as he was looking for a job at Scriptics, he was eager to impress) only to have the easter egg revealed afterwards. Of course he won the competition anyway. And he got the job, too. – Eric Melski
Re:Python's Preprocessor – Pydong by hsfzxjy on Friday August 23, 2024 @12:03AM (#41326090)
> `break rust;` causing the Rust compiler to emit an internal compiler error

Is this real?

Re:Python's Preprocessor – Pydong by xcdzvyn on Friday August 23, 2024 @01:00AM (#41326305)
https://play.rust-lang.org/?version=stable&mode=debug&editio...

> error: internal compiler error: It looks like you're trying to break rust; would you like some ICE?

> --> src/main.rs:2:5

> |

> 2 | break rust;

> | ^^^^^^^^^^

> |

> = note: the compiler expectedly panicked. this is a feature.

> = note: we would appreciate a joke overview: https://github.com/rust-lang/rust/issues/43162#issuecomment-...

Re:Python's Preprocessor – Pydong by SkiFire13 on Friday August 23, 2024 @01:45AM (#41326460)
Re:Python's Preprocessor – Pydong by pjmlp on Friday August 23, 2024 @02:32AM (#41326588)
> error: internal compiler error: It looks like you're trying to break rust; would you like some ICE?

Lovely, and the word game is just great.

Re:Python's Preprocessor – Pydong by TheMatten on Friday August 23, 2024 @04:24AM (#41327171)
This one in Haskell is coincidental, but used as a joke:

``` import Data.Function

main = do let it = fix error print it ```

Re:Python's Preprocessor – Pydong by notpushkin on Friday August 23, 2024 @06:49AM (#41327868)
On HN, you can add code blocks by indenting with 2 spaces:

  import Data.Function

  main = do
    let it = fix error
    print it
Re:Python's Preprocessor – Pydong by sans_souse on Friday August 23, 2024 @07:10AM (#41327964)
If NLP counts, try xyzzy in gemini.google.com
Re:Python's Preprocessor – Pydong by plhannb on Thursday August 22, 2024 @07:44PM (#41325197)
Innocent times. Perhaps Hylton could join the "vote of no confidence" motion in order to get justice for Tim Peters:

https://news.ycombinator.com/item?id=41314393

Re:Python's Preprocessor – Pydong by JodieBenitez on Thursday August 22, 2024 @10:48PM (#41325834)
And just like that, I'm down the drama rabbit hole.
Re:Python's Preprocessor – Pydong by throw-the-towel on Thursday August 22, 2024 @08:42PM (#41325418)
It's always so cool to see this kind of Easter eggs. So sad that they're not as common as they used to be.
Re:Python's Preprocessor – Pydong by lhmadk on Friday August 23, 2024 @05:56AM (#41327640)
There are all sorts of easter eggs and jokes in Python, for example a joke about blind people that GvR prevented from being reverted:

https://marc.info/?l=python-dev&m=130991276326041&w=2

In 2024 suddenly everyone is grown up and corporate and has never done anything wrong.

Re:Python's Preprocessor – Pydong by jszymborski on Friday August 23, 2024 @11:55AM (#41330051)
> In 2024 suddenly everyone is grown up and corporate and has never done anything wrong.

Trying to be considerate of others, even when they are different from ourselves, is indeed kind and good and does come with maturity. You needn't be corporate or have never done wrong to be considerate.

Re:Python's Preprocessor – Pydong by 0x12343276 on Friday August 23, 2024 @12:10PM (#41330210)
Sure, but that is not the situation. Proposals of the original communists sounded good on paper, too. Then came Stalin et al.

They are saying that they are considerate. In practice they censor, get rid of opposition, talk rudely and haughtily to anyone not in their circle, publish defamatory and incorrect summaries of CoC "incidents" and mock people on Twitter.

Re:Python's Preprocessor – Pydong by bonoboTP on Friday August 23, 2024 @07:25AM (#41328020)
How is it remarkable? Random people didn't get to add stuff to Python in 2001. It was a niche thing and someone who was contributing to it was likely to be a smart and dedicated person who would naturally have an impactful career ahead of them.

It's a misconception that the informal playful hobby hacking things are their separate world from real professional development.

Re:Python's Preprocessor – Pydong by dylanfw on Friday August 23, 2024 @02:02PM (#41331391)
I think OP is commenting more so on the reversal of the developer’s relationship with rules of syntax than their personal capabilities.
Re:Python's Preprocessor – Pydong by bonoboTP on Friday August 23, 2024 @04:31PM (#41332830)
Totally right, my mistake. I guess the order of information as presented in that comment misled me.
Re:Python's Preprocessor – Pydong by jhylton on Friday August 23, 2024 @05:09PM (#41333123)
No worries. I was working at PythonLabs at the time, so I guess you could say that adding Easter eggs to Python was part of my day job.