- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
No
It took me way too long to notice the horror on the right
I like python like really really like it. But this should be a warcrime
Wow, so this is possible.
Formatting is so damn arbitrary. Somebody has to have tried storing just the parse tree on disk, right?
The closest thing I’ve seen is Combobulate
If you do that, you lose formatting and comments every time you load the source from disk
Losing formatting other than what you’ve set in your deparser would be the point. Losing comments would be bad, but that seems easily fixable just by giving each comment block a symbol that points to it’s contents.
Or by including comments in the parse tree. (& Yes, it is done various places for various languages and formats.)
Do you have some examples?
(That is what I meant by giving them a symbol, maybe I worded it poorly)
The best example I have is a closed source one and I can’t be more specific on what it is than to say that it’s probably installed on at least one of your Apple devices (assuming you have any).
Implementation-wise, the syntax tree nodes have additional attributes that hold pre- and/or post-element text. What’s on disk is the serialized tree. You edit a text version, and it’s parsed on every edit so it doesn’t have to be parsed again at evaluation time, and what’s stored is the parse tree with enough whitespace and comment hints to reconstruct the text for editing.
This is a case where looking at the textual code is rare, but hundreds of results must get updated in realtime on every change. This might be enough of a hint as to what program it is.
My humanity.
DwangoAC and the TASBot crew are maniacs in the best possible way. I would like to continue having a high opinion of him, hence I will pretend that this post does not exist.
My eyes! My eyes!!!
This is why python has to be putdown
A funny, but incredibly subtle joke to do would be to do a post like this, but get the indentation subtly wrong somewhere, so something that’s supposed to be inside a loop is outside according to indentation, but is inside according to braces.
To me it just looks like you do not need the braces at all
This makes my deeply uncomfortable, like an itch I can’t quite scratch.
More like a scratch you just can’t itch.
My medication mostly.
Hang on, this is just a C++ joke slapped onto Rust.
You could say they have rewritten the joke in Rust
But you get the joke faster now.
No, it’s just impossible for it to leak out of a hole in the back of your head that you didn’t realise was growing under your pony tail.
rustfmt
is stopping me from writing code like this, and I have never been more happier using it after viewing this.
I’m going to write a tool that automatically adds the braces and semicolons to the column as you edit the code.
I will call it
rustfml
Crap, thats what I was thinking.
It could be run after git checkout and then rustfmt before commit.
Slow down satan
I’ll allow it!