52 votes
Accepted

Charmander Brainfuck interpreter in Haskell

Congratulations on your first large project. I'm not sure whether this review has grown a little bit overboard, as it is now both a review as well as a mini tutorial. Either way: What the ...
user avatar
  • 18.8k
47 votes

Brainfuck interpreter written in C

This is a pretty reasonable start on a simple interpreter. Edward's suggestions are all good; a few additional suggestions: interpret("+++++++++++++[->.... ...
user avatar
  • 14.6k
45 votes
Accepted

Brainfuck Interpreter written in x86 Assembly

The comment ; *argv should be ; argv, since you are not yet dereferencing the pointer. After a ...
user avatar
27 votes

Brainfuck interpreter written in C

Here are some things that may help you improve your program. In all, it seems to be nice, straightforward code that does what it needs to do. Good start! Use only required ...
user avatar
  • 64.4k
17 votes
Accepted

TI-BASIC interpreter for Fishstacks

I was asked by @Timtech to join + post an improvement. Using arrays is a lot easier to understand, and there were so many optimizations that I decided to completely re-write the code. I'm sure it ...
user avatar
16 votes
Accepted

Interactive Brainfuck interpreter in Haskell

Good job on getting it to work! I've used a string reversal program to check your interpreter and it works well. However, it also uses ~36MB of memory, which is too much. A tape goes both directions ...
user avatar
  • 18.8k
15 votes
Accepted

Brainfuck Interpreter in Java

Move the memory into it's own class. The concept of the tape which the BF program is operating can be cleanly made its own class with a limited interface. Make private or eliminate interface cruft: ...
user avatar
14 votes

TI-BASIC interpreter for Fishstacks

Beyond the bad names that you are already aware of, I see a few things that could be improved. str1 and str2 are bad variable ...
user avatar
  • 30.7k
14 votes
Accepted

Reference Implementation for Honey Badger programming language

Obviously, if you have any questions just ask. This is my first "big" project in OCaml, but I'd rather you didn't sugarcoat criticism. It looks like a very fun project, congratulations! :) I have a ...
user avatar
13 votes

Four-function expression evaluator

Loki Astari already covered a number of good points, which I will not repeat. Algorithms and data structures The standard library contains a number of ready-made algorithms and data structures that ...
user avatar
  • 1,318
12 votes
Accepted

Four-function expression evaluator

Common beginner mistakes Stop doing this: using namespace std; See Why is “using namespace std;” considered bad practice? Namespaces All your functions seem ...
user avatar
  • 91.7k
12 votes
Accepted

Brainfuck on-the-fly interpreter in C++

Looks great! Just a few (small) suggestions: Style It really is quite readable and straightforward, but breaking out a few functions certainly wouldn't hurt. Even though you're not using ...
user avatar
  • 10.5k
12 votes
Accepted

Brainf*** Interpreter in C

This looks really good over all. I have pretty much no knowledege of brainfuck, but it was still easy to understand the code, and nothing jumps out at me as glaringly wrong. There are however a few (...
user avatar
  • 10.5k
11 votes
Accepted

JediScript - May the 4th be with you

Why do you allow each cell of the tape to hold numbers from -1 to 128? seems like an odd range. in move_backward() why do you allow the tape to reach position -1? ...
user avatar
  • 8,402
10 votes
Accepted

Brainfuck interpreter in Haskell

Use case instead of == and guards everywhere: ...
user avatar
  • 1,052
9 votes
Accepted

NotBF - A Brainfuck-ish like "language"

As the classic "Stop Writing Classes" puts it: the signature of "this shouldn't be a class" is that it has two methods, one of which is __init__ Virtually all ...
user avatar
  • 13.8k
9 votes

Rust Brainfuck interpreter

Profile You can only improve what you can measure. So first of all let us run callgrind to check where we spent most of our time: ...
user avatar
  • 18.8k
9 votes
Accepted

Brainfuck interpreter (with emphasis on robustness)

Deficiencies? I don't really see any. Improvements? Maybe :) You don't handle at all the return values of putchar, getchar and <...
user avatar
  • 19.9k
9 votes
Accepted

Basic Brainfuck Interpreter in C

Use NULL for null pointers NULL conveys your intention to use a pointer better than 0: <...
user avatar
8 votes
Accepted

Basic BrainFuck interpreter

This being Python, it should be relatively easy to present the illusion of an infinite tape, at least in the positive direction. I don't see reason that cell_amount...
user avatar
8 votes
Accepted

Random "programming language"

It looks like all your tests follow the pattern if s_command[0] == "$xxxxx" and s_command[1] == "yyyyy": So what you can do is create a tuple of the first two ...
user avatar
  • 2,026
8 votes

Brainfuck Interpreter in Java

Usability How the f.[< do I use this interpreter when it doesn't come with a main() function? Here's the simplest implementation I came up with, using ...
user avatar
8 votes

"Nothing" interpreter/compiler

This line here: return EXIT_SUCCESS Is equivalent to this: return 0; Which is automatically inserted by the compiler if it ...
user avatar
8 votes
Accepted

BF#: Round 2 (Fight!)

...
user avatar
8 votes
Accepted

Read stdin like a dictator

I really don't like that you detect which version of _GetchX to use via an ImportError - that isn't obvious to me at all. I ...
user avatar
  • 7,673
8 votes

Basic Brainfuck Interpreter in C

Bugs Your program doesn't work with nested loops. If you have ...
user avatar
  • 18.8k
8 votes

Lisp Interpreter written in JavaScript

Expectations Lisp is well-known for it's REPL, so I'd expect to see at least the following 3 functions in any Lisp interpreter: read, ...
user avatar
8 votes
Accepted

BrainF**k interpreter in python

All of your if char == '>': ptr += 1 and similar checks should use elif after the first check. By using ...
user avatar
8 votes
Accepted

Brainfuck interpreter in C++ with namespaces

...
user avatar
  • 19.1k
7 votes

Abstract syntax tree for simple Lisp-like interpreter

[DebuggerDisplay("[Number: Value={Value}]")] I have a new favorite attribute :) First time I encounter C# code using a ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible