User:Emerald/sandbox

From Esolang
Jump to navigation Jump to search

This will be where i brainstorm esolangs, feel free to add criticism in the discussion page.

Queue Lang thing

Day 1

Maybe use a Queue for data and the program itself, maybe like Bitwise Cyclic Tag? Also I could have it be golf like? Let’s create a theoretical General Golf Queue Lang (GGQL) for an example I guess. Also there’s a temporary variable called the stash. When the interpreter gets the program, it will turn it into a list, only accessible in program as a queue, called the program queue. When it comes upon a !, it stops the program. After reading and executing a command, it will be deleted from the list and will move on. If the interpreter reads nothing, it will loop and start reading from the start again.

GGQL Description
> Add data to the beginning of data queue from the stash.
= Copy the end of the data queue to the stash.
/ Cut the end of data queue to paste in the stash.
. Remove the end of the data queue.
"/' Start/End string mode. In string mode all text placed after is pushed to the data queue.
(Any Number) Push number to the data queue.
(Space) Seperate commands.
: Output data in stash.
; Output data from the end of the data queue.
? Input a character and place it in the stash.
$ Input number and place it in the stash.
* If data from stash is the same as data from the end of the data queue, add 1 to the beginning of the data queue.
~ If the end of the data queue is 1, skip the next command.
@ Copy end of program queue to stash.
& Add to the beginning of the program queue the data in the stash.
! End program.

With these simple commands, let’s make something.

Cat:

? : " ? : & & " & & & &

(Edit: I have realize that this does not work for long. Day 2 has the solution.)

That’s gonna be it for my planning in sandbox, goodbye! --Emerald (talk) 20:05, 12 September 2020 (UTC)

Day 2

I left last time with basic stuff. Now on the topic of the cat program. I have noticed it will not run forever which is the goal I was looking for. The solution is just add procedures.

n *code* )
^        ^Marks end of procedure
|The procedure name must be a single letter in the Latin alphabet.

Now, this comes with some problems. First is how to match it with the current system of the program queue. I decided that program manipulation is going to be dropped for now, and here’s the new system.

#for demonstration purposes a “#” is the comment indicator.
#P: is the program D: is data
P: e ? : e ) e
D: 
#the interpreter first checks for any procedures and finds “e”, it makes a new list
P: e
e: ? : e
D:
#then it runs the “P:” list. In there is the command to call the procedure e. The “P:” list is now empty.
P:
e: ? : e
D:
#S: is the stash
S: a
#next, the stash is outputted (any empty lists aren’t represented)
e: ? : e
#the final thing the procedure does is call the procedure “e” which makes the cat run forever.

All procedures MUST be at the beginning of the program. Last thing before I leave is give the updated list of commands.

GGQL Description
> Add data to the beginning of data queue from the stash.
= Copy the end of the data queue to the stash.
/ Cut the end of data queue to paste in the stash.
. Remove the end of the data queue.
"/' Start/End string mode. In string mode all text placed after is pushed to the data queue.
(Any Number) Push number to the data queue.
(whitespace) Seperate commands.
: Output data in stash.
; Output data from the end of the data queue.
? Input a character and place it in the stash.
$ Input number and place it in the stash.
* If data from stash is the same as data from the end of the data queue, add 1 to the beginning of the data queue.
~ If the end of the data queue is 1, skip the next command.
(any letter) Marks start of procedure and also marks it name.
) Marks end of procedure.
( Stops procedure before it finishes. (If used outside procedure, it acts like “!”)
- Takes from top (x) and next top (y) in the Data queue, and subtracts them (x-y). The result is put in the Stash.
+ Takes from top (x) and next top (y) in the Data queue, and adds them (x+y). The result is put in the Stash.
! End program.

That’s it for now, see you next day. --Emerald (talk) 14:51, 26 September 2020 (UTC)

Em3 is a proposed esolang being made in User:Emerald’s mind as you read. It is a line by line language, but with goto.

Em3

“What the hell am I doing”

--Emerald (talk) 00:55, 2 March 2021 (UTC)

Commands (NOT DONE AT ALL)

It has decided that for this esolang there will only be a maximum of 20 commands.

Command Meaning Example
splat Prints string given splat “hi”
goto Go to line goto 1
var Declare a variable var lol: 7
if if the statement is false, do specified code if lol more 7 {code}
remove Decrement a variable by one remove lol
add Increment a variable by one add lol