Wildest programming language idea
What is your wildest programming language idea? This could be fun (silly) ideas or really cool and useful ones.
Go!
Also on le twatter: https://twitter.com/replit/status/1275525512861900800
Make a language with the exact same syntax as ENGLISH. For example:
"This is a comment."
Create a new variable named answer.
Have the variable named answer store the value of 10.
"Don't forget, grammar and spelling matter!"
If the variable answer is equal to 10, then do the following:
1. Add a value of 5 to the variable.
2. Create a new variable named question.
Otherwise, do the following:
1. Exit the function.
Now, you can say that you're favourite language is English!
Print the following sentence to console: "Well LOL"
Call the function under the name of "Test123"
Declare a global array called "Drinks" with content:
Index zero has: "Tea"
Index one has: "Coffee"
Index two has: "Peach Juice".
Declare a function under the name of "Test123":
1. Pick a random item from the list called "Drinks", and put it in a variable called "drink"
2. Print the variable "drink" to the console.
3. Exit the function.
LOL
@johnstev111 easy to use!
@DynamicSquid As long as you are a fluent English speaker.
And all English lessons are now coding lessons too.
@DynamicSquid Simple way of making school even more interesting than it already is...
Change language to python
@awesome10 The point is that it's English
@johnstev111 exactly
@DynamicSquid You have to deal with synonyms though
@DynamicSquid dude that lang is good (english grammar lang)
@nk1rwc I know. But this language cannot accept internet slang: e.g. lol or lmao.
You also have to laboriously type abbreviations, i.e. expanding to id est, and e.g. expanding to exemplis gratis.
@DynamicSquid lol i think the name for it already exist, lookup pseudocode
Was that you're intentional or can I make fun of you @DynamicSquid
oh ok @DynamicSquid
@ChezCoder So correct
Try Chinese instead of English?
Hello world would be:
打印 “你好世界”。
This prints whatever you enter:
a 设为 输入(“输入:”)
打印 a
@DynamicSquid that would make math problem solving easy.
To implemement this look for a NLP library for your language
To improve on that idea, try spelling everything backward!
".tnemmoc a si sihT"
.rewsna deman elbairav wen a etaerC
.01 fo eulav eht erots rewsna deman elbairav eht evaH
"!rettam gnilleps dna rammarg ,tegrof t'noD"
:gniwollof eht od neht ,01 ot lauqe si rewsna elbairav eht fI
.elbairav eht ot 5 fo eulav a ddA .1
.noitseuq deman elbairav wen a etaerC .2
:gniwollof eht od ,esiwrehtO
.noitcnuf eht tixE .1
@DynamicSquid https://github.com/pannous/english-script
I was thinking of it and even about using natural language processing libraries to do it. But it kind of exists already.
@CSharpIsGud oh wow lol
@Barry123 WOOHOOOO!!!!! CHINESE DA BEST!
Woohoo!
Wow that would be cool, lol
Print "Quack!".
@Barry123 我为此使用了翻译器。没有意义。
@DynamicSquid well... isn't visual basic [kinda] like that?
@DynamicSquid Been done. See: Shakespeare language, Lingo language, etc
@Barry123 WOO Chinese!
to make the language more realistic, it needs bad error messages
>>> vtrjfeuiUBYhujuNJNJuj
I don't understand that.
even worse, there is no evaluation before code is run.
if there is bad language (profanity, ect), that will also have an error.
# user runs program with swear word.
WATCH IT!
theres something to make ur lang more realistic
@DungeonMaster00 lol nice idea!
Python
print("I am easy.")
English
Print the following sentence to console: "Hey, why are my strings harder than a snake?"
english programming language is kinda pseudocode @DynamicSquid
@DynamicSquid there is a language exactly like that called ~English on Esolang.org, here's the link: Esolang>Wiki>~English, yu should read the article it seems nice.
If chicken is the best:
ch1cken will post this
@DynamicSquid That's sort of like lolcode
@DynamicSquid Use GPT-3 from OpenAI.
@DynamicSquid Let's see how far we can make this go: Encode.
@Theboys619 Are we done with Encode? I forgot that I had broken the syntax highlighter in some obscure, weird way, but I didn't know what was wrong.
@xxpertHacker lol that's cool! could you link the github page? I couldn't find it on the website
@DynamicSquid You know what? I was never given the GitHub page myself :).
@RohilPatel Is there an actual GitHub page? Is Encode dead? (or is it encodedead?)
Are we keeping the old docs?
Sorry I haven't gotten to much of it since school. I just have been getting stacked with homework. And I kinda forgot about it. I still want to work on it though since we got quite a bit of it somewhat done. @xxpertHacker
@Theboys619 Can you link the github page?
Yea sure. https://github.com/Theboys619/EncodeLang. @DynamicSquid
Sorry about not giving the github @xxpertHacker
@Theboys619 Oh ew, it's js, nvm lol
It's not up to date though.
Gottem. At least its TS a 1/3 of a step up from JS.
@Theboys619 I haven't been working on it either, neither has Rohil, so it's okay.
I'll go put the GitHub link on the docs website though.
I could remove the dynamic functionality from the server, allowing us to host the docs on GitHub instead, should I or not?
I mean its up to you for that. I don't really care where the website is. Probably ask Rohil. @xxpertHacker
@firefish I dont want to learn english as twice as much.
@DynamicSquid Nice idea! I think I will try to make something like that if that's ok with you
@DynamicSquid i know this is from like...5 months ago but i've decided to make a lang like this :D
@NoNameByProgram cool! Could I take a look at it?
@DynamicSquid sure! it's one of my first langs :/
https://repl.it/@LiteDev/EnglishCompiler
@DynamicSquid except you have to memorize the exact syntax, it's long, and if you suck at spelling, well yeah, you get it (hopefully!)
while True:
exec("make me a new language!!")
@DynamicSquid
So...
Run 10 laps around my house
say 'elmo knows where you live'
eat some pasta
destroy bob's computer
build me a house for free
display on screen 'Hello World'
set the variable A to a random number between 1 and 10
ask 'Guess my number between 1 and 10' and set Reply to the returned input
if variable A is equal to variable Reply, display on screen 'Well done!'
quit program
Nice idea!
@DungeonMaster00 lol and then:
#user runs program using "cuz" instead of "because."
USE CORRECT SPELLING OR ELSE!!
this is beautiful @DynamicSquid
@DynamicSquid
Hack DynamicSquid.Bank()
Successfully Stole 50000
@DREWNOLT or better yet:
#my program is just h
good job, best letter of the alphabet but not even a program.
I think this is amazing lol @AnthonyMouse
If someone actually figured out how to do a print statement…(without a gibberish string) I’d be impressed lol @BlakeLeee
>>> f
F TO PAY RESPECTS
>>ctrl+q
Press CTRL+Q to pay _dis_respects
>>> blue
da ba dee da ba die
@DabDatBass ok
>> among us
imposter
vent
a thing
crewmate
gwbrw3gyurgy5t5gy4gi455gu
>>> Open a new web page with URL "https://among.us"
lol nope
>> >>
a console line
@Daniel3210 "snake" LOL. Python is two things, a snake and a programming language.
@DynamicSquid you're looking for ~English
you can support the addition of ~English here.
@firefish This would make programming SO much easier
@DynamicSquid If this were real there would be a lot more programmers in the world and I bet most of them would use English. Lol
Unexpected English syntax error: Dangling modifier at 'Having finished the promise, print it to the console' (185:1)
@DynamicSquid I have the exact same idea! I'm trying to make it so that there's this kind of thesaurus thing and however you phrase something or whatever you use it's come out with the same result.
Something like:
Say "Hello world!"
or
Make a variable called "x" and get user input for x.
Through analyzing what one wrote (identifying what words and how they relate to each other) a fully working language could be made
that wud be a lot of typing....
I have no ideas, I am lazy.
I present...
Cxx
A static language that is weakly typed with implicit type coercion no matter what you do. For example:
int number = 5;
Console.Log(typeof number);
Your output will be:
<= Array[5]: [ Number, String, Boolean, Array, Null ]
Now, imagine you have another number:
int number2 = 10;
Adding them together gives:
<= "105"
Due to type coercion. Also, the same thing does not happen to strings:
String number1 = "5";
String number2 = "10";
Console.Log(number1 + number2);
<= Error: Cannot add two arrays
Due to strings being converted into Arrays.
Because of type coercion, this is logic:
5 == "100" => true // (both can be converted into booleans of true)
0 == 0 => false // (0 is not the same as false)
2 == 1 => true // (2 = true = 1)
"string" == "string" => false // (they have become arrays and require a deep equal in order to be true)
"5" == "2" => false // (same problem as above)
(Char)"5" == (Char)"2" => true // (both have become booleans due to explicit type)
Due to the nature of RegExp, RegExp has not been considered a type. It is considered a substance. A substance is that of a type, but it cannot be coerced for it is too pure. Substances are similar to classes, but they are not.
Substance.RegExp myRe = (new)Substance.RegExp(@"[^\d][\d\w]+"gi);
Console.Log(typeof myRe); => Substance.RegExp
Equalities with substances do not give you sane answers.
Substance.RegExp myRe = (new)Substance.RegExp(@"[^\d][\d\w]+"gi);
Substance.RegExp myRe2 = (new)Substance.RegExp(@".+"gi);
myRe == myRe2 => How Dare you Even Try To Compare Substances! Do you even know THE tRue Po𝑤͙͎̔̈́͠𝑒̦͔̙̓̓͌𝑟̡̫͌͑͘͜ o̸͖͚̓͆͠͝f̴̨̡̢̜͙̣̗͎̗̮̤̮̞̘̻͆̄̾̾͑̅͋͋̋͠ͅ ̶̧̧̡̱̳͔̙̬͈͈͍̗̊̌̊͌͑̓̍́̃͝s̴̢̨̞̩̱͈̙̥͖͎͖̭̣̠̓̔̔͊́̊̌̈̄̽̽̇̓͌͐͜͝ͅu̷̡̡̳̻̣̟͍̥͍͉̤̦̟̫͓̖͑̀̏͒̓͛̉̓̂̇ç̸̛͖̖̘̠̲̫̜̮̭̫͎̭͚̻̯̘̌͆̆̑͌̑̃̍̈́͒͊͘̕̚̚͝h̸̢̨̡̤̯͎͓̞͍͇̖̖̼̝͆̀̓̀̋͛̑̚ ̵̭̺̲̻̳͓͇̲͛̒̈̔̀̋̓̂̓̾̐͆͒̂͝͝t̸̞̩͙̖̞̱̭̟̭̮͉̲̠̊̑̀̌̋͆̄͂̑͑́͜͠h̵͉̰͆̔̊̐̈́͂̃̄̑̃̋̊͛͂͌ï̴̢̧͍̳͍̅̈́͛̑̓͗̿̒͌̿͛̒̄̚͠ṇ̵̢̾̊̄̈̏̎̍͐̅̌̔̀̕͝g̸̡̻̟̭͇̤͓͙͕̫̿̋͗͑͗̃̄̈́͝s̶̤͕̻̼̣͓̻̤̫͇̥̱̮͖͕̳̆̉̿̅̋̋͛̐̽͘͜ ̸̝̓̿́̎̓͘ỵ̵̨̧̯͍̱̫̲̘̩̘̏͋͑o̶̡̲̥͙̣̥̝̰̣͗͐̂͗̄̓̈́͜ű̵̠͐̓̋̓͐̊̃̿̚͠ ̵͓͉̕s̷̡̖̭̥̫̼̥̒̇͋́̏̀̚m̷͇͈̗͚̗͉̩̖̹͍͉͖͔̼̅̍̓̑̈̋̃͛͛̕a̵͚̣̯̫̮̬̞͚̙͎̹̋̈́̅̄̐͒̋̈́̇́̚͝ḽ̸̗̬͍̫̣̠̿̓͆l̷͖͕̣̳͉͙͇̀͋͒͋̊̉̄̅̀͝͠ ̴̡̡̛̻̟̖͍̘̃̈͐͛̌́͂͂́̑̃͌̆̋̽̚b̸͇̭̦̬̝͔̈́͂̊͌̿ȑ̷̨͉̱̬̮̩͉̘͎̩̩̙͓͙̊̈́́͊̿̾͠à̸̡̳̝̫̘̯͙͚͎̺̋͛̔̔͒̐͆͌̈́̕i̸̜͆̿̈́͑͌̏̂̑̾̈̎͝n̵̢͚̥͈̰͚̐̐̅́̌̉̃͆͛̈́̃̇ ̸̤̲̲͕̘͇̞͔́͊̃͐͑̅̿̓̾̊̈́̕̕͜p̵̡̖̖̙̝̬̪͈̙̖͓̙͚͛r̴̛͔̳̺̺̪̓͒̈́̄̈́͌̔̑̿̏̕ȍ̸̢̠̖̩̫͕͔̣̘͕̳̽̏̾̈̆̔́̈̄͘͘ͅģ̸̛͇̿̐͗̾͂̆̀̈́̌̋̋̍̑̈́͠ř̶͈͚̥̱͚̹͉͙̯̞͓̬̑̕à̷̰̲͕̯͇͓̖͉͚̒̉͜ͅm̶̨̦̰̱̪̤̻̯̙̔͆̈́͐́̚͝m̵̡͔̰͇͓̮̣̱̞̜̥̣̤̂͜e̶̛̠̝͉r̵̢̧̛̹͎̜̘͙̻̫̙̦̻̜̟͕̱͑̃̍͌̈́̃̓͊̿̕͜
Funnily enough, no errors are thrown.
Now, to define a function, you do:
void FunctionName(int arg1, int arg2) {
return arg1+arg2;
}
Of course, a return value is not required. Return values follow the same implicit type coercion.
Surprisingly, you can convert functions into Substances:
void FunctionName(int arg1, int arg2) {
// Code
}
(Substance.Generic)SubtanceFunction = FunctionName;
However, the function has become a substance, but the code does not. This means, comparing it to other Substances will give you the same result as the RegExp had:
void Function1(int arg1, int arg2) {
// Code
}
void Function2(int arg1, int arg2) {
// Code
}
(Substance.Generic)SubstanceFunction = Function1;
(Substance.Generic)SubstanceFunction2 = Function2;
SubstanceFunction = SubtanceFunction2 => How Dare you Even Try To Compare Substances! Do you even know THE tRue Po𝑤͙͎̔̈́͠𝑒̦͔̙̓̓͌𝑟̡̫͌͑͘͜ o̸͖͚̓͆͠͝f̴̨̡̢̜͙̣̗͎̗̮̤̮̞̘̻͆̄̾̾͑̅͋͋̋͠ͅ ̶̧̧̡̱̳͔̙̬͈͈͍̗̊̌̊͌͑̓̍́̃͝s̴̢̨̞̩̱͈̙̥͖͎͖̭̣̠̓̔̔͊́̊̌̈̄̽̽̇̓͌͐͜͝ͅu̷̡̡̳̻̣̟͍̥͍͉̤̦̟̫͓̖͑̀̏͒̓͛̉̓̂̇ç̸̛͖̖̘̠̲̫̜̮̭̫͎̭͚̻̯̘̌͆̆̑͌̑̃̍̈́͒͊͘̕̚̚͝h̸̢̨̡̤̯͎͓̞͍͇̖̖̼̝͆̀̓̀̋͛̑̚ ̵̭̺̲̻̳͓͇̲͛̒̈̔̀̋̓̂̓̾̐͆͒̂͝͝t̸̞̩͙̖̞̱̭̟̭̮͉̲̠̊̑̀̌̋͆̄͂̑͑́͜͠h̵͉̰͆̔̊̐̈́͂̃̄̑̃̋̊͛͂͌ï̴̢̧͍̳͍̅̈́͛̑̓͗̿̒͌̿͛̒̄̚͠ṇ̵̢̾̊̄̈̏̎̍͐̅̌̔̀̕͝g̸̡̻̟̭͇̤͓͙͕̫̿̋͗͑͗̃̄̈́͝s̶̤͕̻̼̣͓̻̤̫͇̥̱̮͖͕̳̆̉̿̅̋̋͛̐̽͘͜ ̸̝̓̿́̎̓͘ỵ̵̨̧̯͍̱̫̲̘̩̘̏͋͑o̶̡̲̥͙̣̥̝̰̣͗͐̂͗̄̓̈́͜ű̵̠͐̓̋̓͐̊̃̿̚͠ ̵͓͉̕s̷̡̖̭̥̫̼̥̒̇͋́̏̀̚m̷͇͈̗͚̗͉̩̖̹͍͉͖͔̼̅̍̓̑̈̋̃͛͛̕a̵͚̣̯̫̮̬̞͚̙͎̹̋̈́̅̄̐͒̋̈́̇́̚͝ḽ̸̗̬͍̫̣̠̿̓͆l̷͖͕̣̳͉͙͇̀͋͒͋̊̉̄̅̀͝͠ ̴̡̡̛̻̟̖͍̘̃̈͐͛̌́͂͂́̑̃͌̆̋̽̚b̸͇̭̦̬̝͔̈́͂̊͌̿ȑ̷̨͉̱̬̮̩͉̘͎̩̩̙͓͙̊̈́́͊̿̾͠à̸̡̳̝̫̘̯͙͚͎̺̋͛̔̔͒̐͆͌̈́̕i̸̜͆̿̈́͑͌̏̂̑̾̈̎͝n̵̢͚̥͈̰͚̐̐̅́̌̉̃͆͛̈́̃̇ ̸̤̲̲͕̘͇̞͔́͊̃͐͑̅̿̓̾̊̈́̕̕͜p̵̡̖̖̙̝̬̪͈̙̖͓̙͚͛r̴̛͔̳̺̺̪̓͒̈́̄̈́͌̔̑̿̏̕ȍ̸̢̠̖̩̫͕͔̣̘͕̳̽̏̾̈̆̔́̈̄͘͘ͅģ̸̛͇̿̐͗̾͂̆̀̈́̌̋̋̍̑̈́͠ř̶͈͚̥̱͚̹͉͙̯̞͓̬̑̕à̷̰̲͕̯͇͓̖͉͚̒̉͜ͅm̶̨̦̰̱̪̤̻̯̙̔͆̈́͐́̚͝m̵̡͔̰͇͓̮̣̱̞̜̥̣̤̂͜e̶̛̠̝͉r̵̢̧̛̹͎̜̘͙̻̫̙̦̻̜̟͕̱͑̃̍͌̈́̃̓͊̿̕͜
Finally, if you try to compare a normal function to a substance function, you get:
void NormalFunc(int arg1, int arg2) {
// Code
}
(Substance.Generic)SubstanceFunc = NormalFunc;
SubstanceFunc == NormalFunc => 1
1
is the result you will get no matter what is being compared to any substance.
And that is all for this language! Rumors are that JavaScript is written on top of Cxx.
@Coder100 my head hurts...
@Coder100 The first part, it already exists, JS
@Coder100 That's C#... You just simply modified mscorlib.dll
@adityaru I can't tell you how much I hate JS because of that
for highlighting yes @johnstev111
@Coder100 syntax is so similar, YOU HAVE BEEN INSPIRED wops caps
LOL well don't all static languages have similar syntax literally 3 of them are nearly the same
int c = 5;
int cpp = 6;
int cs = 7;
LOL
@johnstev111
@Coder100 This is the best part: SubstanceFunction = SubtanceFunction2 => How Dare you Even Try To Compare Substances! Do you even know THE tRue Po𝑤͙͎̔̈́͠𝑒̦͔̙̓̓͌𝑟̡̫͌͑͘͜ o̸͖͚̓͆͠͝f̴̨̡̢̜͙̣̗͎̗̮̤̮̞̘̻͆̄̾̾͑̅͋͋̋͠ͅ ̶̧̧̡̱̳͔̙̬͈͈͍̗̊̌̊͌͑̓̍́̃͝s̴̢̨̞̩̱͈̙̥͖͎͖̭̣̠̓̔̔͊́̊̌̈̄̽̽̇̓͌͐͜͝ͅu̷̡̡̳̻̣̟͍̥͍͉̤̦̟̫͓̖͑̀̏͒̓͛̉̓̂̇ç̸̛͖̖̘̠̲̫̜̮̭̫͎̭͚̻̯̘̌͆̆̑͌̑̃̍̈́͒͊͘̕̚̚͝h̸̢̨̡̤̯͎͓̞͍͇̖̖̼̝͆̀̓̀̋͛̑̚ ̵̭̺̲̻̳͓͇̲͛̒̈̔̀̋̓̂̓̾̐͆͒̂͝͝t̸̞̩͙̖̞̱̭̟̭̮͉̲̠̊̑̀̌̋͆̄͂̑͑́͜͠h̵͉̰͆̔̊̐̈́͂̃̄̑̃̋̊͛͂͌ï̴̢̧͍̳͍̅̈́͛̑̓͗̿̒͌̿͛̒̄̚͠ṇ̵̢̾̊̄̈̏̎̍͐̅̌̔̀̕͝g̸̡̻̟̭͇̤͓͙͕̫̿̋͗͑͗̃̄̈́͝s̶̤͕̻̼̣͓̻̤̫͇̥̱̮͖͕̳̆̉̿̅̋̋͛̐̽͘͜ ̸̝̓̿́̎̓͘ỵ̵̨̧̯͍̱̫̲̘̩̘̏͋͑o̶̡̲̥͙̣̥̝̰̣͗͐̂͗̄̓̈́͜ű̵̠͐̓̋̓͐̊̃̿̚͠ ̵͓͉̕s̷̡̖̭̥̫̼̥̒̇͋́̏̀̚m̷͇͈̗͚̗͉̩̖̹͍͉͖͔̼̅̍̓̑̈̋̃͛͛̕a̵͚̣̯̫̮̬̞͚̙͎̹̋̈́̅̄̐͒̋̈́̇́̚͝ḽ̸̗̬͍̫̣̠̿̓͆l̷͖͕̣̳͉͙͇̀͋͒͋̊̉̄̅̀͝͠ ̴̡̡̛̻̟̖͍̘̃̈͐͛̌́͂͂́̑̃͌̆̋̽̚b̸͇̭̦̬̝͔̈́͂̊͌̿ȑ̷̨͉̱̬̮̩͉̘͎̩̩̙͓͙̊̈́́͊̿̾͠à̸̡̳̝̫̘̯͙͚͎̺̋͛̔̔͒̐͆͌̈́̕i̸̜͆̿̈́͑͌̏̂̑̾̈̎͝n̵̢͚̥͈̰͚̐̐̅́̌̉̃͆͛̈́̃̇ ̸̤̲̲͕̘͇̞͔́͊̃͐͑̅̿̓̾̊̈́̕̕͜p̵̡̖̖̙̝̬̪͈̙̖͓̙͚͛r̴̛͔̳̺̺̪̓͒̈́̄̈́͌̔̑̿̏̕ȍ̸̢̠̖̩̫͕͔̣̘͕̳̽̏̾̈̆̔́̈̄͘͘ͅģ̸̛͇̿̐͗̾͂̆̀̈́̌̋̋̍̑̈́͠ř̶͈͚̥̱͚̹͉͙̯̞͓̬̑̕à̷̰̲͕̯͇͓̖͉͚̒̉͜ͅm̶̨̦̰̱̪̤̻̯̙̔͆̈́͐́̚͝m̵̡͔̰͇͓̮̣̱̞̜̥̣̤̂͜e̶̛̠̝͉r̵̢̧̛̹͎̜̘͙̻̫̙̦̻̜̟͕̱͑̃̍͌̈́̃̓͊̿̕͜
@NoelB33 *grammar [zalgo removed]
Truly the cider god
@Coder100 Looks like JavaScript to me, as expert JS writer.
@Coder100 I only replied on this
@randomlylelo me too XD >:)
@Coder100 How Dare you Even Try To Compare Substances! Do you even know THE tRue Power of such things you small brain programmer [removed zalgo]
@Coder100 Why this?
How dare you even try to compare substances! Do you even know the true power of such things, you small-brain programmer?
hm idk i forgot i even wrote this @RahulChoubey1
@RahulChoubey1 Yes I put it mscorlib.dll
@firefish What is that tho?
@RahulChoubey1 Windows dynamic linked libraries if you don't know something, use google
@Coder100 You put too much effort into this
@randomlylelo same...
You could some up with a better name, because Cxx sounds like a few other programming languages I've heard [email protected]
how about
XXC @bennyrobert
I guess it could catch on... but it might get confused with other languages. Something original... like Viper! No, kidding... @Coder100
I've been thinking about making a language entirely in Spanish, so you could end up with something like this:
público entero[] x = [1, 2, 7, 3]
por-cada i en x {
poner(i)
}
@SixBeeps the only Spanish I know is bonjour
@DynamicSquid Wow, I'm impressed. Where'd you learn that from?
@SixBeeps my german class
@SixBeeps decent non-english programming languages are severly lacking... you should go for it
@rediar Ah, but I should probably wait until I know more enough about compilers and all that jazz.
@SixBeeps Just take code, run a search and replace for spanish keywords into english, et voilá I don't speak spanish sorry
@SixBeeps I almost make a Spanish C++ transpiler.
@SixBeeps your bio is is chinese
Why you need it spanish?
@ZDev1 Bruh, that's Japanese
@Centslord ok
idc anyway
For some reason @SixBeeps, i just upvoted everybody's comments on this √√√√ check check and check
@IndyCarter all I see is square root square root square root square root
@IndyCarter √ is the square root symbol
@johnstev111 it look like check
@johnstev111 it look like check
@SixBeeps but it square root
grilling apricots on a barbecue
Thank you @SixBeeps!!!!
@Wilke000 The words grilling apricots on a barbecue is a meme. Have you not heard of it?
No @johnstev111 and lol @SixBeebs
@DynamicSquid @SixBeeps Me too same,
I just know Bonjour of Spanish.
but trying to learn more :)
@StudentFires WOW Seems funny :D
@firefish Don't care
Bonjour is French. Hola is Spanish. (I learn Both) @DynamicSquid @SixBeeps @PattanAhmed
et voila is French @firefish
@Daniel3210 r/woooosh
@SixBeeps, if you want to pursue translating a language into Spanish a lot of languages have something called "#define," which basically creates a variable that calls a function. For example "#define hand for" would define hand as a stand-in for "for."
@JoeyRueff "A lot of languages" you mean just C/C++?
@SixBeeps, yeah, I thought others might have something like #define, but I wasn't sure.
@JoeyRueff Ah ok. Yeah, I could do something like that, but the Spanish idea is what I'd do if I ever need to make my own language.
@DynamicSquid oh cool you can speak in le baguette accent
@Wilke000 no to what exaclty?
@Wilke000 but why you repost no
I didn't realize it @firefish
@Wilke000 didn't realise what?!?!?
# not even spanish
@Wilke000 haha square root go brrrr
I present to you my truly innovative language: Singularity
You are only allowed one variable per script and it must be Elon_Musk
All functions can only return values in binary
When the script ends the program will automatically print the number 3 trending result on Google Trends
Your output will be emailed to you within 8-10 business days during which time we convert your program your program into punch cards.
All errors are returned to you with a snarky comment about your hygiene
All while loops are infinite no matter what you do
The documentation is written in Ancient Sanskrit and all attempts of trying to translate it have resulted in mildly unsuccessful careers, Although we do provide a good Dental plan
@SpaceFire well that was a roller coaster
@SixBeeps thanks? idk if that was a compliment lol
@SpaceFire Maayyybeeee....
@SixBeeps thank you for that so helpful clarification.
@SpaceFire You're very much welcome not
@SixBeeps your indecisiveness astounds me
@SpaceFire thank you
@DynamicSquid that is nice. i kinda wanna make this into a language just for the sake of it but i have a weak spot in Ancient sanskrit
@SpaceFire Yeah... I've forgotten half the vocabulary of Ancient Sanskrit too...
@SpaceFire
All errors are returned to you with a snarky comment about your hygiene
snarky comment about your hygiene
animal crossing wild world resetti end line intensifies
@SpaceFire soooo xkcd
If I had multiple files, would it be 1 script for each of those, or 1 script per [email protected]
I present to you my truly innovative language:
???
Code will only compile and run when the programmer has died. Therefore, no one really knows the syntax of this language because we don't know how to raise people from the dead, yet...
@Warhawk947 dude you're a genius...
@DynamicSquid lol thx
perfection
@Warhawk947 I have a gut feeling it's a C-style language. Only god can know.
@Warhawk947 for when you actually have to spend sweat tears and blood on a project 😜
But surely, the children of the first programmer could learn from their ancestor, by watching the program run after the programmer has died, and pass the knowledge down the [email protected]
The chicken
for x in chicken:
print("no")
Is translated in chicken to:
chickenchickenchicken chicken chickenchicken chickenchickenchickenchickenchicken:
chicken("chickenchicken")
a language that runs a completely randomly generated program, and once it's done you give it an emoticon to express how happy you were with the program, and eventually you can train it to run the program you want.
My wildest programming language ideas are
Objective BASIC
Like an object-oriented version of BASIC. (might actually make)
Adapt
A programming language where you can dynamically change the syntax with the ability to rewrite the program while it is running and variables with multiple types simultaneously. (in development)
XPL
A language based on XML (https://github.com/amazingmech2418/xpl)
Link
A language based on JSON that could allow programming via a flowchart. (https://github.com/AmazingMech2418/Link-Programming-Language)
Inventor
A language which is entirely based on transpiling. (https://github.com/AmazingMech2418/Inventor)
Possibly the worst programming language I have made actually. LOL!
X
A C-style language with a full graphics library, a safe memory system without buffer overflows, with prototypal OOP, and with a powerful mathematics library. (in planning stage currently)
@AmazingMech2418 X is already here. It is called Rust. lol
@AmazingMech2418 oh wow wait how did I. It see this earlier sick! Can’t waot for X
@AmazingMech2418 There's already modeling software with the name of "Inventor". You might need to rename it
A language that throws errors no matter what you add
AKA: no correct syntax
@Codemonkey51 I can do that, simple C# code right here:
string cmd = Console.ReadLine(); // input command
if (true) { throw new Exception("Syntax Error"); }
syntax error: expected \r\n not \n on line endings
try again @johnstev111
@Codemonkey51Syntax Error: line 1: Expected Carriage Return, found EOL
P programming language that is only ONE character (basically reads your mind)
and the character is 1 so binary but one instead of two.
SplatLang - A Splatoon themed programming language
sorry for terrible joke that could have come from sans himself
Basics:
- file extension:
.splat
- as much esolang as useful
- splatoon themed syntax (you could have guessed)
- safe like
C#
- a few good data types
- a built in help method
- and more!
Woomy - Print method
The method for printing something to the console is woomy()
. This is a sample of using woomy()
:
Input:
woomy("Hello, Inkopolis!")
// this is a single line comment comment
/^ this is a squid comment.
goes over multiple lines.
named that because the ^s look kinda like squids.
will end with:
^/
Output:
Hello, Inkopolis!
Veemo - Builtin slowprint
method.
veemo()
will print something to the console, but wait in between each character printed.
A value for how much time to wait is measured in milliseconds
Input:
veemo("Hello, octo valley!", 60)
Output (with 0.06 seconds in between characters:
Hello, octo valley!
Getting input
The method for input is playAnotherBattle()
with the prompt inside the ()
s. If you put in nothing, then the prompt will automatically be >>
.
Input:
playAnotherBattle("Will you rescue the Great Zapfish?\n>> ")
Output:
Will you rescue the Great Zapfish?
>> (halts until enter key is pressed)
Data Types
SplatLang supports nine data types, most of which are pretty much the same as some Java data types.
Integral:
byte
- A 1 byte integral valueshort
- A 2-byte integral valueint
- A 4-byte integral valuelong
- An 8-byte integral value
Float-point:float
- A 4-byte float-point valuedouble
- An 8-byte float-point value
Characters:char
- A single ASCII/Unicode character surrounded by two'
sstring
- A sequence of ASCII/Unicode characters surrounded by two"
s
Other:bool
A boolean value. SplatLang boolean values are:fresh
- equivalent totrue
in other languagesunfresh
- equivalent tofalse
in other languages
void
- No specific type, can be any other type
Variables, Constants, and Lists
Look at the code below (java syntax highlighting (not java code) ):
// integral (variable)
byte thisIsSoShort = 100
short aLittleLonger = 10000
int medium = 1000000000
long lengthy = 1000000000000000
// float point (list)
float shortFloat[] = {1.11111111, 300.12345, 0.0123}
double longFloat[] = {1.11111111111111, 56633.22134552444}
// characters (constant)
con char delta = 'Δ'
con string message = "SPLATLANG IS AWESOME!!!!"
// other
con bool djOctavo = unfresh
void thingsThatAreCool[] = {120, 10010, 2000000001, 14367424553, 6.54321, 3.13432444246543, 'Ω', "YEET!", fresh}
That shows variables, lists, and constants in one program.
Operators
Here are the operators:
// basic math
+ // addition
- // subtraction
* // multiplication
/ // division
% // return remainder
// quick basic operations
+= // increase by certain amount
-= // decrease by certain amount
*= // multiply by certain amount
/= // divide by certain amount
%= // divide by certain amount but return remainder
++ // increment by 1
-- // decrement by 1
//comparing
== // equal to
!= // not equal to
< // less than
<= // less than or equal to
> // greater than
>= // greater than or equal to
// boolean logic
&& // and
|| // or
! // not
Conditionals
The conditionals are if
, also
, and othersUnfresh
.
int nklings = 1000
int octolings = 750
if ^inklings == 1001^/^ unfresh ^/ {
woomy("1001 inkings in inkopolis\n")
}
also ^inklings == 1000 && octolings == 1000^/^ unfresh ^/ {
woomy("Inkling and octoling numbers equal, they are" + inklings + "\n")
}
othersUnfresh/^ this will run since the others are unfresh ^/ {
woomy("Unknown.\n")
Loops
And finally, there are loops. There are while
, for
, and forAllSquids
.
// example 1:
while ^fresh^ {
// infinite loop
woomy("Booyah!");
}
// example 2:
bool isItFresh = fresh
while ^isItFresh == fresh^ {
woomy("I WILL ALWAYS BE FRESH!!!")
}
// example 3:
for ^i = 0; i < 6; i++^ {
woomy(i)
}
// example 4:
aRandomList = {"oof", "yeet", "kobe}"
forAllSquids ^string item in aRandomList^ {
woomy(item)
}
THAT"S IT!!!
bye remind me of typos and stuff
@nk1rwc why the weird names?
@firefish splatoon
@SpicedSpices That's just the name of the language, if there is no reason and he was making up some pseudo-words, that's an acceptable reason.
@firefish probably doesnt explain a lot but here you go https://splatoon.nintendo.com/
@nk1rwc Ah, alright. Yet another, video game I've never heard of.
@DungeonMaster00 squid. I SUMMON THE ALMIGHTY SQUID
you know who I'm talking about
"why the weird names?"
The weird names are a mutlitude of things, the send commands are just the voicelines of the characters put into English, they have no real meaning nor comparable word :/
Make a programming language that is made completely of emojis. Example code:
😀😁😂😃😎😋😃☺😚😃😘🙂😘😍😶😎🤨🤗😋😘😎🥰😨😦🥶😱😨🤯😳🤯🥵🥵🥵😷🤕😡🥺
😫😫🙂😎😣
I dont think that is possible
There are not enough emojies to represent each letter or word. But I could create a random emoji generator. @HENRYMARTIN4
#True False
🍌 = 👍
🍗 = 👎
#functions
▶️ 🧐(‼️): #funciton
❓‼️ = 👍: #if
🆙 😁 #return
⁉️: #else
🆙 🙁 #return
🧐(🍗) #will result in 🙁
🧐(🍌) #will result in 😁
holy frick [email protected]
It's emojicode. @InvisibleOne
There is already emojicode. @HENRYMARTIN4
emojicode is a bit different though. It uses :0 and stuff like that @Daniel3210
@InvisibleOne hello world example from https://www.emojicode.org/ :
🏁 🍇
😀 🔤Hello World!🔤❗️
🍉
It doesn't use :0
at all @InvisibleOne
@HENRYMARTIN4 Have you heard of emojilang? It's a thing
Harry Potter would be nice:
Lumos
Aparecium “Hello World”
name=Veritaserum.reveal(“What is your name”)
Aparecium “Hello”+name
Avada_Kedavra
Some sort of language a bit like LOLCODE. example:
sey: 'hello world' plz
make 'variable1' into 'variable1name' plz
repeat [say: 'hello world'] 10 times plz
name iz respond: 'what is ur name' plz
wut if name iz 'MemeMan':
sey: 'hi meme man :P'
if no 'MemeMan': sey: 'hai stranjer' plz
So sey
is kinda like print
in Python, plz
is kinda like ;
in JavaScript, respond
is like input
in python, iz
is like =
, wut if
is like if
, if no
is like else
, and make
is like var
.
I spent too long thinking about this :)
TortureLang: more annoying than brainf***
basics
- File extension:
.tl
. - must have as many semicolons as there are other characters on line
- you cannot have whitespace before actual code.
- no way to comment
- just says
boo, you suck!
when there's an error
worse: - processes 4 lines in one second.
- can only process 32 lines of code.
worst: - you have to wait an hour before output
syntax
Print syntax:
you must write the string on as many new lines as there are characters in string to print each character
1 Writethislineinconsole "Hello world!";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 Hello world!;;;;;;;;;;;;
3 Hello world!;;;;;;;;;;;;
4 Hello world!;;;;;;;;;;;;
5 Hello world!;;;;;;;;;;;;
6 Hello world!;;;;;;;;;;;;
7 Hello world!;;;;;;;;;;;;
8 Hello world!;;;;;;;;;;;;
9 Hello world!;;;;;;;;;;;;
10 Hello world!;;;;;;;;;;;;
11 Hello world!;;;;;;;;;;;;
12 Hello world!;;;;;;;;;;;;
13 Hello world!;;;;;;;;;;;;
Will Supposed to output:
Hello world!
Capture input, variable, and if statement syntax:
there are only three available variable names and here they are:
- VaRiAbLe01
- MYSecoNdvarIABle
- ThIsistHEthiRdaNDlaSTVariabLe
Also, this is the variable assigning sequence,=-_-__=_=
For if statements, the entire output is in braces ({}
) and you can only have one in the entire program
Example:
1 variable VaRiAbLe01 =-_-__=_= captureuserinput ">> ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 if VaRiAbLe01 = "Joemama" {;;;;;;;;;;;;;;;;;;;;;;;;;
3 Writethislineinconsole "is fat"{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4 is fat;;;;;;
5 is fat;;;;;;
6 is fat;;;;;;
7 is fat;;;;;;
8 is fat;;;;;;
9 is fat};;;;;;;
10 };
Else syntax:
Elses work the same way ifs do
Same example with else statement:
1 variable VaRiAbLe01 =-_-__=_= captureuserinput ">> ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 if VaRiAbLe01 = "Joemama" {;;;;;;;;;;;;;;;;;;;;;;;;;
3 Writethislineinconsole "is fat";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4 is fat;;;;;;
5 is fat;;;;;;
6 is fat;;;;;;
7 is fat;;;;;;
8 is fat;;;;;;
9 is fat;;;;;;
10 };
11 else{;;;;;
12 Writethislineinconsole "shut up";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13 shut up;;;;;;;
16 shut up;;;;;;;
17 shut up;;;;;;;
18 shut up;;;;;;;
19 shut up;;;;;;;
20 shut up;;;;;;;
21 shut up;;;;;;;
22 };
That's about it Here's a sample program:
1 variable VaRiBbLe01 =-_-__=_= 10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 variable MYSecoNdvarIABle =-_-__=_= captureuserinput "like it? >> ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3 if MYSecoNdvarIABle =-_-__=_= "yes" {;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4 Writethislineinconsole "u are evil";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 u are evil;;;;;;;;;;
6 u are evil;;;;;;;;;;
7 u are evil;;;;;;;;;;
8 u are evil;;;;;;;;;;
9 u are evil;;;;;;;;;;
10 u are evil;;;;;;;;;;
11 u are evil;;;;;;;;;;
12 u are evil;;;;;;;;;;
13 u are evil;;;;;;;;;;
14 u are evil;;;;;;;;;;
15 };
16 else{;;;;;
17 Writethislineinconsole "you are so right";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
18 you are so right;;;;;;;;;;;;;;;;
19 you are so right;;;;;;;;;;;;;;;;
20 you are so right;;;;;;;;;;;;;;;;
21 you are so right;;;;;;;;;;;;;;;;
22 you are so right;;;;;;;;;;;;;;;;
23 you are so right;;;;;;;;;;;;;;;;
24 you are so right;;;;;;;;;;;;;;;;
25 you are so right;;;;;;;;;;;;;;;;
26 you are so right;;;;;;;;;;;;;;;;
27 you are so right;;;;;;;;;;;;;;;;
28 you are so right;;;;;;;;;;;;;;;;
29 you are so right;;;;;;;;;;;;;;;;
30 you are so right;;;;;;;;;;;;;;;;
31 you are so right;;;;;;;;;;;;;;;;
32 you are so right;;;;;;;;;;;;;;;;
33 you are so right;;;;;;;;;;;;;;;;
34 }
Supposed to output this thing:
like it? >> {enter your choice here}
If you choose yes, it will output the following:u are evil
If you type anything else, it will output:you are so righ
The last character was not printed since the computer will ignore anything beyond the 32-line limit.
This is why TortureLang sucks!
@nk1rwc I like the semicolon idea that would truly be annoying lol
@Highwayman yeah i bet there's an error in the examples i posted lol
lol;;;
@nk1rwc
@nk1rwc the semicolon idea would finally teach programmers to write shorter lines of code lol
@DungeonMaster00 Ha that would use up your repl storage so fast
@hello1964 I would do something really bad to the person who makes this in real life.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@DungeonMaster00 Personally, I prefer logicf***
https://esolangs.org/wiki/LogicF---
@RahulChoubey1 It's epic don't judge
@DungeonMaster00 I like the error message part cause it is like saying, "figure it out yourself. Need a line? Screw off"
HahaYes
@HahaYes HahaYes
@HahaYes HaHaNO
@johnstev111 HaHaSquid
@TheForArkLD trademark it
@jeremykyleisgod it worked!
@jeremykyleisgod ™
not &trade
@HahaYes HaHah
™
Something where the syntax changes based on the previous commands. No program has the same rules. Or you can only use each syntax construct x times.
5 for loops, 10 ifs...
@DynamicSquid No. they’re already hard.
@CodeLongAndPros the first style of your programming sounds good. Then you have to make a possibilty of output for every command that you pass into your program.
Hm I actually took a moment to think about this, and you can probably make something very similar to the first idea by just maybe shifting the alphabet around based on the previous line and played with the identifiers in the same way... why am I considering this lol. @CodeLongAndPros
Oh! I thought of another equally silly one! Make a language called "le twatter". For example:
tweet "Hello World!\n"
receive tweet "What is your name? "
post Animal:
public comment legs
public comment colour
story(_legs, _colour):
legs = _legs
colour = _colour
reply DisplayInfo:
tweet "This animal has " + legs + " legs"
account.end
account.ban()
foreach usr in all-users
account.ban(usr)
@DynamicSquid Wish I could do that with real twitter
@DynamicSquid le twatter is probably a great example to demonstrate the sc*nthorpe problem (i censored it just in case)
@AJDevelopment the what problem?
receive tweet should be retweet maybe @DynamicSquid
One language to rule them all.
It will be basically a combination Swift, Go, Lua, and D.
It will have a massive standard library suitable for many projects.
It will have documentation comments via a subset of Markdown.
It will be compiled to efficient bytecode for portability.
The bytecode intepreter will be fast and efficient.
It will have support for both low level and high level programs.
It will be object oriented.
The programs will be class based.
It can have built-in functions equivalent to assembly instructions, to reduce the need for pure assembly.
And most importantly...
Readable syntax.
@DungeonMaster00 That would be interesting!
I am a programming language developer. I love just testing out new things to do with programming languages!
Do you think you'd actually make something like this?
@MocaCDeveloper i might if i get really bored but i would use the llvm library to compile to portable and executable machine code instead of bytecode for performance
@DungeonMaster00 Is llvm a C++ library?
What is llvm, lol.
Me and Coder100 have been talking about transpiling but also compiling my language with the llvm library but we don't know anything about it.
Think you can kinda lay it out and explain it?
@MocaCDeveloper this will basically combine elements of other programming languages into one package. it will also have an optional garbage collector
@DungeonMaster00 So is llvm a C++ library?
@MocaCDeveloper clang is repl.it's c/c++ compiler used.
it uses llvm to compile
it is also used in the official compilers for swift and rust
@MocaCDeveloper i dont know but it's portable and its for compilers
@DungeonMaster00 So llvm can be used with C, correct?
Because C is the language I am writing my language in..
@MocaCDeveloper i dont know
maybe but i would rather use c++ for it's safety and the fact that it's easier to use
@MocaCDeveloper and i might use d if there is llvm library support for making compilers with it.
@MocaCDeveloper d is improved c and c++
@DungeonMaster00 So, what I am getting from this is to:
Transpile my language into C++, then use llvm to compile it..
@MocaCDeveloper hmm i would read tutorials i never used llvm before but it sounds good
@MocaCDeveloper i would try writing compiler with c/c++ and using llvm
but you can do whatever
@DungeonMaster00 yeah I am looking it up. According to my 5 minute research I can use the Clang compiler for it and compile my C code into llvm..
@DungeonMaster00 Yeah I am probably going to switch my C compiler over to Clang since I found a article that explains how to run C code with llvm
@MocaCDeveloper not exactly the best solution, but it may work
im guessing since i never actually created a language bedore
@MocaCDeveloper cool
i would use c++ but good luck with c
@MocaCDeveloper oh cool i found a version of llvm for d
@DungeonMaster00 I don't know anything about C++. Yeah, it's like C but with classes, but I don't understand its syntax.
I am going to attempt to do it with C!
I think using the Clang compiler to run C code directly with llvm will work, but I don't know, seems like that's the same as executing the C code into a .o file.
It will be a learning process, that is for sure!
I will keep you updated if I find out anything interesting over llvm!!
@MocaCDeveloper now to figure out how to install the llvm-d
@DungeonMaster00 I've heard of D I've just have never been motivated by it
OHHH! you should do a mix of evry language here on repl! # A header
code here
#code here
a mix of code syntaxes that make a game or whatever..
Java script
Dictionary oriented programming. Instead of using classes and objects, use an abstract dictionary as a struct. Then you can add functions to the dictionary to make the structs into classes. (Not sure if this has been made.)
@ChristoferK Thank you so much for informing me about this. I was not aware of this style of programming.
A language where you can create your own loops
like
loop repeatUntil {
if condition {
stop
}else {
run
}
}
The condition keyword is the condition that is put into the loop, the stop keyword tells the loop to break, and the run keyword runs the code you put in your loop. Also the loop keyword is for defining loops and after that in this example, repeatuntil, is the name of your loop.
Another cool idea. I'm calling it simplified condition statements.
To use this you have to write a term and an optional bool operator in front of the if then statement:
myVar == if
Say you are going to use that term and operator a lot in an if then statement you could just do this
myVar == if var2 && var3 && var4
This translates to
if myVar == var2 && myVar == var3 && myVar == var4
It much easier to do it the first way. Also you can remove the operator and just do something like this
myVar if == var2 and <= var3 or >= var4
You can also override the operator
myVar == if var2 and <= var3 and var4
Also to exclude variables from this put the conditions in a loop like this ex():
myVar == if var2 and var3 and ex(var4 and var5)
what if you make loops so long and so complicated, that everyone would think you were a coding genius if you did one in under 10 seconds. i.e
ifora (splitseconde33over4pi)(onyyx3302_o5){i++[if chicken is the best
ch1cken will post]++i}
this prints
if chicken is cool,
ch1cken will post this,
2 times.
A language called hack(not for hacking, just a cool name). Dunno how to describe it but the hello world program would look like this: go {hwor}
(built-in variable hwor is 'hello world'
Outputs 'hello world'
Make a function:
new func(series;;argument1;mode;;) {
if:mode = 'positive' {
new int(a) { math.add(argument1, 1) }
new int(b) { math.mult(a, 2) }
new int(c) { math.add(b, 3) }
represent c
}
else if:mode = 'negative' {
new int(a) { math.sub(argument1, 1) }
new int(b) { math.div(a, 2) }
new int(c) { math.sub(b, 3) }
represent c
}
}
Ask me anything I'll give u the hack syntax
In one line: extending Lisp to the 4th dimension.
(apologies for the lengthy post, but I would really appreciate some feedback)
Rome: A thesis for Lisp in the 4th dimension, with fewer parenthesis
Introduction
In the course of it's development, the LISP system went through several stages of simplification and eventually came to be based on a scheme for representing the partial recursive functions of a certain class of symbolic expressions...and it now seems expedient to expound the system by starting with the class of expressions called S-expressions.
-- John McCarthy in the seminal paper that introduced Lisp to the world in April 1960.
Also, from the paper:
An S-expression is then simply an ordered pair, the terms of which may be atomic symbols or simpler S-expressions.
This statement can be expressed symbolically as:
S := (S . S)
Any of the S
on the right hand side can either be a terminal symbol that cannot be further expanded called an atom or it be expanded recursively in the same manner, as another (S. S)
.
Turtles all the way down.
The whole of Lisp is built up from this scheme of S-expressions.
Hmm....So an S-expression is simply an ordered pair (yes, and recursive...)
But why a pair? (Reminds me of Key-Value pair).
Why not three? (Like you know: Key, Relation, Value, like in RDF triplets? )
You know what, better stil...Why not four?
4-tuples. Key, relation, value + time? (like in Datomic clojure DB and datalog etc).
O-expressions
What if, instead of S-expressions, we start with ....say O-expressions
O := (O . O . O . O)
Where each O
can be:
- expanded further as (O . O . O .O)
- or it can be a terminal symbol.
- an S expression (maybe I am not sure about this).
Will we end up with a Lisp like language that's somehow more expressive?
In the same manner, RDF triplets are more expressive than key-value pairs.
Will we be able to programmatically play with time?
Like how including time in the 4-tuple gives datomic time travelling capabilities?
Well, we will find out I guess....
What's in a name
For fun and for clarity, I am using the uppercase greek symbol of Omicron to represent the O in the O-expression.
And I came up with a fun acronym too:
ROME stands for Recursive Omicron Meta Evaluator (ha!) This is the name of the compiler/translator itself.
and the language itself to be called:
Roman: Recursive Omicron Meta Algebraic Notation. (ha ha!).
(In the long tradition of functional languages, everything will be an Expression in Rome, no statements vs expressions dilemmas.
Please...can we at least not have as many parenthesis?
What if we express function composition as:
x f g to mean the same as (g(f(x)))
Look ma! fewer parenthesis.
Lisp uses prefix notation
(add a b)
where a and b are the arguments to the function.
Let's go ahead and use this format for function calls
a b add
Also we need one last thing. Take a leaf out of Elixir/ELM/ReasonML pipe operator. |> We will be using this too in our approach to have fewer parentheses.
Examples of how Rome might look:
Assign 5
to a
.
a = 5 def
Check if a is greather than b
a > b ?
Let it be a fact that the symbol a is greather than b.
a > b def
Nested expressions
(11 19 *) < (9 23 *) ?
or
11 19 *
, <
, 9 23 *
, ?
assign it to. value
a = (11 19 *, 9 23 *, +) def
Define a function to add 3 to any number
add3 (a) (a 3 +) fn
or using the lambda method (=> stands in for lambda)
add3 = ((a) (a 3 +) =>) def
Yeah you can't get rid of all the brackets I think.
Function calls:
4 add3 .
with assigns
a = 4 add3
Find b
.
b > a def
, b < c def
, a = 1 def
, c = 3 def
, b ?
What if the above ended with , b .
instead. Well we'll come to that soon I hope.
Piping function outputs.
3 add3
|> add3
|> 2 add
will eval to
7 2 add
Conditionals
x if (x > 0) ?
Can we do else case like this?
x if (x > 0) or else -x ?
x if (x > 0 ?) else 0 if (x = 0 ?) else -x if (x < 0 ?) or else 1000000 ?
Quote
(+ 2 3)'
O.0: (+ 2 3)
Maybe we can use '.' to send it "into" the system, along the z-axis to evaluate it.
And use - to connect with other fellow functions in the same "plane" of abstraction.
But those are wild ideas, I don't want to get into now.
Can we use @
to denote apply?
apply @
eval |
quote '
bind &
x = (1 2 3)' def
Get h, t, r, e, s, p
(x 1 2 3)'t
Time
We havent defined any explicit timeline manipulating symbols/procedures but def
can be seen as saying to the system "From now on, let it be known to this system that the following is a fact.."
and ?
in a > b ?
can be seen as "Tell me, as of now, is a > b etc etc".
We will try to build up the syntax and semantics of playing with time in later chapters. For now, let's use the following symbol scheme to denote a point in time or a tick (specifically a lamport's time stamp but we will come to that later).
We will represent what NASA calls T0 as .0
or .
to denote now. And T+1 as .1
T-1 as .-1
or ~1
.-1
-- is same as
~1
-- not the same as
.1 - 1 ? --: .0
-- now is
.0
-- same as
.
chicken; worse then python, but 5 letters better than c!
If I eat myself will I get twice as big or disappear completely?
@UnluckyFroggy If I eat air will I become bigger or will the air eat me