none-None1 / BFFuck

Makes brainfucking easier
https://esolangs.org/wiki/BFFuck
Creative Commons Zero v1.0 Universal
3 stars 1 forks source link

Memory management #2

Closed kalDima1218 closed 8 months ago

kalDima1218 commented 9 months ago

Hi, I was thinking about memory management, like C++: arrays, pointers (which I think is naturally necessary when working with arrays). It seems to me that this will greatly expand the possibilities of writing complex algorithms. But i haven't any idea how to store and dereference it. I have idea something like hash table (you reserving some space at the beginning of the memory and making it 2x more if it is necessary with shifting all data), but i think it is overkill. What do you think?

none-None1 commented 9 months ago

Yes, you're right. But the largest problem is: BFFuck integers are only bytes, that means only the first 256 addresses can be accessed by addresses. Also, the code is getting messier, making it harder to add new features.

kalDima1218 commented 9 months ago

I was thinking about wide integers (simply you use 4 cells instead of 1) but not obvious how to do it (+-1 will be much harder to implement). Also, do you have any idea about recursion? I think it will let to write complex algorithms (like fft or some divide and conquer)

none-None1 commented 9 months ago

On esolang, there seems to be a method to deal with wide integers. But recursion may be difficult, as BFFuck doesn't support jumps.

none-None1 commented 9 months ago

I'm planning this for the future

none-None1 commented 8 months ago

Thanks for your advice, I've implemented wide integers and pointers!