News for hackers. Stuff that matters.
Re:Async Ruby by nixpulvis on Saturday October 30, 2021 @04:42PM (#29052143)
On a tangential note.

> Async Ruby is colorless!

I find it deeply irritating that this is how we choose to describe things these days. Rather than talking about modality, or even using a few more words to describe the actual differences in terms of the underlying programing language models.

Telling me that Ruby's async is colorless implies that I know about the description of programming models as "colors" of code, which was just some random analogy someone came up with which caught on. Nothing about this has anything to do with color. Even syntax highlighting doesn't really fit. This is akin to particle physicists getting cheeky and calling one of the quantum states "color" when it has nothing to do with wavelength (correct me if I'm wrong).

This is an appeal to stop trying to be so cute. Thank you.

Re:Async Ruby by sanderjd on Saturday October 30, 2021 @07:24PM (#29053086)
It's jargon. This is an industry board. Jargon is par for the course.
Re:Async Ruby by jazzyjackson on Saturday October 30, 2021 @08:53PM (#29053566)
What do musical scales have to do with it? (Modality :P)

"coloring" goes back before a few blog posts, it was probably popularized with programmers that keep up with crypto, as 'colored coins' are described in an influential paper right around the creation of Ethereum (Vitalik is one of the authors)[0], but I found some earlier references too, like coloring a complex plot to add a dimension [1], so carrying it over to computer programming, you have functions that have otherwise identical signature that you need to distinguish, so you make them different colors.

[0] https://docs.google.com/a/buterin.com/document/d/1AnkP_cVZTC...!

[1] https://en.wikipedia.org/wiki/Domain_coloring

Re:Async Ruby by tyrfing on Sunday October 31, 2021 @02:09AM (#29054832)
Coloured Petri Nets predate both and are relevant to crypto, I don't know enough to say if the idea was math/compsci jargon prior to that as well.

https://en.wikipedia.org/wiki/Coloured_Petri_net

Re:Async Ruby by jazzyjackson on Sunday October 31, 2021 @04:36AM (#29055478)
Thanks! Didn’t know about Petri nets, makes me wonder if this all didn’t start with Red/Black binary trees, so named because that’s the two colors of ink they had on hand, cited 1978:

https://softwareengineering.stackexchange.com/questions/1166...

Re:Async Ruby by bradgessler on Saturday October 30, 2021 @05:12PM (#29052333)
What is “colorless” suppose to mean? This is the first time I’ve seen it used.
Re:Async Ruby by justsomeuser on Saturday October 30, 2021 @08:56PM (#29053583)
It references the function return type:

Colored = Promise<T>

Colorless = T

In "colorless" async/await, async functions are implicit (no async keyword), and when called, the compiler auto-unwraps the promise, so everything looks like "sync" code but any function stack could "save and resume" at an "async point".

Re:Async Ruby by bradgessler on Tuesday November 09, 2021 @02:00PM (#29165898)
Too bad the Zeitgeist didn't land on "Typed" vs "Untyped".
Re:Async Ruby by vmarquet on Saturday October 30, 2021 @05:29PM (#29052427)
I think it's a reference to this blog post https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...
Re:Async Ruby by auno on Sunday October 31, 2021 @07:11AM (#29056152)
Which in turn is making a reference to an even older post at https://ansuz.sooke.bc.ca/entry/23.
Re:Async Ruby by jsnell on Saturday October 30, 2021 @05:29PM (#29052428)
Re:Async Ruby by brunosutic on Sunday October 31, 2021 @04:46AM (#29055517)
Red-black tree, a well-known algorithm also uses color references

https://en.wikipedia.org/wiki/Red–black_tree