Skip to content
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

[DRAFT] Make an interpreter for this abomination #74

Open
wants to merge 78 commits into
base: main
Choose a base branch
from

Conversation

Bytestorm5
Copy link

@Bytestorm5 Bytestorm5 commented Jun 5, 2023

putting this here so there's a thread for it, it's not nearly done but if anyone wants to mess with it there's something

the current plan is to write the compiler in python and from there rewrite it in C or Rust, whichever is funnier at the moment
or maybe I'll leave it as python that might be cursed enough, idk

For the time travel the way I'm thinking things should work is that execution follows a "cursor", regardless of what timeline that cursor is in. This allows for somewhat deterministic time travel which is pretty cool

Cool git stuff:
Resolves #14

@Bytestorm5
Copy link
Author

The idea with the whole Compinterpreter is to do things in the most convoluted way possible- I want to have it interpret some parts of the code and transpile other parts to another language (maybe multiple based on situation?). I'm kinda indecisive as to what language it should transpile to, I think Javascript is cursed enough to fit the bill but I'm not sure yet

tokenizer go in box
(🇦) ->📦 👍
Also strings can't have lines now
@TodePond
Copy link
Owner

TodePond commented Jun 5, 2023

Best of luck to you! Please be careful out there

@Bytestorm5
Copy link
Author

thanks, so far it hasn't been too crazy, though now that I'm getting to parsing it's gonna be interesting. Is it okay if I make a video on the whole process?
I figure it'd be pretty funny and may have some value in showing how to make tokenizers/parsers/etc. I know you have your own channel so I wanna make sure I'm not encroaching on anything you might have in the works

@MaxenceDC
Copy link

I'm curious to see how you're going to deal with that: AI

@TodePond
Copy link
Owner

TodePond commented Jun 5, 2023

@Bytestorm5 Of course! You should go for it, I'd love to see it :)

@labbo-lab
Copy link
Contributor

I'm glad my time travel implementation is actually going to (sorta) become real

For the time travel the way I'm thinking things should work is that execution follows a "cursor", regardless of what timeline that cursor is in. This allows for somewhat deterministic time travel which is pretty cool

src/compinterpret.py Outdated Show resolved Hide resolved
Universal Currency symbol courtesy of @MaxenceDC
@Bytestorm5
Copy link
Author

Bytestorm5 commented Jun 5, 2023

Just had a horrible idea inspired by #76 - we store const const const variables in a cloud database, making DreamBerd the first Always-Online Singleplayer language

@labbo-lab
Copy link
Contributor

we do a small quantity of trolling

const const const delete Date()!

@Bytestorm5
Copy link
Author

I have it so when the parser sees a sequence like: [attributes...] <name> = <unknown-identifier>! the unknown identifier is converted to a string

^, any unknown identifier is assumed to be a string

@Bytestorm5
Copy link
Author

Btw @8ightfold do you want to be added to the GC for this or do you wanna do your own fully separate thing?

@gabrielchl
Copy link

gabrielchl commented Jun 22, 2023

fyi all, i've created the following discussion thread to track all efforts to implement DreamBerd:
Tracking: current efforts to implement DreamBerd #183
hopefully that'll make it easier for newcomers to find them :)
(especially as there could be more implementations created in the coming weeks)

@8ightfold
Copy link

@Bytestorm5 I'm down to join the GC, assuming it's disc my tag is 8ightfold

@Bytestorm5
Copy link
Author

@Bytestorm5 I'm down to join the GC, assuming it's disc my tag is 8ightfold

Sent a friend req

@CoolCat467
Copy link

@Bytestorm5 Checking before make another PR to do it, would it be useful to add docstrings to everything?

@Bytestorm5
Copy link
Author

@Bytestorm5 Checking before make another PR to do it, would it be useful to add docstrings to everything?

I mean it never hurts but rn the code is rather nebulous and a lot of things are subject to change, so I'd hate for you to make detailed docs only for them to be obsolete the next day (obv exaggerating the timeframe)

@Bytestorm5
Copy link
Author

I only recently learned refactoring doesn't mean renaming a variable and having that change propagate through the whole project, I think it means splitting off parts of the project into different modules but I honestly have no clue rn

why do we need so many words anyway

@CoolCat467
Copy link

That is correct, refactoring is meant for attempting to fragment your code into different modules

@jonasbadstuebner
Copy link

It just came to my mind, that if you would waste enough time on this, until it actually works, you can scream reverse! and get all the time back, that you put in this thing...

Disclaimer

I don't actually think this is a waste of time. I would love to see this thing work.

@Bytestorm5
Copy link
Author

Bytestorm5 commented Jun 23, 2023

While true I wouldn't be able to go back to non-reversed time so I'd be sealing my fate to be turned back into an embryo in due time. It's always important to exercise time-safety when using reverse

Speaking of, I can at least safely recoup any time past this point:

var var recoup_flag<Infinity> = 0!
if (recoup_flag !== 0) {
    reverse!!
}
io recoup_time() => {
    recoup_flag = 1!!
    reverse!
}

@3top1a
Copy link

3top1a commented Aug 19, 2023

Kinda thinking of trying this as well in Rust

@3top1a
Copy link

3top1a commented Aug 23, 2023

Nevermind, gave up

@PThorpe92
Copy link

image

I see a meme here somewhere....

@3top1a
Copy link

3top1a commented Aug 23, 2023

I didn't even finish writing the parser and realized it's fucked.
Maybe given enough ChatGPT and tears, but I doubt it.

@PThorpe92
Copy link

Lol I would imagine that the parser would be the critical point of failure here...

@Eddio0141
Copy link

i'm gonna make my own dreamberd interpreter as an university project
ill see what will happen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement DreamBerd