Skip to content

Component: Standard Library #5239

Description

@StachuDotNet

Darklang's "standard library" is the suite of things (like many List functions) that the Dark team volunteers to steer and maintain, as opposed to functionality non-core, best designed and implemented by users. Much of these stdlib functionality is supported by Builtins for lower-level operations.

This issue is to organize work related to Darklang's "standard library."

Most of the tasks here are accessible to contributors, especially with a bit of discussion.

Numerics and Math

Strings

Date and Time

  • Date should be clear what granularity is available
    • Are two Dates with the same second the same? Let's make sure they are, or expose enough detail so users can see why (eg, ticks or milliseconds or whatever).
  • module should document timezone info / UTC (see Date module should document timezone info / UTC #3574)
  • higher-precision DateTimes
  • add TimeSpans to Dark
    • along with this, create a new version of Date::subtract which returns a timespan
  • more date functions
  • Date formatting

Collections

  • List.shuffle
  • List.remove (some ergonomic way of removing an item)
  • List.dropFirst if we don't have it already
  • List.indexOf
  • List.maxBy

Bytes

  • add Bytes.contains
  • add Bytes.toList
  • add Bytes.map
  • startsWith, endsWith (single)
  • get byte at location
  • set byte at location
  • add Base64.urlEncode
  • add Bytes.slice builtin
  • add Bytes.drop (using Bytes.slice)
  • add Bytes.take (using Bytes.slice)
  • add Bytes.append / Bytes.concat
  • add Bytes.reverse
  • add Bytes.containsSegment
  • add Bytes.encode and Bytes.decode, adopting patterns from Elm
  • add Bytes.startsWith, Bytes.endsWith (segment)
  • add Bytes.find
  • add Bytes.indexOf
  • add Bytes.lastIndexOf
  • add Bytes.trim
  • add Bytes.replace (either single byte or a segment of bytes)

Json

URLs

  • URL decoding function
  • URL builder

Misc

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-contribsThere's work here that's relatively approachable, if you're interested!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions