Giter Club home page Giter Club logo

playground-rei's Introduction

Playground for Rei

Notebooks and scripts.

How to model the concept of metaprogramming and metacomputing?

Build from standard models and interactions. So standard nodes and edges??

A node that represents a CFG. Which represents the base grammar or syntactical structure. An edge that leads to a node that represents a meta language which BUILDS or uses the CFG in a higher order manner.

Instead of being quantified over just things like... Idk Variables and stuff. We have more "things". That can be ambigious. And we need "context" to clarify the ambiguity. If we cant clarify, we can either choose to error or just return that and refuse to evaluate further ....

meta a:
	ident: a
	type: function

You can match on strings in some interesting ways.

match a.ident
    [Capital(x)..] => ...
    _ => _

match a.ident
    r"[A-Z].*" => ...
    // warning, non exhaustive, if no matches found, nothing will happen and the entire expression will early terminate. It will auto log as well by default...

How about matching on the structure of the expression? Uhh maybe not? You can match on the semantics kinda.

Like

match a.fields
    0 => Empty
    1 => One
    _ => Multiple

If it cant find an identifier, it will also do the same thing. Log an unidentified identifier and early terminate. And possibly highlight them too.

NOTE. Some things can be "erased" or "compile time" evaluated if you include a "pre-evaluate" pass.

Format: trait
    format_type: Type
    // sugar for (): () = ?
    apply: () -> String

FormatType: Pretty | Debug

A: impl Format
    format_type: Debug
    apply: () -> String = String::from_fields(self.fields)

QUICKER WAY:

FormatType: Pretty | Debug
Format: trait (Type) -> String
A: impl Format (Type) -> String = match
    Debug => String::from_fields(self.fields)

OR

Format: trait
    apply: (format_type: FormatType) -> String

FormatType: Debug | Pretty

A: {}

A: impl Format
    apply: (format_type: FormatType) -> String = match format_type
        Debug => String::from_fields(self.fields)

print(A()) // prints the debug version

// extend the base sum type with another variant
FormatType: extend
    All

playground-rei's People

Contributors

hyperswine avatar

Watchers

 avatar

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.