Coder Social home page Coder Social logo

sapphire's People

Contributors

antarestrader avatar

Stargazers

 avatar

Watchers

 avatar  avatar

sapphire's Issues

Boot sequence broken

The boot sequence for the run-time system is still using the MVar code. It need to be updated to use the STM Continuation model.

Tail Calls for Blocks

When evaluation a Block (or any other set of statements like a function) if the last function results in a function being called, then the current Continuation should be passed to it rather then spawning a new one. This will implement proper tail recursion.

Parser Cleanup

  • The parser code need to be broken up into manageable chunks.
  • Public parser methods and significant private parsers need documentation
  • Write an export selection list and perhaps write some function that take fewer args
  • Either document the User State or remove it if it is no longer used

Undefined Responder in Context.hs

To solve a cyclic dependency, the Responder argument was changed to undefined in Context.hs (near line 22) This need to be fixed.

This bug brings up a deeper problem of whether self c is always the right Object to use for the shadowed queue. If self is a sub-object then it it's parent's queue will block and not be reachable.

Evaluate Strings

Turn simple and complex string expressions into string values

Command line arguments in executable

In Main, command line arguments should be enabled to:

  • read and interpret a file
  • check syntax (lex and parse all code but don't run)
  • compile an executable (someday, for now at least leave room for the possibility)

Possible to define function with malformed parameter lists

No formal parameter of an optional type may be followed by a required parameter; No variable length parameter may be followed by any other parameter. These rules are assumed when assigning actual arguments to formal parameters, but noting currently enforces conformity with these rules. Functions which do not conform to these rules exhibit strange and undefined behavior, but do not raise any errors.

An effort should be made (either during parsing or evaluation) to check that these rules are followed and raise a meaningful error when they are violated.

Catch errors in blocks

Various constructs should be able to recover from run-time errors by catching exceptions.

Thought needs to be given as to what asynchronous exceptions behave like.

Document AST

Haddock documentation for AST.hs including Exp and LHS

Error Class

Create a new set of classes representing run time errors and modify the error code to accept such objects when an error is raised rather then a String.

Embedded objects not updated to proper state after method call.

When evaluating the Call expression. there is no way to put the target object back if it has been modified. some how there need to be a way to track if the Object need to be put back into self and how to do that appropriately.

My thought is that we may need an optional field in the VObject value; a function which takes self and the modified sub-Object and returns a modified self.

Implement super method

The super method should run the method that would have run if the current method did not exist.

Document Boot

Create Haddock Documentation for Boot.hs. Functions should describe what they do, whether they have side effects, and where in the class structure they go.

Multi-line statements

The parser needs to handle the idea that an statement may extend across multiple lines.

I think the easiest way to do this would be to have the expression parser take a bool to tell it if looking for a sub expression in the following block is in order. Or perhaps a differenc parser that will look for sub expressions in the following block.

Parse Strings

Take a token stream for strings from the lexer and create an expression that will evaluate into a string value.

Impliment import and extend

Now that modules are working (see issue #5) include for classes and extend for objects need to be added to the bootstrap set so that modules can actually hooked into objects/classes.

Graph search needs code cleanup

The Object Graph search code is a mess. It lives in two different places and the naming conventions and type signatures look like they were developed using a random number generator. All graph search function need to be moved to Object.Graph. They need to be reduced in number and made fit for use in code.

This work should help to close Issue #12.

Lex strings

The lexer need to understand single and double quotes, look in double quoted strings for #{ and corisponging }, instances and understand \ escaped strings in both.

Proper Tail Calls

This issue subsumes #6.

A branch has been started to add the additional infrastructure needed to make proper tail calls. Changes needed include a new eval function that can be used without needing to return a value (evalT), Context and Continuation methods to determine if a return statement has already filled the return value, and use of these functions in the code.

We should check to see if the existence of evalT would let us clean up the Graph search code for classes.

Write `getMethod` in Object/Graph.hs

The old getMethod function was based on MVars. It was replaced with undefined while awaiting the completion of the Continuations. It need to be rewritten

Eval code cleanup

  • Documentation needed
  • Long bodies in eval need to move into helper functions
  • More internal documentation needed

lex literal syntax for Array and hash

lex [ and { along with their closing matches

lex the aarow operator -> as a reserved operator

determine whether : is lexed correctly to allow for {foo:bar} to be desugared to {:foo -> bar}.

Classes for primitive values

Primitive values need to attache to classes so that for example 1.to_s will call the to_s method of the Integer class.

Logical and compairson operators needed

To write interesting code, we need to be able to compare numbers and combined Boolean values. much Sapphire code now waiting to be implemented is hanging on these operators.

Varargs to be implimented

Def, Define and Lambda in Exp all have a [String] representation for the formal parameters list at present. This list needs to be made more intelligent to handle varargs and default parameters.

This will require:

  • update the lexer to understand the appropriate symbols
  • update the parser to parse a formal parameter list rather then just a list of strings
  • create a parameter data type that can hold not only the name, but default values and varargs
  • have the mkFunction function in Eval correctly apply actual parameters to formal parameters.
  • mkFunction need to return the appropriate arity for the function it has made along with the function.

Parser needs unary operators

a number proceeded by a minus sign (eg -5) is parsed as [TOpperator "-"][TInt 5] which the parser rejects because to the extraneous operator.
Either the lexer or the parser need to recognize this as the form of a negative number literal.

Scoped variables not returning not found error

When a scoped expression is not found it seems to return the last found article rather then a not found error.

For example Object::xxx will return Object rather then a not found error.

Scanner needs to fail gracefully

If the scanner fails to scan a certain lexem it's only option is to crash the program with an error message. In some way the scanner needs to work in an Error monad and return a failure message when things go wrong. This is particularly critical because blocks are no longer all scanned at once.

Context needs more information

When a sub-object of a process becomes self, it is not the sub-object (which cannot be shared without promoting it to its own process) that needs to have its message queue shadowed, but the original self and it's message queue.

Context needs to keep track of both the object and the responder necessary to shadow the message queue on a blocking function call.

missing function causes hang

If a function cannot be found (for example you made a typo) instead of returning a error the program hangs in an infinite loop

multiple calls do not record mutations

When a call is made on another call node and that call changes the receiver the changes do not persist past the end of the method call's execution.

Example:

a = [1,2,3]
a.push!(4).push!(5) #==> [1,2,3,4,5]
puts a
>>> [1,2,3,4] # the last push did not persist 

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.