Stitchii
Stitchii is a language by user:GluonVelvet whose design principle is to be made out of as many different parts as possible. Make every language component in different languages and combine them together to make a language that either disregards or takes advantage of the features of all of them. Stitchii's mascot has not been drawn, but is a freakish chimera with a trash picker in a black and white prison jumpsuit with a ball and chain around their ankle. Their name is Clover and she is serving community service for her crimes against language design.
Components
- Tokenizer written in Python
- Lexer and parser written in Raku
- Interpreter written in Java
- Expressions written in OCaml
- Type checker written in Elixir
- Language utilities written in Factor
- makefile for makefile shenanigans
- D for language implementation and glue language
These are subject to change and make the language terribly hard to implement.
The language syntax is mostly normal since the idea is to make the backend the bad part. This may change though.
Pseudocode and examples (wip)
```This is the pseudocode for Stitchii, which is subject to change As you may have figured out, we are in a comment As long as there isn’t a closing three ` it will continue to be a comment The Stitchii mascot, Clover, likes to call these popcorns, but you can ignore her and call them whatever you want```
Stitchii is statically typed...
int value = 8 string clover = “eternally imprisoned” bool ean = True float jellyfish = 0.5 const pi = 3.14
However supports a type for dynamic typing, the chimeric type
chmra dynamic = “hello” dynamic = 12
lists/arrays must only contain one type of value and can not contain other lists
int list = [] list.append("Clover") ```This will throw an error```
Showing values
paste(value * jellyfish) ```will display the result of the two variables multiplying as a float``` paste(value * value) ```will display the result of value multiplying itself, also as a float, since the * and / operators always evaluate things as floats``` pasteln(“hello world”) ```displays hello world on a new line```
Stitchii supports anonymous functions...
fn(dynamic, jellyfish){ dynamic = dynamic + jellyfish ```normally you can use +=, but dynamic is a chimeric type variable and needs the extra specification because it makes it easier for me to implement that way``` return dynamic ```returns 12.5 and ends the function but...``` } paste(dynamic) ```this will display 12 because all functions force immutability```
Oh and you can also make non anonymous functions
fn ListManipulator(list){ list.append(9) list.append(10) list.combine() ```Will combine all the values in the list. If it is a list of strings, it will concatenate all of them``` return list ```returns 19 in a list but in my heart it will be 21``` } paste(list) ```just like before, immutability causes this to return an empty list```
If you want mutability, make a class!
```All classes are public by default unless you use the private keyword``` class AllVars(self, value, clover, ean, jellyfish, pi, dynamic, list){ self.intVar = value self.stringVar = clover self.boolVar = ean self.floatVar = jellyfish self.pi = pi self.chimericVar = dynamic self.list = list def mingle(self){ chmra mingled = self.intVar + self.floatVar + self.pi + self.chimericVar if(boolVar){ mingled = “” + self.stringVar + mingled return mingled } return self.list ```acts as an else since the thing ends when you return``` } }
That's all for the pseudocode, thanks for reading.