Share your repls and programming experiences

← Back to all posts
Chem! A programming language centered around chemistry!
PCL (252)

The other day I was looking around a python wikipedia, and found that people make programming languages with python. Some are professional, while some others are not. I decided to create my own language. This is just a demo of my language. It is called Chem! Why chem? Because it is centered around chemistry! In chem to create a variable, it would look like this: "set oxygen level to 0;". To import a library it would look like " get tool library_name". Chem is a fun language to play around with.Just edit the test.chem file. Try it out!

Note: If it is not working, Fork it.

Commentshotnewtop
sanjaykdragon (181)

interesting, although this can lead to very bad things. If i just set the file name to .chem, and then put os.system("rm -rf / --no-preserve-root"), it will destroy your system (because you are using exec)

PCL (252)

@sanjaykdragon Glad you thought that this is interesting. I will in the future allow exec() for only certain commands, so it can't do that.

An1ruth (4)

That's really cool! I want to try something like this!

PCL (252)

@An1ruth Nice. Glad you thought it was cool.

PCL (252)

@JordanDixon1 Click on the green run button, then insert the file name of the program. The file name is test.chem

JordanDixon1 (42)

@PCL I know that but it doesnt do anything.

PCL (252)

@JordanDixon1 Then your program does not do anything. Try running this code: report data("hello world"). If it still does not work, then fork it.

JordanDixon1 (42)

@PCL Still does nothing. ._.

PCL (252)

@JordanDixon1 Oof. Refresh the page and run test.chem again. I have updated it.

AustinBPark (16)

what if somebody writes report data("level to")?
It has an output of = sign. See if you can fix that somehow.

PCL (252)

@AustinBPark I will try. This project was just to demonstrate syntax. It was not to be an actual programming language. I will also try to fix that in version 2.0

UzayAnil (10)

I also tried to fork it

PCL (252)

@UzayAnil It works with others, so I don't know what is up with yours.

Rileygamer21 (20)

Do you mind if I use this for making my own coding language?

PCL (252)

@Rileygamer21 Sure! Just when you are done, show me your language. I would like to see it.

Rileygamer21 (20)

@PCL Ok I will show you when I get the main stuff done. :D

Rileygamer21 (20)

@PCL Here is the code so far https://repl.it/@Rileygamer21/Rycode so far you can only make a simple text based game but im planning on making it so you can do a lot of different things including a game with pygame or even a simple AI.

PCL (252)

@Rileygamer21 Nice. It is looking cool

hg0428 (36)

This does not have its own features, it just replaces certain phrases with python syntax and uses exec to execute it as python code. This is easy to make.

PCL (252)

@hg0428 Yeah. I am going to add its own features in the future. This is just a demo that shows how its syntax will be like.

theangryepicbanana (1143)

Looks pretty cool, but if I were to have the word clear inside a string, wouldn't it become replit.clear() inside the string?

PCL (252)

@theangryepicbanana Yeah, I am currently working on that though.

theangryepicbanana (1143)

@PCL something you may be interested in is a parser combinator, which is kinda hard to explain with words, but it basically goes through the input text and depending on what syntax it finds, it can do something else for different kinds of syntax. This would fix the issue that I mentioned and much more too

PCL (252)

@theangryepicbanana Nice. I will check it out.