News for hackers. Stuff that matters.
Re:Ruby Methods Are Colorless by 01HNNWZ0MV43FF on Tuesday July 23, 2024 @09:22AM (#41045757)
"Colorless" is probably referring to the thing in Rust where functions are "Colored" for async or sync execution

I can tell you as a non-Ruby, non-web dev what the Ruby mindshare feels like to me:

- I hear that Ruby is slow

- The syntax looks odd

- I know Ruby on Rails was very popular at some point but I think it's been displaced almost entirely by C# and Node.js

- I have no intention of learning Ruby. If I was going to invest in learning web tools, and Rust was not an option, I'd prefer TypeScript first, Python second, and something else third

Re:Ruby Methods Are Colorless by williamcotton on Tuesday July 23, 2024 @09:43AM (#41045952)
Here's three different ways to write a small shell script that turns letters into uppercase:

Node:

  let inputData = '';
  process.stdin.on('data', 
    chunk => inputData += chunk
  );
  process.stdin.on('end',
    () => console.log(inputData.toUpperCase())
  );
Python:

  import sys
  sys.stdout.write(
    sys.stdin.read().upper()
  )
Ruby:

  puts $stdin.read.upcase
Re:Ruby Methods Are Colorless by racketprogram on Tuesday July 23, 2024 @09:52AM (#41046048)
console.log(require('fs').readFileSync(0).toString().toLowerCase())
Re:Ruby Methods Are Colorless by IshKebab on Tuesday July 23, 2024 @09:37AM (#41045905)
It's not a Rust thing. It's any language with a async/await. IIRC the original article was about JavaScript.
Re:Ruby Methods Are Colorless by ctz on Tuesday July 23, 2024 @09:56AM (#41046083)
The underlying concept is applicable to lots of things, really. For example, the functions that are unsafe and safe to call from a POSIX signal handler can be treated as a function colouring problem.