I wanted to put myself to the challenge to see if I could create a Programming Language primarily in Roblox Studio. Note that this is just an experiment and has no gain in creating this at all, however I do want to post here and see other programmers thoughts on this idea, would it be possible?
Generally my idea was to create my own Programming Language using Python, then with that compile my Language into LuaU while using Rojo to send those compiled files to Roblox Studio. (Using visual studio ofc)
Currently working on a project like this, actually. I would definitely encourage you to do this. I personally find it fun (although challenging) to write a lexer and parser and then convert the AST to LuaU code.
Edit: Instead of Python I’m using TypeScript because it’s the language I’m most comfortable with
Yeah I was generally thinking about creating it in TypeScript however I’ve found that Python had a module someone created that made it easier to write a parser and lexer, it’s called Sly. So initially my thought process is to create my own Programming language and create a built-in package like Flamework for Rbx-Ts for better networking accessibility, extremely excited to work on this and possibly use it for future Projects, but thank you for the reply and I hope your Project goes well!
(sorry tor being late, maybe some other people can see this)
you can either go with interpreted or compiled
compiled is simple you get a source code and turn it into another languages source code or binary
interpreted (python, lua) etc is a little complex
I will explain interpreted using the way lua works:
lua uses a register based VM (CPU like structure to execute bytecode) and the way it works is like magic but pretty simple
the way a VM works is it reads opcodes (operation codes that tells what to do) and does what the instructuons tell ot what to do, this is called runtime
a chunk is a array or bytecode and constants (literals caught in compile time)
lets say we have a VM with 4 opcodes
OP_CONSTANT (load constant to register)
OP_ADD (add 2 registers)
OP_PRINT (print a register)
OP_HALT (tell VM to stop)
and now lets write a program with it
(constants = {2, 2})
OP_CONSTANT 1 1 (load constants[1] to register 1)
OP_CONSTANT 2 2 (load constants[2] to register 2)
OP_ADD 1 2 3 (add numbers in register 1 and 2, place result in 3)
OP_PRINT 3 (print register 3)
OP_HALT
this would print: 4
ofcourse this is a human readable example, actual bytecode is only numbers that can go from 0 to 255 and yes it is similar to binary bcuz it is inspired by binary
so interpreted languages like python and lua arent AST or anything stupid like that, its more complex and professional if you have more questions I can aswer them and maybe I can make a tut about register based VMs