Skip to content

dryproject/drylib

Repository files navigation

DRYlib

Project license Travis CI build status

The polyglot programmer's standard library.

Caveats

This is a semi-public, pre-alpha, work-in-progress project.

Here be dragons.

Caveat utilitor: assume nothing works, and you may be pleasantly surprised; and when it breaks, you get to keep both pieces.

Languages

Language Typing Usage
C static #include "drylib.h"
C++ static #include "drylib.hpp"
Common Lisp dynamic (require :drylib)
D static import dry = drylib;
Dart static  
Elixir dynamic  
Go static import "github.com/dryproject/drylib.go"
Java static import dry.*;
JS dynamic import * as dry from 'drylib';
Julia dynamic using DRYlib
Kotlin static import dry.*
Lua dynamic dry = require 'drylib'
OCaml static open DRY
PHP dynamic require_once 'drylib.php';
Python dynamic import drylib
Ruby dynamic require 'drylib'
Rust static extern crate drylib as dry;

Rationale

  • Reduces the cognitive load of frequently switching between different programming languages.
  • Enables network effects to cross different languages.
  • Facilitates code generation for multiple target languages.

Features

Installation

To use DRYlib in your favorite programming language(s), refer to the table at the top that links to the specific code repositories for the set of currently supported target languages.

Reference

Data Types

base

  • bool: Boolean (true or false).
  • char: Character (21-bit Unicode code point).
  • complex: Complex number (arbitrary size).
  • float: Floating-point number (native size).
  • float32: Floating-point number (32-bit single-precision).
  • float64: Floating-point number (64-bit double-precision).
  • int: Integer number (native size).
  • int8: Integer number (8-bit).
  • int16: Integer number (16-bit).
  • int32: Integer number (32-bit).
  • int64: Integer number (64-bit).
  • int128: Integer number (128-bit).
  • integer: Integer number (arbitrary size).
  • natural: Natural number (arbitrary size).
  • rational: Rational number (arbitrary size).
  • real: Real number (arbitrary size).
  • word: Machine word (native size).
  • word8: Machine word (8-bit).
  • word16: Machine word (16-bit).
  • word32: Machine word (32-bit).
  • word64: Machine word (64-bit).

Reference (experimental)

Data Types

geo

  • location: GPS location (latitude, longitude, altitude).

net

  • port: Port number (for TCP, UDP, etc).

net/ipv4

  • address: IPv4 address.

net/ipv6

  • address: IPv6 address.

std/ietf

  • iri: Internationalized Resource Identifier (IRI).
  • uri: Uniform Resource Identifier (URI).
  • url: Uniform Resource Locator (URL).
  • urn: Uniform Resource Name (URN).
  • uuid: Universally Unique Identifier (UUID).

std/itu

  • oid: Object Identifier (OID).

std/w3c

  • curie: Compact URI (CURIE).

time

  • duration: Time duration.
  • instant: Time instant.

Releases

No releases published

Packages

No packages published