averycrespi / yolk Goto Github PK
View Code? Open in Web Editor NEWNumerical computing for Yolol
Home Page: https://yolk.crespi.dev
License: Apache License 2.0
Numerical computing for Yolol
Home Page: https://yolk.crespi.dev
License: Apache License 2.0
FoldExpr { op: InfixOp, args: Vec<Expr>
"sum"
or "product"
import a
b = a and (a and a)
produces b=a and a and a
, but should produce b=a and(a and a)
Use associativity instead of commutativity for bracket choices in formatter
Use failure crate
n
chipsx
Source:
define foo(a) = sum(a);
let n = foo(0);
export n;
Error:
thread 'main' panicked at 'undefined variable: a', src/bin/yolkc.rs:30:68
optimize
is idempotenttests/idempotence.rs
import a
let b = 1 + (2 + a)
export b
produces b=1+2+a
, but should produce b=3+a
.
Can add match case to optimizer. Need to handle both (2+a)
and (a+2)
, as well as all other commutative operations.
serde
yolk -i source.yolk -o out.yolol
examples
dirCargo.toml
parse
, transpile
, and optimize
Text -> YolkNode
YOLOL -> Yolol
In src/lib.rs
pub use parser::parse;
pub use transpiler::transpile;
pub us optimizer::optimize;
e.g. Disallow importa
ParseError
, TranspileError
, etc.Error
From
methodsAfter the newline change, semicolons are no longer required
YololNode::format_as_program
to_string
impls in ast.rs
yolol_ssa
?
YololNumber::from_str
Propagate source statements and expressions through into errors
Same format as YOLOL: // comment goes here
Index: get single elem
Slice: get array of elems
index_expr = { expr ~ "[" ~ NUM ~ "]" }
slice_expr = { expr ~ "[" ~ NUM ~ ":" ~ NUM ~ "]" }
YolkNode
-> YololNode
--debug
Replace TODOs
Return YolkError::BadParse
instead
Must use yolol_number::prelude::*;
import a
let b = 1 - (2-a)
export b
produces b=1-2-a
, but should produce b=1-2+a
, or at least b=1-(2-a)
See TODOs in ast.rs
to_string
for YololStmt
, YololExpr
to_string
internally calls format_stmt
, etc.Waiting for fix in yolol_number
YololNode
-> YololNode
Refocus Yolk on pipelined, parallel computation.
Yolk currently focuses on single-chip numerical computing. This proposal would allow Yolk to seamlessly spread its Yolol output over n
chips, making use of m
data fields as registers. A scheduler would be implemented to manage statement execution.
Build a DAG of variable dependencies. Yolk's SSA form ensures that the dependency graph is acyclic.
Linearize the DAG into stages. Statements within the same stage may be executed in any order.
Assign statements to chips. All statements in stage n
must execute before any statements in stage n+1
. The assignment algorithm will minimize the following criteria, in order:
Maximum number of lines on a single chip
Number of chips used
Number of register saves and loads
Add register saves and loads to share values between stages. Register positions have already been marked by the previous step.
Map stages to physical lines on chips. Some stages may take more than one physical line. Insert // Sync
comments on empty lines.
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.