darklang / darklang/dark

Component: Standard Library

Open
#5,239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ready-for-contribs
Dominant language
F#
Stars
2.2k
Forks
115
Avg merge
17h 28m
Merged PRs (30d)
50

Description

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

  • division options are confusing (see #4627)

Strings

  • add String.trimStart and String.trimEnd
    • for RTL, it should work fine, as the RTL is just rendering, and "start" and "end" refer to the same place in both.
    • see discussion in #3159
  • Support "full" case mapping in Strings: toLower/toUpper (see #3437)

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 #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

  • #5447

URLs

  • URL decoding function
  • URL builder

Misc

  • Add HTML parsing functionality to standard library (see #2811)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

This is an umbrella issue with no implementation file, test, or single entry point named. Start by selecting one unchecked item and reading its referenced issue or discussion, such as #4627, #3159, or #3437. Done means the selected standard-library task has a confirmed scope and corresponding implementation or documentation changes.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.