News for hackers. Stuff that matters.
Re:The hardest program I've ever written (2015) by hprotagonist on Saturday March 05, 2022 @07:30AM (#30566944)
a recipe for merge conflicts.

i think maybe your only hope is to somehow “version the AST”, and let formatting be a style sheet or something. But i’m 1. talking out my butt and 2. sure i’m missing something.

Re:The hardest program I've ever written (2015) by fragmede on Saturday March 05, 2022 @08:18AM (#30567289)
It's a decent idea!

One problem though is all of the non-code elements, aka comments and how they intentionally align up with the code (mixed with spaces and tabs), so the ideal format is the one the original programmer wrote it in, and the second programmer using a different stylesheet can't edit comments and have them end up pretty for the first programmer. (The solution, obviously, is to not comment any code >_< )

Re:The hardest program I've ever written (2015) by javbit on Saturday March 05, 2022 @10:09AM (#30568188)
If the display of the code is removed from its representation, I think the same could be done for comments. Comments could be kept as part of the AST and rendered how you like.

E.g.

    (+ 1 2)  ; Add two numbers.
Would become

    (comment (+ 1 2) "Add two numbers")
With semantics like const.

Another would be

    (+  ; Adding
     1  ; one
     2  ; and two.
     )
To

    ((comment + "add")
     (comment 1 "one")
     (comment 2 "two"))
You could display comments as popups, marginalia, or even in a traditional fashion (since some intent is captured by the comment scoping. You could also have different types of comments like annotation to have different kinds of display types.
Re:The hardest program I've ever written (2015) by Cullinet on Saturday March 05, 2022 @08:46AM (#30567532)
I agree with the decency of the ide

But isn't this the nearest argument why we should start publishing negative results papers?

The most important thing that I have ever learned was a announcement made by Google about how their industry consortium seeking to trade print magazine advertising inventory, failed with reference to the nature of this failure. No matter how lacking in detail this notice was, no matter that I was sent down a seven years solitary and very lonely path of mercifully ultimate discovery, on the heels of my startups exit collapse due to my cofounder tragically dying but we'd have been sunk by the problems indirectly revealed in that Advertising Age news item. However painful, and I'm talking about therapy for years after I emerged from reclusion, and real health issues giving up running and my diet turning to junk energy hits...I have learned more from being told "no can do Z because of y" and I seriously think that we /seriously have to start already getting over the reasons why we don't talk about our failures/. I mean holy smoke wouldn't we ever run out of good conversation ever again if we could have a good old banter and brew over our cockups? I'm thinking that this is how women are so much more successful in reproduction if they actually want to. What could we do if we tried?

Re:The hardest program I've ever written (2015) by VBprogrammer on Saturday March 05, 2022 @09:19AM (#30567797)
Was this GPT-2 trying to write a HN comment?
Re:The hardest program I've ever written (2015) by olvy0 on Saturday March 05, 2022 @09:52AM (#30568035)
I'm not sure. Their posting history has multiple posts of this type with disconnected sentences. With GPT 2 at least there is usually some continuity and a semblance of a shared context between the sentences.
Re:The hardest program I've ever written (2015) by freedomben on Saturday March 05, 2022 @02:31PM (#30571037)
After reading several of the comments, I think OP is not a native English speaker, and that makes for some awkward grammar/sentence structure.
Re:The hardest program I've ever written (2015) by andai on Saturday March 05, 2022 @02:41PM (#30571152)
I am reminded of Terry Davis.
Re:The hardest program I've ever written (2015) by rendall on Saturday March 05, 2022 @07:52AM (#30567103)
> let formatting be a style sheet

That's a good expression of the idea. If merge conflicts happen, we're doing it all wrong. Version control shouldn't even really be aware of this.

Re:The hardest program I've ever written (2015) by hprotagonist on Saturday March 05, 2022 @07:56AM (#30567139)
tree-sitter and git: now kith!
Re:The hardest program I've ever written (2015) by Cullinet on Saturday March 05, 2022 @08:48AM (#30567548)
the most extreme validation of typographical precision is the banknote. Discuss?...
Re:The hardest program I've ever written (2015) by anchpop on Saturday March 05, 2022 @01:29PM (#30570363)
This is exactly what Unison is trying to do