GithubHelp home page GithubHelp logo

spy16 / slurp Goto Github PK

View Code? Open in Web Editor NEW
33.0 33.0 3.0 168 KB

Slurp is a highly customisable LISP toolkit for Go applications. ๐Ÿ’ป

License: MIT License

Makefile 0.43% Go 99.57%
embedded-scripting-language go golang lisp scripting-engine

slurp's Introduction

Hi there ๐Ÿ‘‹

I am Shivaprasad Bhat. A Software Engineer (Since 2016) from India.

  • โ™ฅ๏ธ I love building interesting things. They may not always be useful or unique ๐Ÿ˜. Feel free to checkout my repositories.

  • ๐Ÿ—๏ธ I build SaaS tools in my free time

  • ๐Ÿคฉ Apart from tech & brain things, I also watch a lot of movies & play a lot of Arma 3 (King of the Hill mainly. Add me on Steam if you know what I am talking about ) ๐Ÿ˜Ž.

  • โœ๏ธ I blog very rarely at https://spy16.in


๐Ÿ“ก LinkedIn | E-mail | Website

slurp's People

Contributors

lthibault avatar spy16 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

slurp's Issues

a couple of doc wish-list items

It would be very nice to have the following:

  • a quick conversion guide for sabre/slang -> slurp
  • the getting started guide mentions how to expose values and functions but this is missing

Implement Concurrency Primitives

Concurrency primitives need to be decided.

Consider:

type GoExpr struct {
	Value value.Any
}

// Eval forks the given context to get a child context and launches goroutine
// with the child context to evaluate the Value.
func (ge GoExpr) Eval(ctx *Context) (value.Any, error) {
	child := ctx.fork()

        p := Promise{
                val: make(chan value.Any, 1)
                err: make(chan error, 1)
        }

	go func() {
                // N.B.:  we don't need to close any of the channels (see note below).
		if val, err := child.Eval(ge.Value); err != nil {
                    p.err <- err  // non-blocking due to buffer
                } else {
                    p.val <- val
                }
	}()
	return nil, nil
}

type Promise struct{
    // both channels are buffered (len=1)
    val chan value.Any
    err chan error
}

(p Promise) Eval(ctx *Context) (value.Any, err) {    return p, nil    }

(p Promise) Invoke(ctx *Context, args ...value.Any) (val value.Any, err error) {
    select {
    case val = <-p.val
    case err = <-p.err
    }
    return
}

Implement Core Data-Structures

Opening this issue to track progress on core data structures.

  • Atoms (int, float, char, bool, nil)
  • String
  • Keyword
  • Symbol
  • LinkedList & Seq interface
  • Vector
  • Map
  • Set

All types should present a persistent interface.

I plan to start work on a hash-array map trie with CHAMP semantics soon. (very loose) ETA 30-60 days.

Implement reader package.

  • Implement Reader with macro-table + dispatch-table. (Mostly take from Sabre)
  • Implement New() with functional options to customise all internal tables, number-reader.
  • Implement WithMacroTable, WithDispatchTable, WithNumberReader etc.

Bug: vector is empty after evaluation

Looks like the vector result after eval is empty. This happens in the REPL when I run go run examples/simple/main.go and enter [ 1 2 3]. Also trying to execute [a b c] (where the vars are not bound) doesn't cause an error. (Seems to be happening both before and after #10)

@lthibault Any clues? I have not tried to go through the code on the vectors yet.

Implement Builtin Analyzer

  • Define Expr and Context contracts (interfaces)
  • Implement builtin primitive data types + seq (linked-list) type.
  • Implement a concurrent-safe parens.Analyser which can analyse and produce Expr for builtin types.

Note: Vector, Set, Map are out-of-scope for 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.