We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Snakel

From Esolang
Jump to navigation Jump to search
Official logo since 2005

Snakel is a Gaian version of Python created in 1989 by Tolly Edd (actually made by User:Ractangle in Spetember of 2024), with the goal being the language for beginers of programming in general

Syntax

Every program optionally starts with a definition of a function:

­ 1: def name[arguments]:
­ 2: ­ ­ ­ ­ ignore !"ignore" will exit the function
­ 3: def name:
­ 4: ­ ­ ­ ­ ignore

translated into python:

def name(arguments):
    return None
def name():
    return None

Fact: Just like in G#, if the main function has arguments, it will automaticly use the STDIN for the arguments of it

You can also do output (with tell[]) and input (with user):

­ 1: def main:
­ 2: ­ ­ ­ ­ tell["anything here"]
­ 3: ­ ­ ­ ­ user !Important, This command has no arguments

translated into python:

print("""anything here""")
input()

And also, the strings in Snakel are really just multi-liners:

­ 1: def main:
­ 2: ­ ­ ­ ­ tell["multi
­ 3: line"]

translated into python:

print("""multi
line""")

You can catch errors by using test

­ 1: test[1/0,[ArithmeticError],[tell["inf"]]]

translated into python:

try:1/0
except ZeroDivisionError:print("""inf""")

The Snakel conditionals are built almost the same as the rust's case statements

­ 1: num i=0
­ 2: if i=0(tell[0]) | i=1(end) | tell[3]

translated into python:

i:int=0
if i==0:print(0)
elif i==1:exit()
else:print(3)

Errors

This is still a work in progress. It may be changed in the future.

If you make an error in the code in a Snakel interpreter, the Terminal (or "Emiter" as it's called in the Gaia universe) will emit an error and will explain and show where you made a mistake

Using a wrong type in a variable

Code:

­ 1: num a="eso"

Emiter:

­ Error type: TypeError
­ At what line: 1

­ 2: num a="eso"
­ ­­ ­­ ­­ ---­ ­ ­ ^^^^^
­ Wrong value type!

Specifying an undefined type to a variable

Code:

­ 1: int i=user

Emiter:

­ Error type: TypeError

­ 1: int i=user
­ ­ ­ ­ ^^^
­ Invalid type!

Removing an entry that is not on the list

code:

­ 1: l=["H","I"]
­ 2: pop(l,"!")

emiter:

­ Error type: TypeError

­­­ 2: pop(l,"!")
­­ ­­­ ­­ ­­ ­ ­­ ­­ ­­ ­­ ­­ ­­^^^
­­ Pop non-existent entry from list!

Using a non-existent variable

Code:

­ 1: tell[code]

Emiter:

­ Error type: TypeError

­ 1: tell[code]
­­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ^^^^
­­ Invalid variable!

Using anything that is not a tab or a space as indentation

Code:

­ 1: def main:
­ 2: ;tell["how"]

Emiter:

­ Error type: SyntaxError

­ 2: ;tell["how"]
­ ­­ ­­ ­­ ­­^
­­ Invalid indentation!

Examples

Hello, world!

­ 1: tell["Hello, world!\n"]

translated into python:

print("Hello, world!")

Cat program

­ 1: tell[user]

translated into python:

print(input())

Truth-machine

­ 1: def truth[num[i]];
­ 2: ­ ­ ­ ­ if i>0(ignore)| tell[0];end
­ 3: truth[user]
­ 4: while 1:tell[1]

translated into python:

def truth(i:int):
    if i>0:return None
    else:print(0);exit()
truth(input())
while 1:print(1,end="")

A+B Problem

­ 1: def main[num[a,b]];tell[a+b]

translated into python:

def main(a:int,b:int):print(a+b)
main(int(input()),int(input()))

Compatibility

Snakel can't suport EVERY operating system due to some issues by either with hardware or by something else

microsoft

Method Disk system hardware "New" hardware Moddern hardware
Official Snakel add-on Only in computers that use the add-on slot No as since it's meant to be different from the older hardwares No as since it's built up from the "New" hardware
Using a coding extension of Snakel No coding application that has extensions exists Yes
Using the "Beginner-Friendly Programming Tool" No port of that exists
Using the codefree.com or recodefree.com website Panels (pre-"New" hardware) did not have built in internet