News for hackers. Stuff that matters.
Re:Grain 0.4 – Cereal by Chris2048 on Friday September 24, 2021 @08:54AM (#28641652)
> Grain format provides an opinionated code formatter tool for Grain source code

I think this is a great idea; for the lang devs to provide such a thing.

After using black & isort in pythons, the option of automatic consistent formatting for shared code really cuts down on manual formatting work.

Re:Grain 0.4 – Cereal by nerdponx on Friday September 24, 2021 @09:26AM (#28642024)
I strongly agree. It makes it much easier for a language to compete with incumbent languages if it already has basic developer tools like a test suite, a build system, etc. it also has the benefit of centralizing in standardizing the developer experience, compared to some languages where it's difficult for a beginner because there is no obvious correct way to do things.

I agree about formatting too, although every once in a while I do wish I could protect a specific section from automated formatting. Custom format and can be nice for things like mappings/tables, and certain deeply-nested JSON-like structures such as MongoDB queries.

Re:Grain 0.4 – Cereal by marcusr on Friday September 24, 2021 @11:53AM (#28644088)
Formatter author here - we do have the ability to protect specific sections with a // formatter-ignore comment before the section you want the formatter to leave as-is.
Re:Grain 0.4 – Cereal by Chris2048 on Friday September 24, 2021 @09:42AM (#28642212)
Hmm, the advantage of an "official" formatter, is that the language itself could maybe support formatting directives?
Re:Grain 0.4 – Cereal by jagger27 on Friday September 24, 2021 @10:31AM (#28642946)
gofmt is another excellent example.