-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
idea: brainfuck target #34
Comments
That's a great idea, I like it! The easiest way to get this in is to wait until after #33 has been merged. |
Now that #33 has been merged, do you fancy taking a stab at implementing a brainfuck backend? |
I probably want to get this into the v1.2 release sometime before Christmas. |
(didn't I already reply to this?) I thought about at it but found it a bit problematic. It either has 32000 registers or none, depending on how you look at it. And assignments, well, no idea how to do that. |
Brainfuck has assignments? |
No, that's the point.
…On Fri, Sep 16, 2022 at 7:57 AM omarandlorraine ***@***.***> wrote:
Brainfuck has assignments?
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUN5IW6GJUANNE5GKAGHNEDV6QD4LANCNFSM56TDYTAA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
describing a virtual machine that runs brainfuck and how it could be added to stropSo currently we've got a type for each of the machines we have, and a type for each of the instruction sets we have.
Now
In the same way as how the 6502 or something has 65536 bytes of memory. The 6502 backend has a
Brainfuck has no assignments, only increment and decrement, exactly equivalent to the 6502's So roughly, a brainfuck program can be more or less transcribed to 6502 in the following way:
I feel that the first four at least have obvious counterparts and are nearly just a case of copy pasting code from the 6502 backend.
of these, I think that
I hope some of this helps, feel free to implement just what you can/want. If you like. |
Hi,
I have been thinking about how to do so, but I can't get my head around it.
Brainfuck has memory (or 32000 registers depending on how you look at it)
but I can't think of a way to do an assignment from one register to another.
…On Wed, Sep 7, 2022 at 10:15 AM omarandlorraine ***@***.***> wrote:
Now that #33 <#33> has been
merged, do you fancy taking a stab at implementing a brainfuck backend?
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUN5IW4AYMUAZH75D5CMQIDV5BFJBANCNFSM56TDYTAA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
It's not an issue because you tell strop which instructions the architecture does have. Strop figures the rest out. Issue #42 is going to introduce another lot of big changes, among which are the fact I'm going to start using much more third party crates. It pulls in loads of external crates for generating instructions, emulating them, etc. etc. But the other big change is that the codebase will (hopefully!) be much easier to understand for newcomers. I'm looking on crates.io for brainfuck emulators, and there are more than a few to choose from. Do you know which one to pick? In particular, we need one that will behave well for malformed programs like |
brainfuck is a minimalistic programming language. Tons of interpreters, compilers and transpilers have been implemented for it.
The text was updated successfully, but these errors were encountered: