extremlapin / fast_brainfuck.lua Goto Github PK
View Code? Open in Web Editor NEWHigh performance brainfuck transpiler/interpreter for Lua with FFI support. Very fast implementation with multiple optimization passes.
License: MIT License
High performance brainfuck transpiler/interpreter for Lua with FFI support. Very fast implementation with multiple optimization passes.
License: MIT License
After testing your transpiler i found a few limitations that you could remove:
Right now, it support for example :
while data[i] ~= 0 do
data[i] = data[i] - 1 (inc1)
i = i + 9 (jmp1)
data[i] = data[i] + 1 (inc2)
i = i - 9 (jmp2, unused)
end
To :
data[i+jmp1] = data[i+jmp1] + (-(data[i]/inc1))*inc2
data[i] = 0
while data[i] ~= 0 do
i = i - 1 (jmp1)
data[i] = data[i] + 3 (inc1)
i = i + 1 (jmp2)
data[i] = data[i] - 1 (inc2)
end
data[i+jmp1] = data[i+jmp1] = (-(data[i]/inc2))*inc1
data[i] = 0
jmp 1 = -jmp2
Would be nice to support :
while data[i] ~= 0 do
data[i] = data[i] - 1
i = i - 1 (jmp1)
data[i] = data[i] - 1
i = i - 4 (jmp3)
data[i] = data[i] + 1
i = i + 5 (jmp3)
end
jmp1 + jmp2 = -jmp3
Ran on OptimTease
chunk has too many syntax levels
In LuaJIT, each function has an instruction limit of 2^16 because of how the bytecode register works.
I could do a final IR scan and find isolated loops and throw it in an external local function
I saw it in the benchmarks and I have never heard of 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.