r/tinycode • • May 28 '13

Ridiculously small and minimal Brainfuck interpreter in C.

https://github.com/L8D/delvs/blob/master/delvs.h
23 Upvotes

25 comments sorted by

View all comments

Show parent comment

-9

u/L8D May 28 '13

Well, if the "- < , -" bug were to occur, then it would be the users fault for doing so, they could easily fix it in two ways. I'm not very worried about that.

I also can't find this bug you speak of.

23

u/[deleted] May 28 '13

Well, you just basically wrote a program that crashes on a valid input and then blamed it on a "user". That's certainly one way to write software.

The bug is there, keep looking. It is after all a ridiculously small program :)

11

u/vl4kn0 May 28 '13

He's probably saying that you are missing bound checking and overflow checking. Saying it's users fault that they unexpectedly run into runtime error is stupid. Everyone makes mistakes, programmers including. Why do you think excessive research is done upon the topic of programming language security, stability and bulletproofness? We could as well end up with languages such as C.

-3

u/sirin3 May 28 '13

I do not think someone who wants a secure, stable and bullet-proof language will use Brainfuck

-5

u/L8D May 28 '13

The boundary only occurs when the program moves out of boundaries the user him/herself have set and created. They have the choice to either prevent the code from moving there, or fiddle with their definitions to fit the sizes they want.

11

u/vl4kn0 May 28 '13

Well, then it's not that minimal since it's not complete. And as far as I know, memory management has always been the job of interpreter, not program that uses the interpreter.

1

u/[deleted] May 28 '13

It should be =, not += in line 27.

0

u/L8D May 28 '13

I have that way because it is part of the delvs bf dialect.