TodePond / DreamBerd

perfect programming language
https://dreamberd.computer
Other
11.46k stars 365 forks source link

Need clarification #737

Open samuel-thesing opened 2 months ago

samuel-thesing commented 2 months ago

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?
      1. 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?
  2. 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?

  3. 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.

TodePond commented 2 months ago

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.

    1. 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"!
       print(1+1)!            // 2 or 3?
       const const 1+1<-1>=3! // is this even a variable with lifetime?

    3

    1. 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? (1+2)/(3(1+1))

    2. 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.