Schmuu

From Esolang
Jump to navigation Jump to search

Schmuu is language created originally by User:Schmuui and User:Galaxtone.

This language is not fully complete, and is currently only a concept as no interpreter has yet been made.

The Language

The file extension for files created in Schmuu is .sch

Types and variables are case-insensitive.

List of types

If type should be prefixed with "a" or "an" to be grammatically correct, then it must be prefixed with "a" or "an".

All value declarations use non-unicode characters (ASCII) except Words.

Name Value Representation Value Declaration
Nothing No value. The type itself is used.
Thing Any value. Can be used as a value or in place of any of the other types (Excluding nothing).
Module A module containing methods. Cannot be defined directly.
Count A 32bit integer. An optional minus (which cannot be used if the first digit is a zero) followed by one or more digits, the first digit cannot be a 0 if there are more than one digits.
Words A UTF-32 String. All Characters except quotes surrounded by quotes. (This means you can include newlines directly, Surrounding quotes must be U+0022 or U+0027)
Truth A boolean. The type's values can be used directly as "true" or "false".
To-do List A array with a length of at least one. One or more value declarations separated by a comma and a space. (a one-length To-do list cannot be created using the type Thing to auto-detect type of a value declaration)

List of statements

Usage Description Pseudo-code
Schmuu! Begins and concludes a script. None.
Psst! <comment> It's a comment. # It's a comment.
Go get me the <module>! Imports an internal module.

import <module>

Go buy me a <module>! Imports an external module.

import <module>

By the way, The <variable> has the <item> from the <module> in it. Grabs <item> from <module> and stores it in <variable>.

<variable> = <module>.<item>

Do the thing where you <method> the <module> [with <value/value variable> [and with ...]] [and put it in to <variable>]. Executes <method> from <module> with the passed values as arguments and stores the result in <variable>. (If <method> doesn't return then Nothing is stored in <variable>)

<variable> = <module>.<method>(<value variable>, ...)

If the <variable> has <value/2nd variable/type> in it then do If <variable> has the same value as <value>/<variable> has the same value as <2nd variable>/<variable>'s type is the same as <type>, then execute the code within the block. (Must be ended by an end block statement)

if <variable> == <value/2nd variable> then
...
end

if type(<variable>) == <type> then
...
end

And if it doesn't but <variable> does have <value/variable/type> in it then try and do this instead Acts like an end block statement to the previous if statement and as an if statement, Ends the previous if statement block and if the previous if statement (hasn't been closed by an end block statement) failed then this statement is evaluated exactly like an if statement.

else if <variable> == <value/2nd variable> then
...
end

else if type(<variable>) == <type> then
...
end

And if it that didn't work then do this Same as the above statement except if the previous if statement failed then the code is executed without comparing any values.

else

Repeat this atleast <number> times. Executes the code within the block <number> times.
Keep at it while <variable> has <value/2nd variable name/type> in it Repeatedly executes the code within the block while <variable> has the same value as <value>/<variable> has the same value as <2nd variable>/<variable>'s type is the same as <type>.

while <variable> == <value/2nd variable> do
...
end

while type(<variable>) == <type> do
...
end

Keep doing this over and over and over and over Executes the code within the block repeatedly.

while true do

Ok, you can stop. Stops executing code repeatedly for the current loop.

break

And that's about it. Ends a block statement.

end

Don't forget that <variable name> has (the <type> of <value>/<type>) in it. Stores the value within the variable/initializes an empty value of value type within the variable

<variable> = <value>

Can you hold on for about <number> seconds. Halt for <number> seconds.

sleep(<number>)

Stop it! Stop executing code all together

exit()

List of built-in modules

Printer

Module for reading from and writing to the screen.

Don't forget this has the To-do list of "Format the printer methods using table", "Write the documentation for the rest of the modules" in it.

"write using" - Takes in one or more arguments, and converts them to a string and concatates all them together with spaces in between and prints it to screen (Nothing is ignored and tossed, if the total amount of arguments is initally or after nothing tossing is 0 then nothing is written to screen) "print using" - Does the same thing as write then writes a newline afterwards (it still prints a newline if nothing is written to screen) "read from" - Reads from keyboard etc. please finish this description

Modules left to write documentation about:

Name Description
Math Module for your everyday math operations.
Word Mangler Module for string manipulation.
Quine Excuse Allows you to make quine scripts much easier.

Examples

Hello World

Schmuu!
Go get me the Printer!
By the way, The paper has the Paper from the Printer in it.
Do the thing where you write on the Paper with "Hello, world!".
Schmuu!

Quine

Schmuu!
Go get me the Printer!
Go get me the Quine Excuse!
By the way, The quine paper has the Paper from the Quine Excuse in it.
By the way, The output paper has the Paper from the Printer in it.
Do the thing where you read from the quine paper and store it in quine.
Do the thing where you write on the output paper with quine.
Schmuu!

Non-terminating Cat

Schmuu!
Go get me the Reader!
Go get me the Printer!
By the way, The paper in has the In Paper from the Printer in it.
By the way, The paper out has the Out Paper from the Printer in it.
Keep doing this over and over
  Do the thing where you read from the Paper with input.
  Do the thing where you write on the Paper with input.
And that's about it.
Schmuu!