Giter Club home page Giter Club logo

lambdacore's People

Contributors

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

lambdacore's Issues

Fix Array Bug

Cannot print arrays and arrays are flattened no matter their depth.

Quoting

Quote: Don't evaluate symbol

'(+ 1 2)
    ⇒ (+ 1 2)

REPL

Use lcore_parse and lcore_interpret to make a REPL.

LambdaCore REPL runs the command if it has the first and last paren. This means that multi line statements contained within an open paren will become a syntax error after 3 enter keys are pressed without a closing paren.

Functions

(defn 'hello-world ['person] '[
    (prin "Hello ")
    (prin person)
    (print "!")
])

(hello-world "Pebaz")

Builtin - `if` & `sel`

(if True '[
    (print "It's True!")
]'[
    (print "It's False!")
])

(set num 3)

(sel num
    1 '[
        (print "It's One!")
    ]
    2 '[
        (print "It's Two!")
    ]
    3 '[
        (print "It's Three!")
    ])

Standard Library

Need to support how the standard library will interact with the interpreter.

Need to implement #11 before starting this.

Module Imports

Allow code to be imported and interpreted to add names from another file.

DevOps Pipeline

Need to determine what CI/CD pipeline to use for distributing release versions of LambdaCore.

Trust Travis CI and AppVeyor template to test your Rust crate on 5 architectures and publish binary releases of it for Linux, macOS and Windows

Scopes

Can't have functions defining local variables that can be accessed after the function is over.

Backwards Evaluation Order

;; Instead of evaluating arguments from back to front:
(print "third" "second" "first")

;; Eval them from front to back:
(print "first" "second" "third")

Types (Structs)

Need to be able to support user defined types.

:: Type definition
(type 'person '[name age])

:: Instantiation
(set 'pebaz (new person "Pebaz" 24))

:: Usage
(print (get pebaz 'name))
(print (get pebaz "name"))

:: Future
(print pebaz/name)

Once the #29 Dict type is created, it will be easy to make type definitions return Dicts.

Clean Up Readme to be updated

  1. How to build
  2. How to run
  3. How to install via the installer
  4. Brief syntax tutorial w/ reference to examples
  5. Link to website
  6. Link to downloads

BackTick

Backtick: Evaluate other parts of array while not evaluating others.

`(a list of ,(+ 2 3) elements)
    ⇒ (a list of 5 elements)

Make website

Tutorial, download, hook up to DevOps pipeline.

Tail Call Optimization

Eliminate duplicate symbol tables from being created by reusing the previous stack frame.

Dict Type

Dicts need to be able to be indexed using any value type?

(set 'info (dict "first name" "David" "last name" "Wallace"))
(set 'ms (dict 'first-name "Michael" 'last-name "Scott"))

(print (get info "first name"))
(print (get ms 'first-name))

Research Macro System

Need to implement macros. Macros are just functions that have their arguments passed to them untouched rather than pre-evaluated.

Potential plan:

  • Prevent the evaluation of Array from evaluating arguments.
  • Implement a Macro variant for Value.
  • Implement an eval built-in function for Macro designers to evaluate Arrays of code.
(defm setq '[key value] '[
    (set 'key (eval value))
])

(setq name "Pebaz")

Related: https://software-lab.de/doc/tut.html#fun

Return using Exception not return_points.

Returning from a function may work, but it is inconsistent and uses something that is not similar to a loop. If an error is created named ReturnError that holds the Value to return, it can escape any number of loops to return a value.

This may not be worth the effort to implement, but would simplify the inner-workings of LambdaCore and help the programmer's mental model when adding features.

Split Code Up

Use Rust modules instead of putting everything into a single file.

Builtin - Swap

Since all functions return values instead of references, there is no way to modify any collection value. The swap function will allow this:

(set 'person (dict 'name "Pebaz"))
(swap 'person '[name] "Protodip")
(print (get person 'name))  :: Prints "Protodip"

The quoted list contains sequential indexes to any collection objects it finds along the way:

(set 'person (dict 'name "Pebaz" 'inventory [1 2 3]))
(swap 'person '[inventory 1] 222222)
(print (get (get person 'inventory) 1))  :: Prints 222222

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.