Giter Site home page Giter Site logo

cicada-lang / inet-cute Goto Github PK

View Code? Open in Web Editor NEW
130.0 1.0 3.0 3.41 MB

An implementation of interaction nets. -- ASCII art inspired syntax. -- Pure postfix expression. -- Using a stack-based low-layer language to build nets.

License: GNU General Public License v3.0

TypeScript 88.20% JavaScript 0.18% Assembly 11.33% SWIG 0.29%
interaction-nets inet stack-based postfix-notation interpreter graph-processing graph undirected-graph computation-model monoid

inet-cute's Issues

Can't use let binding in expression twice?

Hi, thanks for creating this project!

I'm running into an error in code that, as far as I can tell, should work.

(define-cons thing 0)

(define-cons nil 0)
(define-cons cons 2)

(define-elim double 1)
(define-rule (nil double) nil)
(define-rule (cons double) (let head) double head cons head cons)

(define-net doubled-list
  nil thing cons thing cons thing cons thing cons double)

I'm trying to write code to double the length of a list.

However I'm getting the error Undefined name: head, which doesn't make much sense to me, since

  1. I've defined head
  2. If I use head only once in the expression it works fine

Is there some kind of linear typing at work here, where you can't use a let binding more than once in the rewritten graph? Or is this a compiler error?

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.