Coder Social home page Coder Social logo

conorobrien-foxx / stacked Goto Github PK

View Code? Open in Web Editor NEW
15.0 4.0 0.0 328 KB

A practical stack-based language with an emphasis on functions.

JavaScript 93.02% HTML 6.07% CSS 0.91%
language stack postfix concatenative programming-language scripting-language

stacked's Introduction

logo

Stacked

A stack-based language with a focus on functions and scripting.

Notes on the interpreter: it's currently written in browser JavaScript. Since it uses ES6 syntax, I can only guarantee that it works on FireFox. The final product is intended to be written in C++ or C, but that is still some time away. The syntax itself is not subject to much change hereafter, same with most functions.

The programs themselves are primarily intended to be readable yet writeable. That is, I intend the language to never force you to write boilerplate. That is, you should never have to do public static main void function long asdf to print a string.

An important note: I've focused more on the breadth of functions, and while I try to catch bugs, it's more than likely that bugs exist in the code. Please, open an issue or pull request if something seems out of the ordinary. I'll be more than happy to explain the language to you, so even if the issue just stems from misunderstanding, I will respond.

Check out the wiki for more information!

Online interpreter, and Try it online!.

stacked's People

Contributors

conorobrien-foxx avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

stacked's Issues

On stdin end event

There's online, but no onend --thus, it is hard to find when there is no more data.

Feature request: pattern matching in lambda arguments

Consider the following program:

{ xv yv :
  xv yv #, transpose
  $- #/ $square + map sum sqrt
} @:dist

It takes its arguments as, e.g., (1 2) (3 4) dist. Now, with pattern matching, we could write this as:

{ (x1 y1) (x2 y2) :
  x1 x2 - square y1 y2 - square + sqrt
}

Another example:

{ ((a b) (c d)) :
  a b - c d - +
}

Function repetition and application over arguments

Implement *<Func, Decimal>, *<Decimal, Func>, *<Lambda, Decimal>, *<Decimal, Lambda>.

Also, implement, for a func-like f, arr f spread. Equivalent to an infix f(*arr).

For example:

> (3 4) $add spread
(7)

Fix npm installation

Currently, there is no way to automatically install the node packages. The following packs must therefore be installed independently:

  1. clear
  2. readline-sync
  3. minimist

`falsey` problem

The definition for falsey has the following condition (line 626):

    c |= isNaN(tp);

This is true for more than NaN.

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.