antarestrader / sapphire Goto Github PK
View Code? Open in Web Editor NEWThe Sapphire Programming Language [WIP]
License: GNU General Public License v3.0
The Sapphire Programming Language [WIP]
License: GNU General Public License v3.0
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.
We need to move the basic operators out of the top level scope and into the integer and Float classed.
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.
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.
Turn simple and complex string expressions into string values
In Main, command line arguments should be enabled to:
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.
Create Array and Hash Values and evaluate the expressions from the parser to these values
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.
Haddock documentation for AST.hs including Exp and LHS
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.
If an error is thrown in a thread that is not in main interpreter (for the REPL) that error kills the thread, (maybe) but never gets back to anyplace that can do anything about it. There needs to be some engineering decisions about what it means when a process that the user is not directly interacting with raises an error.
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.
The super
method should run the method that would have run if the current method did not exist.
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.
These keywords can appear at the end of a statement to modify whether it is run or how many times it is run.
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.
Take a token stream for strings from the lexer and create an expression that will evaluate into a string value.
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.
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.
The lexer need to understand single and double quotes, look in double quoted strings for #{
and corisponging }
, instances and understand \
escaped strings in both.
Define is recognized by the lexer as a keyword and is implemented in eval but a define statement is not parsed.
Strings currently lack any interpenetration either for escaped characters or for more complex structures in double quoted strings.
example {a: 5, b:7}
Object needs significant documentation
Create the built-in classes for Array and Hash Values.
the (greater|less)-than-or-equal operators (<=,>=) need to be specially exempted from the generalized assignment operators (along with == and ===).
base.sap is filling up with code it is time to have an include type syntax (even a hacky one) so that this file can be broken up into smaller more manageable pieces.
The self.included function is called when the module is included. It allows methods to be executed in the context of the base (where the module is included).
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.
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
need to move into helper functionslex [
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}
.
Primitive values need to attache to classes so that for example 1.to_s
will call the to_s method of the Integer class.
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.
classes for true
and false
to be implimented. This blocks #40.
A blank line in a file causes the parser to crash with a missing record selector error.
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:
mkFunction
function in Eval correctly apply actual parameters to formal parameters.The Symbol value type does not have an assigned class so cannot be displayed in the REPL
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.
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.
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.
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.
All expressions for Array and Hash literals and parse them from the token stream
Develop the syntax for string here docs for both literal & interpreted strings
If a function cannot be found (for example you made a typo) instead of returning a error the program hangs in an infinite loop
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.