News for hackers. Stuff that matters.
Re:Checked C by zozbot234 on Wednesday December 21, 2022 @07:30PM (#34088224)
"Perl" and "more reasonable language" don't belong together. It's a complete oxymoron. The Rust syntax is entirely compositional, other than the || delimiters (which introduce a fresh binding to the subsequent block), and the ? which involves abnormal control flow.
Re:Checked C by masklinn on Thursday December 22, 2022 @04:18AM (#34091380)
I assume GP posted ironically because the Rust snippet is mostly pretty bland function and method calls, the only weird-ish bits are the postfix "?" (which have become very common[0]) and the block syntax[1], while they're using 3 different sigils in a Perl snippet I'm not even sure makes sense (though it's probably valid because perl) e.g. from what little I've retained of perl (against my will) "@ARG" is an array with the command line arguments, $ARG does not exist, this just passes `undef` repeatedly to `do_something`.

[0] https://en.wikipedia.org/wiki/Safe_navigation_operator

[1] e.g. it doesn't have let..else, macros, raw-idents, complicated type signatures, turbofishes, ... which could make the code a lot weirder

Re:Checked C by tmtvl on Thursday December 22, 2022 @06:47AM (#34092427)
$ARG does not exist

If you read the perlvar perldoc (perldoc perlvar or https://perldoc.perl.org/perlvar), you will see it is the English form of $_. You just need to:

  use English;