User:Ramseypedia/sandbox

= SideScript - A Planned Developer Friendly Programming Language =

Sidescript is a programming language that is planned to be released, with no release date scheduled. It is being developed by a single individual. The language is intended to be highly developer-friendly, with a focus on helping developers to easily manage and structure their workspace.

Design Goals and Use Cases

Sidescript is designed to be flexible and accessible for many kinds of use cases. The language will follow both object-oriented and functional programming paradigms, allowing users to manipulate a range of data types. Basic data types such as integers, floats, and strings will be included, as well as more complex data types for more specific tasks.

The inspiration for Sidescript came from the flexibility of Javascript and the syntax of rust and how it allows developers to structure their code easily. The language aims to provide an intuitive syntax and grammar.

 Debugging and Error Handling 

Sidescript is will be developed with useful tools to help developers detect bugs and errors in their code. The language will include a variety of debugging and error handling tools that are designed to make the development process more efficient. This will save time and make it easier to spot issues in the code early on. Overall, Sidescript is designed to be a developer-friendly language, with an emphasis on efficiency and ease-of-use.

 Compatibility and Licensing 

Sidescript is expected to be a compiled language that will be compatible with a range of platforms, including Windows, Linux, and Mac. The language is being developed with open-source principles in mind, and there are no proprietary or other licensing models planned. This means that Sidescript will be free and accessible for developers to use, modify and distribute as they see fit. The open-source nature of the language also means that developers will be able to contribute to the development of the language and help shape its future.

 Performance and Concurrency 

As a language that is not released yet, it is difficult to make any definitive statements regarding Sidescript's performance. However, It is worth noting that Sidescript is being developed by a single person, which may impact the performance.

=Examples=

Basics
Declaring variables //Declares a simple variable called x with the value 10 var x = 10; //Changes the value of the x to 20 x = 20;

//Declares a constant variable called x with the value 10 //The value of this variable can not be changed const x = 10;

Simple Operators const a = 10; const b = 5; //Declares a variable called "c" with the sum of the variables "a" and "b" const c = a + b; //15

const a = 10; const b = 5; //Declares a variable called "c" with the sum of the variables "a" and "b" const c = a * b; //50

First, two constant variables are declared with the values of 10 and 5 respectively. These variables are labeled as "a" and "b".

Next, the code declares a new constant variable called "c". This variable is assigned the result of adding the values of "a" and "b" together using the "+" operator. In this case, the result of "c" will be 15.

In the second snippet, the code redeclares the same variables "a" and "b" and assigns them the same values of 10 and 5 respectively.

Finally, a new variable called "c" is declared and assigned the result of multiplying the values of "a" and "b" using the "*" operator. In this case, the result of "c" will be 50.

Overall, these code snippets show how to perform simple arithmetic operations using the "+" and "*" operators in Sidescipt.

Defining functions const a = 10; const b = 5; function add(param1, param2) { return param1 + param2; };  const c = sum(a, b);

Basic functions like the example above can be declared with a name and parameters to later be called in the script. When functions are called they execute the code inside them.

Types

int x = 10; x = 20; const string abc = "hello";

Types with functions function getFullName(firstName: string, surname: string) { return `${firstName} ${surname}`; };  function getNameLength(name) { if(name.length > 200) return "The Name can't be over 200 characters"; if(name.length == 0) return "The Name can't be 0 characters long"; if(name is string) { return name.length; }      return "The name must be a string"; };

The first function is called "getFullName" and takes in two parameters, "firstName" and "surname", both of which are strings. It then concatenates them together using string interpolation and returns the resulting full name as a string.

The second function is called "getNameLength" and takes in one parameter called "name", which can be either a string or an integer. If the length of the name parameter is greater than 200 characters, the function returns a string indicating that the name cannot be over 200 characters. Similarly, if the length of the name parameter is 0, the function returns a string indicating that the name cannot be 0 characters long.

If the name parameter is a string, the function returns the length of the string. If the name parameter is not a string, the function returns a string indicating that the name must be a string.

Multitype variables

var givenNumber = 20; givenNumber = "twenty;

This code snippet in Sidescirpt declares a variable called "givenNumber" with the type of "int | string". This means that the variable can hold a value that is either an integer or a string.

The initial value of the "givenNumber" variable is set to 20, which is an integer. Since the variable is defined as "int | string", it can hold an integer value.

Later in the code, the value of "givenNumber" is reassigned to "twenty", which is a string. Since the variable is defined as "int | string", it can also hold a string value.

Advanced
Interfaces and Inheritences

function sum(a: int, b: int):: { return a + b;  }; class Apple:: { function cut:: => "I got cut"; };

The first block of code defines a function called "sum", which takes in two integer parameters and returns their sum as an integer. The function is also defined with an interface called "IGlobal", which is not shown in this code snippet. This interface is likely used to specify additional behavior or requirements for the function.

The second block of code defines a class called "Apple". The class is defined with two interfaces: "Fruit" and "IGlobal". The "Fruit" interface is likely used to specify that this class is a fruit and has certain properties and behaviors associated with fruits. The "IGlobal" interface is the same interface used in the previous function.

Inside the "Apple" class, there is a function called "cut", which returns the string "I got cut". This function is also defined with an interface called "IPublic", which is likely used to specify that this function can be accessed publicly by other parts of the program.