Ask coding questions

← Back to all posts
Wildest programming language idea
amasad (2495)

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

Commentshotnewtop
nk1rwc (86)

A scripting language that combines Lua's lightweight syntax with Python's indentation based structure.

Also is strongly typed and more safe.

Yet another thing: You need to have tabs for indentation because I think it's most readable.

Example:

(*a sample program for this idea*)

console.writeline("Hello World!");// hello world program

console.write("Now goodbye");
console.write(" world...");// dark way to repreaent console.write();

int an_integer = 4;// variable syntax

string input = console.prompt(" >> ");// how to capture input

if an_integer == 4 then
    // sorry could only do spaces here
    console.writeline(v"there is an integer with a value of {an_integer}");
else then
    console.writeline("huh");

// loops are fun
int counter = 0;

while counter != 5 repeat
    counter++;
    console.writeln(counter);
int counter2 = 0;
do
    counter2++;
    console.writeline(counter);
until counter >= 10;// Don't forget the semicolon!

for int counter3 = 0, counter3 < 21, counter++ repeat
    console.writeline(v"Loop iterated {counter3} times!");

iterate 100
    // This loop iterates 100 times. You can iterate a loop a certain amount with the iterate keyword
    console.writeline("Filling the console with random stuff...");
string msg = "Go team chicken!";
foreach char ch in msg repeat
    console.write(message=ch, start="<", end="> ");
foreach_rev char ch in msg repeat
    console.write(ch);
(*
foreach_rev is like foreach except it iterates in reverse order
You can do that in Dlang too with something similar
*)
// I'll save the way to make an infinite loop for last

method get_sum(int num1 = 1, int num2)
    // BTW that was an optional parameter right there
    int sum = num1 + num2;
    return sum;

try
    convert.toint("Yeet!");

catch format_exception
    console.writeline("Invalid format");
finally
    console.writeline("Runs whether exception threw or not.");

int array = {5, 3, 1, 2};

do
    console.writeline("INFINITE LOOP OH NO!!!!!!!!!!!!");
    // This is an infinite loop
forever;
(*
There is only string interpolation

All data types:
- string: A sequence of UTF-16 characters
- xstring: A sequence of UTF-32 characters
- char: A single UTF-16 character
- xchar: A single UTF-32 character
- int: A 32-bit integral value
- xint: A 64-bit integral value
- float: A float-point value
- double: A more acurate float-point value
- bool: A boolean value, either true or false

continue and break are keywords for loops. They work the same way as in other languages
*)

Basically this is a safer version of Lua.

Edit: This language is currently called Nova and it is in planning stages

arunaugustine (1)

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
.
octopyBot (35)

chicken; worse then python, but 5 letters better than c!

octopyBot (35)

chicken: dumber than python, but only 5 letters smarter then C!

pythoder (183)

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..

Gameknight2169 (2)

Me and a friend had an idea for a guessing game, but the randint answer would change every 3 seconds. This idea failed, but I did make it so that it would change every time you got it wrong.

johnnyfrancis (2)

Make a language that you just have to enter regular english words and make it do the thing in code!

ImmaEatYouMan (15)

Croissant - Made from C that is more advanced than Lua but a little bit dumber than C. This would be very useful for people wanting to get into coding so they can easily and almost seamlessly move into C then C# and C++ which is very commonly used in the industry

Leroy01010 (72)

all languAGES IN THE WORLD

nk1rwc (86)

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 value
  • short - A 2-byte integral value
  • int - A 4-byte integral value
  • long - An 8-byte integral value
    Float-point:
  • float - A 4-byte float-point value
  • double - An 8-byte float-point value
    Characters:
  • char - A single ASCII/Unicode character surrounded by two 's
  • string - A sequence of ASCII/Unicode characters surrounded by two "s
    Other:
  • bool A boolean value. SplatLang boolean values are:
    • fresh - equivalent to true in other languages
    • unfresh - equivalent to false 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

andliu766 (21)

like this:

ask "What is your name? "
say Hello to the person.

chriswillson (0)

I want a modern language that reads even more like regular English than Python without the punctuation that we've become accustomed to in programming languages. It should write like pseudocode.

maxyang (32)

Lol, got a hilarious idea. BattlLang

torch = print
swordpoint = input
ammo = variable
arsenal = loop

A brilliant example:

ammo thing = swordpoint()
ammo i = 0
arsenal i < 1000:
torch(swordpoint*i)

Barry123 (54)

Harry Potter would be nice:
Lumos
Aparecium “Hello World”
name=Veritaserum.reveal(“What is your name”)
Aparecium “Hello”+name
Avada_Kedavra

YuAndy (14)

You could build one based on Python and simplify everything: <“Hello world”; a>“What’s your name?’; <“Hi, “+a+”!”; This code will ask for your name and then say hi to you.

JosephSanthosh (589)

My wildest programming idea is hacking into repl.it!

Leroy01010 (72)

one that you can use all coding languages at once

blendSmile (0)

something like php but for desktop instead of web

Highwayman (1367)

@blendSmile there’s probably a plug-in to electron for that...

Yeah thinking about it yeah you can get that with very little finagling nice

jeremykyleisgod (38)

instead of while loops you could have a "loop to line X" so that you wouldn't have to create complicated loops that for me never work. also I want a //BS function that makes everything false just cos it would be funny if on multiplayer

Highwayman (1367)

@jeremykyleisgod

loop to line X

cough C/C++ goto cough

jeremykyleisgod (38)

@Highwayman it wasn't in python so I am not aware '-'

codedragon2 (9)

I think a language with syntax like python, but made only for desktop app and game development would be cool.

firefish (308)

@codedragon2 That already exists.... kind of

firefish (308)

A language called ERD, with absURD syntax.
For example file modifying would be like

pkg : (fs);
pkg : (debt);
!txt => pkg : (txtformat);
get file("modded.txt") into $page => {
  set $file write(!txt (ascii){
    Sample Text
  });
  export $file => ();
  debt : ($file) => {
    throw => ();
  }
}

and stupid things like this. Note debt : ($file) => {} which is just shorthand for detect : (existof : ($file)) <-> true; => {} which is awful
And Hello World be like

pkg : (io);
print => {
  Hello World!
}
export => ();
frostedbutton75 (28)

An easy thing:
Say - hi
Say h1 - hi
Say blue - hi

😁 AND SO ON...
How do you create one

techgeek680 (66)

So I wanted to add to my other account’s comment......
Link - example.com, text - example link

Link - example.com, text - example, color - green
Background - red

@frostedbutton75

DEMONul1234 (27)

Frankly speaking, I'd like to create my very own language using python, I mean, how hard would it be...?

Viper2211 (58)

Imagine a programming language that didnt have a lexer and parser, and was instead lexed and parsed by a machine learning algorithm!

RohilPatel (810)

I was thinking on making a website that was just English

maxyang (32)

I present to you: Repl.It language

array = repl
vector = multiplayer repl
print = post on feed
variable = repl file
input = new repl

A very wholesome language.

ZDev1 (369)

Let's make...
A language like markdown but used to make a profissional website
With functions and functions should be easy but their job is too good!
So think about it...

sorry for my eng

Highwayman (1367)

A programming language where you have to form coherent binary commands by doing any operations on a single (initially empty) binary string and up to 2 additional arguments of the letter O. Every operation must involve 'O'. The final result of the binary string is your program.

Edit: example (result is not coherent)

BIN.append( ('O' << 3) ^ 'O')
BIN.append('O')
BIN.append(  ~('O'^'O') >> 7   )