News for hackers. Stuff that matters.
Re:Show HN: Moon Phase Algorithms for C, Lua, Awk, JavaScrip... by librasteve on Monday June 02, 2025 @05:23AM (#44157059)
made a PR for raku, hope it gets accepted

some cool things stood out:

  sub fixangle($a) { $a mod 360 }    # raku has built-in support for Euclidean modulo
  pi                                 # raku has pi
  
  # Solve equation of Kepler
  my $e = $M; 
  my $delta;

  repeat {                           # raku's repeat loop allows initialisation of delta to be folded in
    $delta = $e - $eccent * sin($e) - $M; 
    $e -= $delta / (1 - $eccent * cos($e));
  } while abs($delta) > 1e-6;
Re:Show HN: Moon Phase Algorithms for C, Lua, Awk, JavaScrip... by eddyg on Monday June 02, 2025 @08:41AM (#44158215)
Thanks! (I'm a big fan of Raku; it doesn't get nearly the respect it deserves!)
Re:Show HN: Moon Phase Algorithms for C, Lua, Awk, JavaScrip... by oliverkwebb on Monday June 02, 2025 @10:49AM (#44159416)
Thank you! I accepted it
Re:Show HN: Moon Phase Algorithms for C, Lua, Awk, JavaScrip... by librasteve on Monday June 02, 2025 @11:24AM (#44159825)
yay - it has made it to raku module status https://raku.land/zef:librasteve/Moonphase