Giter VIP home page Giter VIP logo

bakeneko's People

Contributors

nlfiedler avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

bakeneko's Issues

Support derived expression types for R7RS

See section 4.2 of R7RS for a complete list of the standard derived expressions expected in Scheme. This includes, but is not limited to, cond, case, and, or, when, unless, let and friends, begin, do, delay, force, etc.

Support inclusion (include[-ci]) R7RS 4.1.7

A means of reading the contents of a Scheme program from a file into the current file, in place, as if wrapped in a (begin). The -ci variant inserts a #!fold-case directive.

Support arbitrary number of arguments

Some procedures may take an arbitrary number of arguments (e.g. (list)). This should be done in the closure.Bind() function. If the closure.parameters field is an improper list (i.e. the last parameter label is preceded by a space-delimited period (.)) then after assigning the values to the preceding labels, the rest of the values are stored in a list and assigned to the last label.

Profile the compiler and byte code VM

Prior to having the line number information compiled into the byte code object, the compilation was quite fast. After gathering and storing the line number data, the compilation time increased by 33%. Would be ideal to gather some profiling stats and see if there's room for improvement. However, the -test.cpuprofile flag does not seem to work properly in Mac OS X 10.9, so may need to try a Linux VM.

Intern symbols

When reading Scheme code, symbols with the same name should be interned to be the same Scheme object, rather than two separate instances that are equal.

Implement procedures for byte vector

The bytevector.go file is little more than a placeholder at this point. For R7RS need to implement the various byte vector methods described in section 6.9 of R7RS.

Support foreign function interface with Go

Eventually will need a means of invoking Go functions from within the Scheme language. Not sure how feasible this is since the Go linker eliminates any unused functions in the final executable. Nonetheless, should look into it.

Remove use of github.com/bmizerany/assert

Compared to gocheck, the github.com/bmizerany/assert package is feeble and poorly documented. Its use should be replaced with equivalent gocheck calls and subsequently removed as a dependency.

Implement hygienic macros

See section 4.3 of R7RS for a specification on hygienic macros. The Lispy.py code seems to support macros, so adding this feature to that milestone, but also needed for R7RS.

Consider the various SRFI implementations

There are numerous SRFI implementations available and they would make bakeneko richer and more useful. Most of the code is licensed under an open source license and is basically just Scheme, so should work out of the box.

Implement type predicates

Scheme defines predicates for determining the type of a Scheme object, which includes: boolean? bytevector? char? eof-object? null? number? pair? port? procedure? string? symbol? vector?

Testing output in interpreter unit tests

For testing the results of evaluation, can assign "stdout" in the global environment to a bytes.Buffer then read the contents of that to see what the s-expr yielded.

Tests written in Scheme using a Scheme test framework

See chibi-scheme: all of the tests are written in Scheme using a basic test framework which is itself written in Scheme. Hard for bootstrapping, but once the interpreter is sufficiently complete, this would be the ideal way to express the tests. The source code editor can properly match parentheses and syntax colorize the code, which is much better than editing the test code inside a quoted string.

Add an "Any" type to Scheme interpreter

This is a design issue with the Scheme interpreter, in that it is using Go's interface{} meta type everywhere. Really need to create a basic "anything" type that supports a small number of common operations for Scheme objects. Make Atom implement this new type. Then seek out all the occurrences of interface{} and determine if they would be better represented as Any.

Test chained (pair) append operations

The pair_test.go file does some basic testing of Pair.Append() but does not currently test chaining the calls to Append(). The parser code does this already, but still a good idea to explicitly test the API.

Convert the lispy.py test suite into Go unit tests

In order to assess the level of achievement in reaching the Lispy.py milestone, the Lispy.py test suite should be converted into a series of unit tests (presumably written in Go). This should provide a great deal of focus in achieving said milestone.

Support call/cc

Provide the call-with-current-continuation procedure, usually aliased to call/cc. This is specified in section 6.10 of R7RS, and a simple implementation can be found in lispy.py. This procedure is useful for implementing other interesting control structures (e.g. exceptions) and hence is highly regarded.

Remove PairIterator interface for performance

Based on Ewen's analysis of various Go iterator patterns, using an interface with an interator struct implementation is much slower than an iterator struct implementation without the corresponding iterator interface. That is, just remove PairIterator the interface and promote pairIterator the struct to "PairIterator".

Support dynamic-wind and before/after thunks

Along with call/cc, the dynamic-wind procedure and support for before/after thunks are a very useful feature for implementing interesting control structures in Scheme. See section 6.10 of R7RS for details.

core.lex() should return an error

Presently the lex() function is very optimistic, in that it only returns a channel of tokens. If an error is encountered (e.g. the text is not UTF-8 compliant), it can only return nil and no other indication of an error. Should have it return both the channel and an 'error'.

Add a LICENSE file

Seem to have forgotten to add the BSD license file at the root of the source tree. The standard license text will suffice.

Support primitive expression types for R7RS

See section 4.1 of R7RS for the set of primitive expressions that all Scheme R7RS compliant interpreters must support. This includes variable references, literal expressions (e.g. quote, '), procedure calls, procedure definitions (e.g. lambda), conditionals (if), assignments (set), and inclusion (include).

Compile to bytecode

All of the really cool Scheme interpreters compile the Scheme code to some form of bytecode to improve performance. Some even compile to native code, though that may be a bit far given my resources.

Use an efficient data structure for property lists

In the Scheme interpreter, need to replace the use of hash tables with something more appropriate to Scheme (i.e. space efficient for small numbers of properties), such as a left-leaning red-black tree. That's just one idea, there are many more in Steve Yegge's essay "The Universal Design Pattern" [1], such as linked lists that morph into hash tables when a threshold is crossed.

Additionally, this [2] came up on HackerNews recently.

[1] http://steve-yegge.blogspot.com/2008/10/universal-design-pattern.html
[2] http://www.soi.city.ac.uk/~ross/papers/FingerTree.pdf

Byte code (de)serialization

For sake of time, should save compiled byte code and reload rather than compiling the same source repeatedly.

Support `#() vector quasi-quoting

See section 4.2.8 of R7RS for a description of quasi-quotation. Add support for applying quasi-quotation to vectors via the `#() syntax.

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.