News for hackers. Stuff that matters.
Re:Swift Algorithms by zapnuk on Thursday October 08, 2020 @05:46AM (#24717501)
Looks great. But I wonder why there are platform requirements for what seems to me like pretty basic functions.

In RandomSample.swift:

  // For log(_:) and exp(_:)
  #if canImport(Glibc)
  @_implementationOnly
  import Glibc
  #elseif canImport(Darwin)
  @_implementationOnly
  import Darwin
  #endif

1. Why aren't those 'basic' functions already implemented in swift, and part of a math package (or in numerics)?

2. Why release a package that does not support windows now that windows is officially supported?

Re:Swift Algorithms by stephencanon on Thursday October 08, 2020 @06:14AM (#24717704)
They _are_ in Numerics (including Windows support). I think Nate is just trying to keep dependencies to a minimum, but feel free to raise an issue.
Re:Swift Algorithms by pjmlp on Thursday October 08, 2020 @08:24AM (#24718452)
Swift blog also has enough of such examples right on the introduction.