Submit templates for repl.it/templates here.

← Back to all posts
Mub v2.1.0, the language made with python.
Code1Tech (106)

Mub is a programming language made with python.
It is like basic Java or Javascript.
If you prefer easy languages, you can do add easymub;.
Go ahead and fork it, I want to see what things you guys will make :)

Fork the repl and go to main.mub.

Commands:

sys.out('string'); - print string
sys.read('string'); - get input and text shown is string
// - comment
var.set('string') - set a value inside a variable (string)
var.get(); - get a variable value
write.txt(); - write a new file
add [pkg name]; - Adds a package. (Without [])

Example:

add easymub;
sys.out('This is the power of mub!');
//sys.out('Mub v1 is cooler');
sys.out('Mub v2 is way cooler with multi lines!');
read('so cool');
sys.read('i know right?');

Copy and paste that into main.mub!

NOTE:

You can only use ' (single quotes) to wrap around a string. Double quotes are coming soon.

Credits:

MatthewWithProSkills - Helped with multi lines
Code1Tech - Made the entire thing

Comments
hotnewtop
[deleted]

Hey @Code1Tech! Nice job on this language!

doineednumbers (26)

Mub V3 should be turing complete!

Code1Tech (106)

@doineednumbers Well, I kinda stopped development because this sort of died.

angrydoge (481)

whats sources? and how do you get it so you can make it .<codename> and still work?

Code1Tech (106)

Sources are the source code of mub, basically the code behind it. Or in other words, a folder containing the backend. You want to open main.mub and I don't know what you mean by and how do you get it so you can make it.<codename> and still work?. Please describe better and I may be able to answer your questions!
@dabombdgdzjr

angrydoge (481)

How do you make it so you can do it .mub and not .py @Code1Tech

angrydoge (481)

and have it able to work and run it @Code1Tech

Code1Tech (106)

...
You can just rename it to main.mub, and if you want to know how I run it then look inside the sources folder and open mub.py. I import the mub.py from the folder, I run the script in main.py, and it reads main.mub and gives output.
If your new to python, the code behind mub isn't for you, you don't have to understand how I made it, just use it to make programs! Open main.mub and look at the top for things you can do.
@dabombdgdzjr

angrydoge (481)

I wa looking at the import file but I have to copy the whole source code to do it @Code1Tech

Code1Tech (106)

No, just click where it says mub v2.1.0 and by run button there will be fork.

Then you can do whatever you want in main.mub.
@dabombdgdzjr

angrydoge (481)

I ment to make it execute the .mub @Code1Tech

angrydoge (481)

Isnt working, I did open("main.bo", "rt") and it did nothing. I even tried regular python @Code1Tech

Code1Tech (106)

Yes, beacuse you have to code it to do whatever. What I did was

f = open("main.mub", "r")
read = f.read()
if 'sayhello' in read:
  print('hello')

It's kinda like that.
It doesn't execute like that, you have to code it with your own hard work. Also, this isn't a tutorial on opening files, this is a template on mub which is my programming language. Please google if you are still having trouble.
And you are supposed to fork and write code in main.mub, not learn to open files using python. If you want to do that then post a question on ask or google yourself.
@dabombdgdzjr

angrydoge (481)

ik i googled it and it didnt help. @Code1Tech thx u tho I hope this code works!!

Code1Tech (106)

Also, please fork my project and write anything in main.mub like I showed you, example: sys.out('hello!'). Thanks.
@dabombdgdzjr

angrydoge (481)

k! @Code1Tech also, Try making a input thing! Its seems like it would spice it up a little :D

Code1Tech (106)

I did, sys.read('input').
lol read the commands ^^
@dabombdgdzjr

Code1Tech (106)

The input can be any text, it's just an example.

Code1Tech (106)

nice! but again, this isn't a tutorial on a language.
this is a template for my language so you can use it.
@dabombdgdzjr