Git Product home page Git Product logo

bfec's People

Contributors

kbjr avatar

Watchers

 avatar  avatar

bfec's Issues

"Nearest Ancestor" field selector expressions

In addition to the existing field-reference expressions, add a new expression type to find near-by ancestor nodes of a specific type

# === Already Exists ===

# Root lookups
$.foo.bar

# Local lookups
@.foo.bar



# === New Expression Type ===

# Nearest Ancestor lookups
%.foo.bar



# === Example ===

enum Value : b1 {
  a = 0;
  b = 1;
}

struct Foo {
  foo_value: Value;
  foo_field: Bar;
}

struct Bar {
  # This parameter expression means "looking *up* the stack from here,
  # find the nearest ancestor node of type `Foo`, then grab the value
  # of the field `foo_value` from that node"
  bar_field: Baz(%.Foo.foo_value);
}

struct Baz(value: Value) {
  baz_value: Value = value;
}

IDs and refs

Declaring new ID sets

id SomeID = u32;

ID fields in structs

struct SomeObject {
  obj_id: SomeID;
}

References to IDs

struct SomeOtherObject {
  obj_reference: ref<SomeID>;
}

Questions

  • Non-int IDs?
  • Are IDs auto-generated? Always or optional?

Compression

struct Image {
  # `data` here would first be encoded as `ImageData`, then that encoded data
  # would be gzip compressed
  data: compress<ImageData>('gzip');

  # Special case for compressing bare buffers?
  other: compress<u8[u32]>('gzip');
}

struct ImageData {
  # ...
}

Unbounded Big Ints

New built-in types ibig and ubig, to represent unbounded integers. Encoded in the same format as varint<real>.

Signatures

struct FileContents {
  data: SomeVariousContents;

  # Buffer (`u8[u32]`) containing a signature for the data in `@.data`
  # signed using an ECDSA algorithm
  signed: signature<u8[u32]>(@.data, 'ECDSA');
}

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.