martindevans / yolol Goto Github PK
View Code? Open in Web Editor NEWEmulator for the YOLOL Language
License: MIT License
Emulator for the YOLOL Language
License: MIT License
Set up CI with a free service. See a list of free CI services here.
Bugs happen, especially in a complex optimisation pipeline like this. To help catch bugs develop a very basic "fuzzer" which will simply run a given Yolol program ~100 times (in parallel?) with a totally random input generated every time the program tries to read an external. Set the fuzzer to run at the start and end of the optimisation pipeline, if it detects a divergence in program results return the unmodified program and report an error.
An obvious extension to this is to take a set of type hints, so the fuzzer only generates externals of the correct type.
At the moment the CFG pass will generate a graph like this:
Division has generated a Runtime Error
edge exiting the block (because division by zero is a runtime error). However in this case it can be proven that this divison does not error quite trivially, it's a divide by a constant (-2) which is not zero!
Add a CFG optimisation pass which detects divides by things that can be considered constant and remove the error edge if it can be proven not to error.
Every single optimisation pass needs tests covering:
If possible:
AST equality allows you to test where two syntax trees are the same with:
var a = TestExecutor.Parse("program");
var b = TestExecutor.Parse("program");
Assert.isTrue(a.Equals(b));
This needs testing for every ast sub type.
So i'm not sure what is causing this but it's reprinting a line when instead it should be going to the next step after the condition was met.
My code is:
count = 0
if count < 3 then count++ goto 2 else goto 6 end
string = "hello world"
So it doesn't actually run that line again because the condition is met, it reprints it, then the next step it runs the rest of the code.
When I try to run "YololEmulator.exe" from the 2.0 release I get this message:
Error: An assembly specified in the application dependencies manifest (YololEmulator.deps.json) was not found: package: 'CommandLineParser', version: '2.5.0' path: 'lib/netstandard2.0/CommandLine.dll'
Build a CFG analysis pass that builds a set of VariableName
which are known to be booleans (the result of any logical comparison).
This will need to run after SSA has been applied.
There is currently a fuzzer implemented (QuickFuzz
) but it's a very quick-n-dirty implementation that isn't well tested and seems to have some issues. There's a lot of potential here for multiple projects:
would it be possible to have an option to pass more than one .lol file to be run? execution happens in the order of .lol file args passed, you can adjust the :vars from each of the files as they are called upon but all the files can share the same :vars. this way people can simulate multiple chips running parallel or see how systems of chips would work together.
just a suggestion.
There is a BaseBinaryExpression class which is the base of all binary expressions (e.g. Add, Multiply, Or, EqualTo etc). This class handles common things such as the left and Right subtrees. A similar BaseUnaryExpression
could be written which handles the single Child
expression.
Implement this, and base everything in this folder on it.
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.