So I wanna make a coding language called volcano. It can make UI. Just ask if you want to join.
The file extension is going to be .volc
Example
Here’s an example:
<\This a comment/>
<\
This
is
also
a
comment
/>
var <\ This /> chicken_nuggies <\ is \> = <\ bad /> “yummy” <\ practice />
wait(10) <\ waiting 10 seconds/>
chicken_nuggies = “no”
var m1 = True <\ That’s a variable/>
<\ Now for some more stuff/>
if (1 == 1) {
pass
} else if (2 == 3) {
pass
} else {
pass
}
while True {
var Hello_World = “cringy”
}
for i in range(5) {
var index = i
}
func myFunc(str: String, other: Any <\ Some parentheses/> ) {
return join(str, convertToString(other))
<\ Now the actual reason this language is created/>
title(“Hello”)
view = {
body()
_backgroundColour =“blue”
text(“Hello World!”)
_colour = “lime”
_size = 48 <\ size is counted in pixels/>
_font = “pixel”
}
display view
Tokens
String
Integer
Float
var
return
True
False
None
display
Tuple
Dict
func
delete
if
else
IMPORTANT: Tuples can hold multiple types of values
If an UI doesn’t have position information, it will just gather in the top-left corner. Default text size is 15. Default text colour is black. Default background colour is white. Default text font is sans_serif.
More UI:
body() (There will be an error if there’s no body.)
text()
image()
input()
button()
link()
Seeing that made me think of VLC media player, an old, trusted program on multiple operating systems. Apparently they also use this extension. You’ll be fine as long as you avoid VLC media player while running your custom language.
are we going to use flask to run volcano, or just convert volcano to html?
Also would you mind explaining what all built-in functions do and what is their arguments
@NateDhaliwal@python660@TaokyleYT@boston2029
I changed my mind. I’m just gonna do a simple language here
To get invited, show me a piece of python code or even a whole language written in Python that might help. Then I’ll invite you.
from os.path import exists
from sys import argv
class FileExtensionError(Exception):
pass #creates custom error for no reason
def do_stuff():
if exists(argv[1]):
if argv[1].rsplit('.', 1) == 'volc':
with open(argv[1], 'w') as f:
continue_code(f)
else:
raise FileExtensionError(f'{argv[1]} is not a volcano file, perhaps change the file extension to .volc?')
else:
raise FileNotFoundError(f'{argv[1]} doesn’t exist, make sure you entered an existing file through an existing directory')
if __name__ == '__main__':
if len(argv) < 2:
argv.append(input('Please input the volcano file you want to compile: '))
do_stuff()
this entire thing is written by bare hand directly so it has not gone through error tests or syntax checks, if there is error it usually is close to the correct one so please don’t mind
This is a file test code which
check if arguments are given from the run command line, take the first argument as file name if yes and ask for input for the name if not
check if the file name given exists or not
check if the file extension is .volc or not (this can be removed if you want it to run the file as volcano regardless the file extension)
Also feel free to copy some of my code from my esolang here, it may help, and invite me as @s3D27ZHOU if you ever want to invite me, @TaokyleYT is a blank account in replit itself.
also, consider saving the current line in a variable to reduce execution times with large .volc files instead of using f[line] in the if/elif/else block. You can even use a match/case statement instead of if/elif/else.
lang = input("What's the programming language you want to learn? ")
match lang:
case "JavaScript":
print("You can become a web developer.")
case "Python":
print("You can become a Data Scientist")
case "PHP":
print("You can become a backend developer")
case "Solidity":
print("You can become a Blockchain developer")
case "Java":
print("You can become a mobile app developer")
case _:
print("The language doesn't matter, what matters is solving problems.")
# Credits to freecodecamp.org