FOLDERS text

From Esolang
Jump to navigation Jump to search

Note

This programming langauge is not complete yet, the article will remove this sentence if one day I'll finished this

Introduction

If you don't know what is FOLDERS esoteric programming langauge at first, go to this link: https://esolangs.org/wiki/Folders

FOLDERS text is a programming language based on Folders but more advanced

Syntax

The start of a program will always be a command.

Commands

Commands Numbers of ingredient folders in the first-sub folder Arguments (If required)
if 0 folders Second sub-folder holds boolean-expressions, third holds list of commands
while 1 folder Second sub-folder holds boolean-expressions, third holds list of commands
declare 2 folders Second sub-folder holds type, third holds the var name (in terms of numbers of folders)
let 3 folders Second sub-folder holds type, third holds the var name (in terms of numbers of folders), fourth folder holds expressions or boolean expressions
print 4 folders Second sub-folder holds zero folder if the expressions not end with a newline character (\n) or one folder if it's end with a newline character, third holds the expressions
input 5 folders Second sub-folder holds the type (in terms of numbers of folders indicated in the type-table below. Except, input command cannot use for boolean-type variables), third sub-folder indicated the var name (in terms of numbers of folders).
functions 6 folders Second arguments holds the ordinal number of the function indicated by using Ingredient Folders (This will be useful for the call-function later on). From third sub-folder to the previous sub-folder of the last sub-folder, holds argument (indicate the argument seperated by incrementally the number of Ingredient Folders in them); last folder holds command list.
return 7 folders This command only applied in the function-folder. It returns the value whatever the second sub-folder holds. Second sub-folder holds expressions or boolean-expressions.
call-function 8 folders This command only applied to the function-folder. It calls the function and using the number of folders to indicate what function it should call. From the second argument to the last argument, holds input of the function-folder.

Expressions

Expressions Type Numbers of Ingredient Folders Arguments (If required)
Variable 0 folders Second sub-folder contains variable name (in terms of the numbers of folders)
Add 1 folder Second sub-folder and third sub-folder contains Expressions
Subtract 2 folders Second sub-folder and third sub-folder contains Expressions
Multiply 3 folders Second sub-folder and third sub-folder contains Expressions
Divide 4 folders Second sub-folder and third sub-folder contains Expressions
Literal Value 5 folders Second sub-folder holds type and third sub-folder contains Expressions

Variables Types

Types Ingredient folders needed
integer 0 folders
float 1 folder
string 2 folders
boolean 3 folders

Boolean Expressions

Boolean commands Numbers of Ingredient folders required Arguments (If required)
False 0 folders
True 1
AND 2 folders Second sub-folder and third sub-folder holds boolean expressions (returns True if 2 boolean expressions are True, else reutrns False)
OR 3 folders Second sub-folder and third sub-folder holds boolean expressions (returns False if 2 boolean expressions are False, else reutrns True)
NOT 4 folders Second sub-folder holds boolean expressions (returns True if the boolean expression is False, else return False if boolean expression is True)
== 5 folders Second sub-folder and third sub-folder holds expressions to compare (returns True if two expressions are equal)
< 6 folders Second sub-folder and third sub-folder holds expressions to compare (returns True if the first expression is less than the second expressions)
> 7 folders Second sub-folder and third sub-folder holds expressions to compare (returns True if the first expression is larger than the second expressions)
<= 8 folders Second sub-folder and third sub-folder holds expressions to compare (returns True if the first expression is less than or equal to the second expressions)
>= 9 folders Second sub-folder and third sub-folder holds expressions to compare (returns True if the first expression is larger than or equal to the second expressions)
!= 10 folders Second sub-folder and third sub-folder holds expressions to compare (returns True if the first expression is different from the second expressions, else returns False)


Literal Value

Integer type

Each integer is divided into many bit-folders.
The first sub-folder indicate the sign of the integer, indicate a positive number if there are 0 folders and indicate a negative number if there is 1 folder. The rest is the minimal binary representation of the value.

String type

Each string contains many Unicode character, each character (UTF-32) is encoded in 8 hex-digit-folder. Each hex-digit-folder is encoded in 4 bit-folders

Boolean type

Boolean type is different than integer, string and float type.
In the value folder of a boolean literal value, if there are 0 folders then it indicate a False boolean value and if there is 1 folder then it indicate a True boolean value.

Bit folder

Bit folder is a basic unit of any integer, float, string literal value (i.e. a fancy name of constant) Each bit folder either indicate 0 or 1, using 0 or 1 Ingredient Folders

Ingredient Folders

They're folders that doesn't have any folders inside of it, except for arguments that can have no folders inside of it then it's not Ingredient folders. Ingredient Folders is recognized by not having a colon at the end of a line (if your code run suceess).

Comments

Use a '#' character at the start and the end of the comments. Every comments will be ignored

Colon

Every commands folders, argument folders, bit folders must have a colon at the end of a line

Functions and Call-Function command

Naming Conventions for each element

Definition: Naming Conventions is a way to communicate infomation of somethings in a code applied only in a programming community and makes everything easy to look and easy to fix when a program get bugs. Note that Naming Conventions doesn't change anything about syntax.

For commands: <Command's name>-command:.

For ingredients folders: Nf<ordinal number> (ordinal number start with 1 and on and on to infinity).

For other things like newline folder and expressions folder, just name it by itself. Don't make your program confuse for others just because your lack of naming. Like don't try to name a newline Folder as a Expressions Folder or stuff like that.

Note: You don't have to use Naming Conventions if you want, maybe you are the one only using this and not shared to anyone out there. However, as a community gets larger and larger, it needs a more meaningful way to communicate, especially in coding.

Program Examples

Hello, World!

   Block1:
       print-command:
           Nf1
           Nf2
           Nf3
           Nf4
       newline:
       expressions:
           literal:
               literal-type:
                   Nf1
                   Nf2
                   Nf3
                   Nf4
                   Nf5
               string-type:
                   Nf1
                   Nf2
               value:
                   1st-character:
                       hexleft:
                           1st-bit
                           2nd-bit:
                               Nf
                           3rd-bit
                           4th-bit
                       hexright:
                           1st-bit:
                               Nf
                           2nd-bit
                           3rd-bit
                           4th-bit
                   2nd-character:
                       hexleft:
                           1st-bit:
                           2nd-bit:
                               Nf
                           3rd-bit:
                               Nf
                           4th-bit:
                       hexright:
                           1st-bit
                           2nd-bit:
                               Nf
                           3rd-bit
                           4th-bit:
                               Nf
                   3rd-character:
                       hexleft:
                           1st-bit
                           2nd-bit:
                               Nf
                           3rd-bit:
                               Nf
                           4th-bit
                       hexright:
                           1st-bit:
                               Nf
                           2nd-bit:
                               Nf
                           3rd-bit
                           4th-bit
                   4th-character:
                       hexleft:
                           1st-bit
                           2nd-bit:
                               Nf
                           3rd-bit:
                               Nf
                           4th-bit
                       hexright:
                       1st-bit:
                           Nf
                       2nd-bit:
                           Nf
                       3rd-bit
                       4th-bit    #Marking the incompleted work here
               5th-character:
                   hexleft:
                       1st-bit
                       2nd-bit:
                           Nf
                       3rd-bit:
                           Nf
                       4th-bit
                   hexright:
                       1st-bit:
                           Nf
                       2nd-bit:
                           Nf
                       3rd-bit:
                           Nf
                       4th-bit:
                           Nf
               6th-character:
                   hexleft:
                       1st-bit
                       2nd-bit
                       3rd-bit:
                           Nf
                       4th-bit
                   hexright:
                       1st-bit:
                           Nf
                       2nd-bit:
                           Nf
                       3rd-bit
                       4th-bit
               7th-character:
                   hexleft:
                       1st-bit
                       2nd-bit
                       3rd-bit:
                           Nf
                       4th-bit
                   hexright:
                       1st-bit
                       2nd-bit
                       3rd-bit
                       4th-bit
               8th-character:
                   hexleft:
                       1st-bit
                       2nd-bit:
                           Nf
                       3rd-bit
                       4th-bit:
                           Nf
                   hexright:
                       1st-bit
                       2nd-bit:
                           Nf
                       3rd-bit:
                           Nf
                       4th-bit:
                           Nf
               9th-character:
                   hexleft:
                       1st-bit
                       2nd-bit:
                           Nf
                       3rd-bit:
                           Nf
                       4th-bit
                   hexright:
                       1st-bit:
                           Nf
                       2nd-bit:
                           Nf
                       3rd-bit:
                           Nf
                       4th-bit:
                           Nf
               10th-character:
                   hexleft:
                       1st-bit
                       2nd-bit:
                           Nf
                       3rd-bit:
                           Nf
                       4th-bit:
                           Nf
                   hexright:
                       1st-bit
                       2nd-bit
                       3rd-bit:
                           Nf
                       4th-bit
               11st-character:
                   hexleft:
                       1st-bit
                       2nd-bit:
                           Nf
                       3rd-bit:
                           Nf
                       4th-bit
                   hexright:
                       1st-bit:
                           Nf
                       2nd-bit:
                           Nf
                       3rd-bit
                       4th-bit
               12nd-character:
                   hexleft:
                       1st-bit
                       2nd-bit:
                           Nf
                       3rd-bit:
                           Nf
                       4th-bit
                   hexright:
                       1st-bit
                       2nd-bit:
                           Nf
                       3rd-bit
                       4th-bit
               13rd-character:
                   hexleft:
                       1st-bit
                       2nd-bit
                       3rd-bit:
                           Nf
                       4th-bit
                   hexright:
                       1st-bit
                       2nd-bit
                       3rd-bit
                       4th-bit:
                           Nf

Factorial

   Block1:
       input-command:
           Nf1
           Nf2
           Nf3
           Nf4
           Nf5
       input-type:
       var-name:   #Variable "n"
   Block2:
       if-command:
       bool-expressions:
           less-than-command:
               Nf1
               Nf2
               Nf3
               Nf4
               Nf5
               Nf6
           1st-expression:
               var-type:
               var-name:
           2nd-expressions:
               literal:
                   literal-type:
                       Nf1
                       Nf2
                       Nf3
                       Nf4
                       Nf5
                   value-type:
                   value:
                       Nf1:   #Positive sign
                       Nf2:   #Value 0
       command-list:
           print:
               print-command:
                   Nf1
                   Nf2
                   Nf3
                   Nf4
               newline: 
               expressions:
                   literal-type:
                       Nf1
                       Nf2
                       Nf3
                       Nf4
                       Nf5
                   string-type:
                       Nf1
                       Nf2
                   value:
                       1st-char:
                           1st-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           2nd-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           3rd-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           4th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           5th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           6th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           7th-hex:
                               1st-bit:
                               2nd-bit:
                                   Nf1
                               3rd-bit:
                               4th-bit:
                           8th-hex:
                               1st-bit:
                               2nd-bit:
                                   Nf1
                               3rd-bit:
                               4th-bit:
                                   Nf1
                       2nd-char:
                           1st-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           2nd-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           3rd-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           4th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           5th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           6th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           7th-hex:
                               1st-bit:
                               2nd-bit:
                                   Nf1
                               3rd-bit:
                                   Nf1
                               4th-bit:
                                   Nf1
                           8th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                                   Nf1
                               4th-bit:
                       4th-char:
                           1st-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           2nd-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           3rd-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           4th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           5th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           6th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           7th-hex:
                               1st-bit:
                               2nd-bit:
                                   Nf1
                               3rd-bit:
                                   Nf1
                               4th-bit:
                           8th-hex:
                               1st-bit:
                                   Nf1
                               2nd-bit:
                                   Nf1
                               3rd-bit:
                                   Nf1
                               4th-bit:
                                   Nf1
                       5th-char:
                           1st-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           2nd-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           3rd-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           4th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           5th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           6th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                               4th-bit:
                           7th-hex:
                               1st-bit:
                               2nd-bit:
                                   Nf1
                               3rd-bit:
                                   Nf1
                               4th-bit:
                                   Nf1
                           8th-hex:
                               1st-bit:
                               2nd-bit:
                               3rd-bit:
                                   Nf1
                               4th-bit:
   Block3:
       if-command:
       boolean-expression:
           Larger-or-equal:
               Nf1
               Nf2
               Nf3
               Nf4
               Nf5
               Nf6
               Nf7
           1st-expressions:
               var-type:
               var-name:   #Variable "n"
           2nd-expressions:
               literal-type:
                   Nf1
                   Nf2
                   Nf3
                   Nf4
                   Nf5
               value-type:
               value:
                   Nf1:   #Positive sign
                   Nf2:   #Value 0
       command-list:
           let:
               let-command:
                   Nf1
                   Nf2
                   Nf3
               var-type:
               var-name:
                   Nf1    #Variable "Factorial"
               value:
                   literal:
                       literal-type:
                           Nf1
                           Nf2
                           Nf3
                           Nf4
                           Nf5
                       literal-type:
                       literal-value:
                           sign:    #Positive sign
                           Nf2:
                               Nf1
           while:
               while-command:
                   Nf1
               boolean-expression:
                   less-than:
                       Nf1
                       Nf2
                       Nf3
                       Nf4
                       Nf5
                       Nf6
                   
           print:

How to run

Right now, there is no editor or compiler/interpreter available for running this programming language

How to code

Using any text editor like Notepad or Notepad++ in Windows or something similar like that in any computer you might use.