shoriwe / plasma Goto Github PK
View Code? Open in Web Editor NEWThread safe Go embeddable ruby like scripting language
Home Page: https://shoriwe.github.io/plasma/
License: BSD 2-Clause "Simplified" License
Thread safe Go embeddable ruby like scripting language
Home Page: https://shoriwe.github.io/plasma/
License: BSD 2-Clause "Simplified" License
This pass will return a new IR called AST2 that will be in charge of simplifying this AST1 nodes:
for
and until
to while
loopsunless
and switch
statements to if
statementunless
one liner to if
one linerreturn
and yield
multiple results to single result (expression on 1, and tuple on multiple)The readme should include:
The simplified VM will hide all the low level plasma operations to a simpler user friendly API:
Expected methods:
NewVM
: creates a new virtual machinevm.Execute
: executes the precompiled bytecodevm.ExecuteString
: compiles a program string and then executes its bytecodevm.Load
: Loads Go created objects to the VMCompile
: precompiles a plasma program to a bytecode sliceis
binary operator is used to check if the class that a value has is the same as the targeted one.
Internally it is equivalent to:
my_value.__class__() == MyClass
Compile the last IR to a byte array that can be passed to a virtual machine
Update documentation:
Features:
Delete statement is a special keyword that internally remove symbols in case a expression or selector is given, in case of index expression the special methods __del__
of the object is called
Is your feature request related to a problem? Please describe.
Create a new function that will let the end user reserve memory for arrays, tuples and hash maps.
Describe the solution you'd like
The new API should look like:
obj.__reserve__(size)
reserve(obj, size)
Returns a instance of self
as it was the targeted class
Is your feature request related to a problem? Please describe.
Map Struct function to Plasma Objects
Describe the solution you'd like
Using reflection, also scan for the functions of an struct an map them to the plasma object
Finally implement the yield generators
Remove complicate statements
redo
try-except
raise
String and Bytes:
join
split
upper
lower
count
index
Array:
append
clear
index
pop
insert
remove
Int and Float:
big_endian
little_endian
from_big
from_small
This pass will generate a new IR called AST3 in charge of transforming and simplifying most of AST2 nodes:
The syntax check pass will check that:
defer
, return
and yield
are only inside gen
and def
break
and continue
are only inside for
, until
, while
and do-while
defer
statement works similar to the Go defer
statement, calling a function at the end of other function body
ToValue/FromValue
DocumentationIs your feature request related to a problem? Please describe.
Stop the usage of the magic method __len__
by creating a wrapper that also could call low level function to return the length of the underlying object.
Describe the solution you'd like
The API of this new len
function will be:
len(obj) # returns an integer with the length of the underlying object
Is your feature request related to a problem? Please describe.
Add a new function for arrays, tuples and hash called cap
which calls the underlying slice or map cap
Describe the solution you'd like
This should create two new functions, one internally and the other externally to objects.
obj.__cap__()
cap(obj)
This could be made by applying some kind of facade structure on top of the module to easy the work pipe
Implements binary operator returns true if the class of value is a target class or if any of its bases is or implements the class
Lowercase all the standard library and magic methods to be consistent and mnemotechnic friendly
A thread safe virtual machine can be shared in a program without the use of mutexes or any sync operation.
Characteristics:
Is your feature request related to a problem? Please describe.
Plasma right now only supports positive indexing of value inside arrays, negative indexing should work the same as described by python
my_array = [0, 1, 2, 3]
my_array[-1] # Should return 3
Describe the solution you'd like
Add a condition in array/tuple index function to transform negative indexes to positive indexes
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.