prettydiff
Beautifier and language aware code comparison tool for many languages. It also minifies and a few other things.
- 1.8k
- TypeScript
- 3 y ago
Simple Language, a language that is syntax simple and structally dense
Repo prettydiff/simple, read from GitHub 15 min ago. prettydiff has not joined Take My Repo.
prettydiff/simple is a public repo on GitHub by prettydiff. Simple Language, a language that is syntax simple and structally dense. It declares the CC0-1.0 license on GitHub. It is written mainly in JavaScript, has 1 stars and last changed on 2017-06-18. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-22.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
An eductional language to speed learning of logic and automation with sacrifice to convention and syntax.
Status: Early pre-alpha (experimental)
According to data from multiple sources JavaScript is the most popular language in the world. Unfortunately, it is rarely formally taught, and most developers cannot adequetely figure it out so as to become competent without significant help. Worse still is that there are many pitfalls in JavaScript that frequently trip up and slow down seasoned experts without help from static analysis tools. Worst of all is that JavaScript has no shortage of controversy and inflated holy wars. These are all problems that can be solved provided the language were designed with these problems in mind.
Simple Language is designed to be single paradigm language with syntax that isn't open to confusion. The goal is to provide a language that is easy for programmers of all levels to understand without sacrifice to performance or expressiveness.
A language interpreter will be coming soon. In the mean time I am writing the first parser in JavaScript. The actual parser file is API agnostic, but a helper file for reading files and writing a parse table to console is available for execution with Node.js.
/* */// //Unclosed comments will not generate a parse error. The unclosed comment will comment until either the terminating sequence is encountered or at end of file.
<><=>.= equality~ inequality< less than> greater than<=> trichotomy, returns -1, 0, or 1 if respectively: less, equal, or greater& logical and| logical or( logical group start) logical group end{ block start} block end[ property start] property end: assignment? ternary primary # ternary secondary (else), list separator+ addition- subtraction* multiplication/ division^ exponentiation% modulo:+ addition assignment (increment):- subtraction assingment (decrement):* multiplication assignment:/ division assignment:^ exponentiation assignment:% modulo assignment! string concatenation\ escape sequence; statement termination" string delimiter' string delimiter. number decimal separator (only available in number data types)Unicode character entities are only available within strings.
\uXXXX where X represents a hexadecimal digit 0-9 or a-f, for example \u039b would evaluate to Greek capital Lambda. This 4 character entity form a single byte Unicode code point is specified.\u{XXXXX} where X represents a hexadecimal digit 0-9 or a-f. This 5 character entity evaluates to a double byte Unicode character. \u{220a3} is identical to \ud848\udca3An incomplete Unicode character entity will generate an error.
\u0009 - tab\u000a - line feed (LF)\u000c - form feed (FF)\u000d - carriage return (CR)\u0020 - space\u00a0 - no-break space\u1680 - ogham space mark\u180e - mongolian vowel separator\u2000 - en quad\u2001 - em quad\u2002 - en space\u2003 - em space\u2004 - three-per-em space\u2005 - four-per-em space\u2006 - six-per-em space\u2007 - figure space\u2008 - punctuation space\u2009 - thin space\u200a - hair space\u2028 - line separator\u2029 - paragraph separator\u202f - narrow no-break space\u205f - medium mathematical space\u2b7f - vertical tab\u3000 - ideographic space\ufeff - zero-width non-breaking spacePlease note that non-visible white space characters that exist as gramatic constructs to bind or separate words are deliberately excluded from this list: \u200b, \u200c, \u200d, \u2060, \u2063.
Words may be comprised of any Unicode character with exception to the following list:
@ (at symbol)$ (dollar)It should be noted that null values exist in this language, but are not a data type. Null can be assigned to a reference, but not within a let or const function. The point of null is to unset a value from a reference by instead providing something that is both neutral and useless. An assignment of null will not cause an error and will not change the reference's type property. Attempting to access or execute any property of a reference with a null value will cause an error.
cat: <> {console.log("meow");}cat(); // returns the actual function because a return value isn't specific and executes its instructions //cat; // returns the actual function without executing its instructions //cat: <x:"number"> {return(x + 1)}; cat(3); // returns 4animals: Store.array("cat", "dog", "parrot")animals[0]; // returns "cat" //animals: Store.hash("cat": "meow", "dog": "bark", "parrot": "squawk")animals["cat"]; // returns "meow" //animals: Store.map(myHashj: "sounds")animals[myHash] // returns "sounds" //animals: Store.set(myFunction)animals[myFunction] // returns myFunction //animals[myCat] // returns null //animals: {code instructions go in here;}animal(); // executes the code in the block and always returns null //animal; // returns the block itself //The types array, hash, map, and set are all iterable. Except for arrays, the contents of these types reside in the order with which they were added. Type checking is ignored for assignments to values in the storage types, so that a value of a different data type can assigned to an existing key.
The function data type is unique in that this is the only data type that receives input into locally created referrences called arguments or parameters. When these arguments are declared they must be assigned to a string value representing a data type. The absence of this assignment will cause a parse error. Any value is permitted for this string, including an empty string, to avoid a parse error. The referrence or value submitted to the function in position of this argument must match the assigned data type or a type error will be thrown. Here are some examples:
let(myFunction: <source: "string", index: "number"> {
return();
});
myFunction("a big long string", 1234); // good //
myFunction(12, 1234); // type error, because the first argument expects a value who's type property is value "string" //
let(myFunction: <source: "myCustomType", index: "number"> {
return();
});
myFunction("a big long string", 1234); // type error, //
// because the first argument will have a type property value of "string", //
// but a custom subtype is expected with value of "myCustomType" //
let(myFunction: <source, index> {
return();
});
// parse error, a function is declared with arguments, //
// but the arguments are not assigned a data type //
Word tokens in this language are either keywords declared by the language or references declared by a user. Undeclared words will throw an error. All references must be declared, and must be declared before they are referrenced.
References are globally scoped if declared outside a block or scoped to the block in which they are declared. Child blocks have access to read and write to references declared in containing blocks. Containing blocks cannot access references declared in child/descendant blocks.
References are declared using the let and const functions. These functions may only be executed once per block, as the explicit interface to an implicit property of the block, but may contain many comma separated assignments. These functions are optional and may occur in any order, but must occur as the first statements of a block or global space. The const function is nearly identical to the let function, except the values declared by const will throw an error if reassigned a value.
All references are declared as a word assigned to a value. The value may be of any supported data type except null. Null data types will not be allowed as a default type and will throw an error when such conditions occur. This assignment determines the reference's default value and data type. The data type of the value is written to a read only property of the reference named type.
All references have a type and length propery, of which both are read only. The length property offers a different meaning depending upon the data type and is calculated upon request. Here is a description of the meaning of length by type value:
Please note that values comprised of a string length include escape sequences (\), or switches in the case of regex, as a counted character. White space characters are not considered in this count unless the type is "string".
if (y = 3) {
let(cat: "meow", kittens: 0, instructions: {
console["log"]("Hello");
console["log"](" world");
});
cat["type"]; // "string" //
cat["length"] // 4 //
kittens["type"] // "number" //
kittens["length"] // 1 //
instructions["type"] // "block" //
instructions["length"]; // 45 //
}
The words in this list cannot be used as names of references
do keyword is required followed by a block followed by the until keyword followed by parenthesis group wrapping an expression.do myBlock() until (x = 5);if and elseif (if present) conditions evaluate to false.if (x > 1) myBlock() else otherBlock();if statement and 0 or more fully formed elseif statements then the elseif keyword followed by a parenthesis grouping containing an expression and finally a block to execute.if (x > 1) myBlock() elseif (x < 0) negativeBlock() else otherBlock();if followed by a parenthesis grouping containing an expression, which is then followed by a block to execute if the condition evaluates to true.if (x > 1) myBlock();if (x > 1) {myBoolean: true;}return(myValue);do/until loop separating the loop's block from its breaking expression.Store is a predefined globally scoped hash provided by the language. It contains several standard properties. Any attempt to reassign these standard properties will throw an error.
do/until - A loop that executes repetive logic and breaks only when its until expression evaluates to false or when a break keyword is executed.do myBlock() until (x = 5);myStorage["foreach"](functionReference)if/elseif/else - A form of logic branching based upon evaluation of one or more expressions optionally followed by a default.if (x > 1) myBlock();if (x > 1) {myBoolean: true;}if (x > 1) myBlock() elseif (x < 0) negativeBlock() else otherBlock();if (x > 1) myBlock() else otherBlock();-1234.5678["abs"](); // returns 1234.5678 //1234.1687["ceiling"](); // returns 1235 //1234["ceiling"](); // returns 1234 //1234.5687["floor"](); // returns 1234 //1234["integer"](); // returns true //1234.4567["integer"](); // returns false //-1234["integer"](); // returns true//1234.5678["round"](); // returns 1235 //1234.5678["round"](2); // returns 1234.57 //1234.5678["round"](6); // returns 1234.5678 //1234.5678["precision"](2); // returns 1234.56 //1234.5678["precision"](6); // returns 1234.5678 //1234.5678["precision"](); // returns 1234 //myMap["concat"](myOtherMap); // returns myMap will all of myOtherMap's properties //mySet["forEach"](functionReference); // returns mySet //"abc"["charAt"](1); //returns "b" //""["codePointAt"](0); // returns 65791 //"a cat glances upon a star in a dark sky"["count"]("a"); // returns 7 //"a cat sleeps all day"["indexOf"]("cat"); // returns true //"a cat sleeps all day"["indexOf"]("boat"); // returns false //"a cat sleeps all day with another cat"["indexOf"]("cat"); // returns 2 //"a cat sleeps all day with another cat"["indexOf"]("cat"); // returns 34 //"A Boy And His Car"["lowerCase"](); // returns "a boy and his car" //"1234"["numeric"](); // returns true //"doggy"["numeric"](); // returns false //"1234"["parseNumber"](); // returns 1234 //"123a5"["parseNumber"](); // returns 0 //"cat is very odd."["replace"](/very/g, "crazy"); // returns "cat is crazy odd." //"my fig tree smells very sweet"["slice"](7); // returns "tree smells very sweet" //"my fig tree smells very sweet"["slice"](7, 11); // returns "tree" //"a"["split"]("b"); // returns ["a"] //"abcbc"["split"]("b"); // returns ["a", "c", "c"] //"A Boy And His Car"["upperCase"](); // returns "A BOY AND HIS CAR" //Simple Language provideds a method modifyType on the Store hash for creating custom data types. This method has special access to write a custom value to the read only type property on a reference. This method takes two arguments: a function and a string for the new type name. Any string is allowed except for the names of the existing types whether they are standard types or custom types. The return value of the function, in the first argument, is the base model for the new type. The new type value will be available as a property of the global Store hash.
Store["modifyType"]((){
let(myFunction: <sample: "string"> {
return sample.slice(0, 3);
});
return myFunction;
}, "short string factory");
To declare a reference as a custom type simply assign it to the custom type name as a property of the Store object:
let(
reference: Store["my Custom Type"]
);
Type creation may occur at any level of the scope chain, but remains lexically bound to the scope where it is created like any reference. This means a custom type declared in a child block will not be available to the parent block, but it will be available to all child and descendant scopes.
This is an incomplete list of things that will throw an error in this language.
+ or - character.? and not using a #, or the opposite, within the same grouping. A ternary statement requires use of both syntax characters.:, ?, and # characters expect to be followed by a reference, literal value, or a parenthesis grouping.do loop without an until keyword.until used without association to a do loop.prettydiff/simple is a public repo on GitHub by prettydiff. Simple Language, a language that is syntax simple and structally dense.
It declares the CC0-1.0 license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2017-06-18. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Beautifier and language aware code comparison tool for many languages. It also minifies and a few other things.
Building better developers by specifying criteria of success
Use a Windows/OSX like GUI in the browser to share files cross OS privately. No cloud, no server, no third party.
Copy paste tool that analyzes the semantic description of all text in the DOM