Giter VIP home page Giter VIP logo

fallstop / bf-in-rosetta Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 32.15 MB

Brainfuck interpreter in every launguge. Beacuse yes. In devlopment.

License: MIT License

Rust 12.94% Makefile 0.41% Python 2.73% Shell 0.49% CMake 0.18% Brainfuck 40.60% C++ 4.04% Java 3.68% C# 6.76% Go 3.10% TypeScript 3.20% R 1.84% Ruby 2.64% Kotlin 0.09% Swift 0.28% Objective-C 0.03% Dart 7.94% MATLAB 1.58% Haskell 3.51% C 3.93%
brainfuck-interpreter rosetta why-not

bf-in-rosetta's People

Contributors

fallstop avatar laspruca avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

cyberflamego

bf-in-rosetta's Issues

Disappointing performance from rust interpreter.

The below BF code is generally pretty optimisable, but the example runs in your interpreter in 12seconds.

Others are: a first attempt interpreter at 20s, simple loop linking at 10s, a more complex no-lookahead interpreter at 5s, a primitive JIT at 2s. The more heavily optimising interpreters (Even without JIT!) are subsecond.

>+>++>+>+<[>[-<+++++>]<<]>[->+>+<<]>[->[->+>+>
+<<<]>>>[-<<<+>>>]<<[->[->+>+>+<<<]>>>[-<<<+>>
>]<<[->[-]<[->+>+<<]>>[-<<+>>]<<]<<]>[-]<<<]>[
-]<++++++++[<++++++++++>-]<-.----.<++++++++++.
$ target/release/rust-bf -oa -c EasyOpt.b
Compressing bf code...
Pre-matching braces...
Running bf code
Output: OK

BF execution done
Time taken: 12.10692s
$ time trixy -microbf EasyOpt.b
OK

real    0m19.639s
user    0m19.632s
sys     0m0.004s
$ time trixy -minibf EasyOpt.b
OK

real    0m9.661s
user    0m9.656s
sys     0m0.000s
$ time deadbeef EasyOpt.b
OK

real    0m5.545s
user    0m5.540s
sys     0m0.000s
$ time gcc-jit EasyOpt.b
OK

real    0m2.128s
user    0m2.124s
sys     0m0.000s
$ time bfi -b128 -r EasyOpt.b
OK

real    0m0.063s
user    0m0.060s
sys     0m0.000s
$ profilebf EasyOpt.b
OK
Program size 184
Final tape contents:
 : 10 75  0  0  0  0  0  0  0
    ^
Tape pointer maximum 8, cell value range 0..161
Skipped loops (zero on '['): 51842
Counts:     +: 1018384868   -: 1018384783   >: 1373269843   <: 1373269843
Counts:     [: 12598258     ]: 1018384781   .: 3            ,: 0
Total:         5814292379   run: 0.453s
$ 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.