News for hackers. Stuff that matters.
Re:Brainfuck Enterprise Solutions by paulmooreparks on Monday September 23, 2024 @11:07AM (#41626978)
You could use my (rather silly) extension called "pbrain," which adds procedures to brainfuck.

https://parkscomputing.com/page/pbrain

In hindsight, I think it's aptly named.

(EDIT: Gosh, I really need to update the .NET compiler to .NET 8.)

Re:Brainfuck Enterprise Solutions by rep_lodsb on Tuesday September 24, 2024 @06:29AM (#41635074)
That's an interesting addition to the language, since the numeric "labels" are effectively pointers that can be changed anywhere in the program! Though from reading the interpreter code, it seems like it doesn't handle "nested" procedures that can (re)define other procedures or themselves, which could make this a lot more powerful.

Never done enough BF programming to come up with a good example, but I'm thinking about something like this:

    ( (<-)<+ )
On the first call it increments it argument, then decrements on subsequent calls. There could also be a loop that switches a procedure between one of several definitions, which could be used to implement a state machine.