Code Monkey home page Code Monkey logo

arrow's People

Contributors

benhj avatar jprendes avatar

Stargazers

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

Watchers

 avatar  avatar

arrow's Issues

Add a networking API

Wondering about networking builtins, e.g.:

http_read("http://server/path/something.dat") -> bytes;

Allow map_contains lookup to match on wildcard strings

If we have

"value" -> map:"someKey";
;;; should evaluate to true
;;; Note res, could be a pod where the first member is a boolean
;;; and the second is the actual key, e.g.:
map_contains(map, "*Key") -> res;  ;;; should match

;;; retrieve if contains:
if(res:truth) {
    res:key -> theKey;
}

Add a POD type (idea)

A 'Plain Old Data' type will likely have syntax similar to

pod data(a, b, c, d, e);

;;; invoked as
start {
    ;;; create a pod named data
    data(1,2,3,4,5) -> f;

    ;;; access individual members of data
    f:a -> var1;
    f:b -> var2;
}

Using the old argument syntax produces a segmentation fault.

Running the factorial script using the old argument syntax causes a segmentation fault.

run: ./arrow factorial.ar 5
where factorial.ar is:

fn factorial(n) -> f {
    1 -> f;
    if (n > 1) {     
        n * factorial(n - 1) -> f;
    }
}

start {
    arg 0 -> N; ;;; note the use of `arg 0` instead of `arg(0)`
    pr "result: "; prn factorial(N);
}

Expected result: Parse error
Actual result: Segmentation fault

Reading command line arguments relies on accessing invalid memory.

Currently, Environment::getProgramArgument does an unchecked vector indexing m_programArguments[index], and ArgExpressionEvaluator::evaluate relies on that unchecked throwing an exception. This is not always the case.

Replacing it with a checked indexing m_programArguments.at(index) would fix this issue.

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.