Code Monkey home page Code Monkey logo

jasl's People

Contributors

benhj 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  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

myonetaps

jasl's Issues

No need for 'return' statement

In the following statement,

fn:int myReturnable() -> toReturn {

    return toReturn;
}

we don't need 'return toReturn;' since this is implicit in the '->toReturn' bit.

lists

list(mylist, [a b c d e f g]);

file saving API

file_save_bytes bytes -> path;
file_save_lines lines -> path;
file_append_byte byte -> path;
file_append_line line -> path;

new var syntax

Since string(s, "hello"); is allowed should also allow:

int(s, 5);
double(x, 1.1);

etc.

list_get_token

list_get_token (1, [hello world]) -> token;
echo_nl token;

Should print out "world".

list_token_index

string "there" -> str;
list_token_index (str, [hello there]) -> in;
echo_nl in;

should print out 1.

A variable can be instantiated multiple times

E.g.

integer 5 -> a;
decimal 5.1 -> a;

is currently allowed. Printing out the value of a using echo will further print out 5 since the set of integers are searched in precedence of the set of decimals.

string_has_token

string_has_token("hello, there", [there], result);

result == true;

complete syntax overhaul

Language syntax is far too c like. For variables how about the following kind of syntax:

integer 5->n;
decimal 3.14->d;
string [hello world!]->s;

For syntax for file reading

Where file is a string indicating the absolute path, read in token by token:

for_word w in file {

}

Read in char by char:

for_char c in file {

}

Read in byte by bytes (will assume binary mode)

for_byte b in file {

}

The latter example will depend on the byte type having been implemented.

File reading API

More API ideas

file_read_strings path -> strings;
file_read_bytes path -> bytes;
file_read_text path -> str;
file_list path -> strings;

Commands should be executed as they're parsed

At the moment a structure is generated holding information pertaining to a parsed statement. That structure is then used by a given command to bring about certain functionality. I think it would be better to have each command execute as soon as the command is parsed. This ought to drastically speed things up.

byte array to string and vice-versa

An array of bytes to a string representation:

array:byte(10) -> bytes;
///...
string bytes -> bytesToString;

A string to an array of bytes:

string "just a test string" -> str;
array:bytes str -> bytes;

update syntax

integer(a, 1);

As in "store the integer 1 in variable with name 'a'" should be:

integer(1, a);
decimal(2.2, b);
string("Hello", c);

etc...

This will be consistent with string_length("Hello", length);

Program arguments

In start function allow:

args(0, s); // put arg 0 in to string s
to_int(s, a); // will convert string s to an integer storing result in a

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.