Giter VIP home page Giter VIP logo

dgen's People

Contributors

psfried avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dgen's Issues

Add builtin function for generating random date/time strings in various formats

Generating timestamps is a pretty common thing, so it would be nice to have some ways of generating them out of the box. A reasonable function signature might be something like def format_datetime(format_string: String, time_zone: String, epoch_time_seconds: Int, subsecond_nanos: Uint). We could then use the chrono crate to create the date objects and format them using the given format string.

With that builtin function, we could then add a standard time module that builds on it to add some common useful functions for things like creating iso-8601 timestamps with UTC time, or things that generate sequential timestamps.

Add basic math builtin functions

Functions like add, mul, div, mod, max, min, abs, etc, would be very useful for generating more complex data, or for formats where there's some constraints like "a string at least n bytes long". We should add them as builtin functions.

One thing we'd need to decide is how to handle overflow. Should we default to only wrapping or only erroring, or should we create separate functions for each way of handling overflow?

Option A: wrapping_mul(a: Uint, b: Uint) wraps on overflow and mul(a: Uint, b: Uint) errors on on overflow
Option B: mul(a: Uint, b: Uint) always either wraps or errors on overflow
Option C: maybe something else?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.