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

Need clarification #737

Open
samuel-thesing opened this issue Sep 4, 2024 · 1 comment
Open

Need clarification #737

samuel-thesing opened this issue Sep 4, 2024 · 1 comment

Comments

@samuel-thesing
Copy link

samuel-thesing commented Sep 4, 2024

I'm currently starting to write a DreamBerd Interpreter for possible use in an academic paper.
However, I have a few questions and observations that need to be answered and confirmed before i can make a complete interpreter.
If even 1 of these observations is wrong, it could break everything.

  1. Lifetimes:
    • The examples only show lifetimes on variables that are const const
    • const const const just wouldn't make sense with lifetimes
    • negative time lifetimes are also not shown and would break a lot
    • negative infinity lifetimes would definitely break about everything
    • what to do when a time travel paradox occurs that just cannot be solved. Throw an error? Split into separate timelines?
  2. Keyword as variable name:
    • what if some does const const const = = 1? Is = just broken for everyone?
    • Is 1-1 a valid variable name?
      -> what if i want to assign a variable called a<-2> where <-2> is part of the name and not a lifetime
      -> what about 1=1?
      -> what would happen to file separators if = was used as a variable?
    print(1+1)!            // 2 or 3?
    const const 1+1<-1>=3! // is this even a variable with lifetime?
  3. Significant whitespace:
    print(1+2  /  3 * 1+1)
    Note the two spaces on each side of the /.
    (Would 3 * 2 be calculated first because there is more whitespace around the /?
    Would this result in 0.5 or 2?
    What if someone puts a space before but none after an operator? Would you take the min, max or something else entirely?
  4. Does nothing except functions span a scope?
    Does a when span a scope?
    "if" is used in one of the first examples but never again? Is it part of the language and does it span a scope?

Does the interpreter have to find a way to interpret the code so that it doesn't crash no matter how absurd it is?
Several types of time travel and AI would have to be considered.

@samuel-thesing samuel-thesing changed the title Is it a variable? Need clarification Sep 4, 2024
@TodePond
Copy link
Owner

TodePond commented Sep 5, 2024

my answers in CAPS.

I'm currently starting to write a DreamBerd Interpreter for possible use in an academic paper. However, I have a few questions and observations that need to be answered and confirmed before i can make a complete interpreter. If even 1 of these observations is wrong, it could break everything.

1. Lifetimes:
   
   * The examples only show lifetimes on variables that are const const

IT CAN BE USED WITH ANY THOUGH.

   * const const const just wouldn't make sense with lifetimes

IT DOES MAKE SENSE.

   * negative time lifetimes are also not shown and would break a lot

THEY ARE SHOWN, AND IT DOESN'T BREAK IT.

   * negative infinity lifetimes would definitely break about everything

NO IT DOESN'T. IT'S JUST LIKE A HOIST.

   * what to do when a time travel paradox occurs that just cannot be solved. Throw an error? Split into separate timelines?

THERE ARE NO PARADOXES. SHOW ME AN EXAMPLE IF YOU THINK YOU FOUND ONE.

2. Keyword as variable name:
   
   * what if some does `const const const = = 1`? Is = just broken for everyone?

YES

   * Is 1-1 a valid variable name?

YES

     -> what if i want to assign a variable called a<-2> where <-2> is part of the name and not a lifetime

const const a\<-2> = "foo"!

     -> what about 1=1?

const const 1=1 = "foo"!

     -> what would happen to file separators if = was used as a variable?

NOTHING

const const = = "foo"!
=====
const const bar = "baz"!
   ```java
   print(1+1)!            // 2 or 3?
   const const 1+1<-1>=3! // is this even a variable with lifetime?
   ```

3

3. Significant whitespace:
   ```java
   print(1+2  /  3 * 1+1)
   ```
   Note the two spaces on each side of the /.
   (Would 3 * 2 be calculated first because there is more whitespace around the /?
   Would this result in 0.5 or 2?
   What if someone puts a space before but none after an operator? Would you take the min, max or something else entirely?

(1+2)/(3*(1+1))

4. Does nothing except functions span a scope?
   Does a when span a scope?
   "if" is used in one of the first examples but never again? Is it part of the language and does it span a scope?

IF IS PART OF THE LANGUAGE.
WHEN AND IF AND FUNCTIONS HAVE THEIR OWN SCOPE

Does the interpreter have to find a way to interpret the code so that it doesn't crash no matter how absurd it is?
YES
Several types of time travel and AI would have to be considered.
YES.
AS AN EMERGENCY, THE WHOLE PROGRAM COULD BE INTERPRETED AS A STRING, BUT THE SHORTEST POSSIBLE STRING WOULD ALWAYS BE CREATED, WHILE ALSO KEEPING THE PROGRAM VALID.

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

No branches or pull requests

2 participants