User:DockedChutoy/Sandbox

From Esolang
Jump to navigation Jump to search

Fin (temporary name), short for "File In", is an esolang created by Docked in 2026. It was designed with to purpose to push the paradigm of metaprogramming to its limits, including using the source code itself as memory. A major part of Fin is the ability to easily modify code.

Fin
Paradigm(s) imperative
Designed by Docked
Appeared in 2026
Memory system Other
Dimensions one-dimensional
Computational class Turing complete
Reference implementation Unimplemented
File extension(s) .fin

Language Specification

Comments

Comments are marked as follows:

/* Comment here (yes it's the css comments) */

Types

Fin has 4 different usable types, with one of them being mostly specific to this language:

Fin types
Name Usage Description
String "text" Returns simple text. Enclosed in quotes.
Number $number Returns a simple number. May be written as a integer or float.
Boolean True/False Returns a simple boolean number, either True or False. In arithmetics, act like 1 and 0, respectively.
Line Reference line number or +/-line offset Returns whatever is contained in the referenced line.

The line reference (lineref) is the most interesting type. Take the following program as an example:

print 2
"Hello World!"

The print function refers to line number 2, which contains a "Hello World!" string, which is then printed. In longer code, however, it can be impractical to use exact lines. To deal with that, one can also use line offsets, as the following example shows:

$42
print +1
"Hello World!"

Here, the +1 tells the print function to use whatever is on the next line. If we wanted to print 42, we would use -1 instead. There are, of course, other ways to refer to lines, but these are the basic ones. It is, of course, possible to print strings directly. But that's not really in the spirit of the language.

Aliases (?)

Since all of Fin's memory relies entirely on code, Fin does not have memory in the traditional sense. Instead, it uses "aliases", so that instead of referring to a line using numbers, one can refer to it using its own alias. Here it is in action:

alias +2 = x
print x
"Hello World!"

The first line makes an alias for line 3, here called x, and the second line prints it. Note how it technically does not matter where the aliased line is located, what matters is that the alias is put before the print statement.

Line Manipulation

Fin has several commands that allow to manipulate lines, and thus modify code. Note that most commands could be considered syntactic sugar:

Fin line manipulation commands
Command Description
write line value Rewrites the line line with value, which is either a string or another line.
copy a b Copies the line a to line b.
delete line Deletes the given line.

An example with all three:

print 4
write +2 "World!"
copy 0 +2
"Hello " /* Gets turned into "World!" */
"another useless string" /* Gets turned into print and then deleted */
delete -1

Gotos

Gotos are very simple, they simply go to the given line. Here's an example:

"Hello World!"
print 1
goto 2

The above example will run forever.

Conditionals

Conditionals also exist in the form of ifs, which are simply ifs but i want to be DIFFERENT and COOLER you know? man im fucking tired and its fucking 9 pm how do you get tired in 9 pm how is that possible. actually no they are ifs whens sound stupid. They are written as follows

if *condition* then *thenStatement* else z