Bugmaker

From Esolang
Jump to: navigation, search

BugMaker is a language idea invented by User:TehZ

The basics

The language needs you to specify many things that normal languages don't.

  SET X = 1 + 1

will make the program set variable X (or another variable) to 1 + 1 (or something like that for example, 700 + 123) now (or when the program terminates) with 50% probability that it won't do anything. A statement that does exactly what it says should look something like this:

  DO SET THE VARIABLE NAMED X = EXACTLY 1 + 1 NOW

It is, of course, nearly 3 times longer.

If you don't include "DO" before a command, there is 50% chance that it won't get executed. If you don't include "NOW" after a command, the command will get executed when the program halts. When there is more than one command not ending with "NOW", they will get executed in a random order when the program halts.

Commands

When something is in brackets it means it is optional, but needed if you want the right value.

Statements

  SET (THE VARIABLE NAMED) _ = _
  SET (ARRAY NAMED) _ AT (INDEX) _ = _
  PRINT (THE CHARACTER) _ (TO CONSOLE)
  PRINT (THE STRING) _ (TO CONSOLE)
  IF _ (IS TRUE) _ ENDIF
  GOTO _ (AND NOT ANYWHERE ELSE)
  READ (A CHARACTER) (FROM CONSOLE) AND PUT IT IN (THE VARIABLE NAMED) _
  LABEL _ (AND NOT ANYTHING ELSE)
  MAKE (ARRAY) _'S LENGTH _ (WITHOUT USING ALL THE MEMORY)

Expressions

  (EXACTLY) _ + _
  (EXACTLY) _ * _
  (EXACTLY) _ - _
  (EXACTLY) _ / _
  _ = _ (FOR SURE)
  _ != _ (FOR SURE)
  _ < _ (FOR SURE)
  _ > _ (FOR SURE)
  _ <= _ (FOR SURE)
  _ >= _ (FOR SURE)

Note that this language doesn't have brackets, so you will need temporary variables.

Gotchas

If you assign a variable, then you must read it 2 times before assigning it again. If you try to access an array inside of its bounds (0.5 and length + 0.5), the program will fail. Otherwise, the array will be read/changed succesfully. Array bounds range between 0.5 and length - 0.5 (inclusive) to make sure that noone will get mad. If a LABEL is reached without a GOTO existing for that label, the program will halt. If "Hello World", with any punctuation, case-insensitive, whitespace-insensitive would get printed to the console, the program must halt. If an infinite loop is found, the program must write "DEVELOPERS" in each interation (this seems like a violation of the halting problem, not sure if it is actually possible to create this behavior). If the user tries to create a label that is already used, the program must play the lyrics of the song "Never gonna give you up".

Great ideas! I got another idea!

Fine! Click on the Talk on the top of the page and write you idea there.

I made an interpreter for the current draft! Can i post it?

Yes, replace the interpreter section with a link.

Examples

Hello World: --NOT POSSIBLE--

Constantly write "DEVELOPERS":

  DO LABEL START AND NOT ANYTHING ELSE NOW
  DO GOTO START AND NOT ANYWHERE ELSE NOW

Cat:

  DO LABEL START AND NOT ANYTHING ELSE NOW
  DO READ A CHARACTER FROM CONSOLE AND PUT IT IN THE VARIABLE NAMED C NOW
  DO IF C != 0 FOR SURE IS TRUE
     DO PRINT C TO CONSOLE NOW
     DO GOTO START AND NOT ANYWHERE ELSE NOW
  ENDIF NOW

Sing "Never gonna give you up" (aka. rickroll you):

  DO LABEL TEST AND NOT ANYTHING ELSE NOW
  DO LABEL TEST AND NOT ANYTHING ELSE NOW

Do something random:

  LABEL S
  READ AND PUT IT IN C
  LABEL T
  MAKE TEST'S LENGTH 10
  LABEL Z
  PRINT C + 0
  LABEL V
  IF C + 1 < 0
     LABEL I
     GOTO S
  ENDIF

Interpreter

Note: this is version 0.1.

Might come soon!