i want to make a programming language in makecode, but i don’t have many ideas on how to, does anybody have any ideas?(asking help from advanced users)
You mean something like implementing C# as an option for a typing language in MakeCode?
no like, making a programminglanguage.
Start by asking a few questions to help design the new language.
The first thing I would look at is how you want to store programs written in this new language?
- You could create an extension that adds new blocks that form a new language.
- You could use a long string of text. You would then need to parse it.
- You could use an array of tokens. Kind of like pre-parsed.
- Can you use files of text? I am not sure.
What kind of language do you want?
- If you choose 1 above it will be a block language.
- A text language maybe? You must decide how to store the programs.
- Does each line have the same format like SNOBOL to reduce parsing?
- With or without gotos?
Some simple language examples to consider:
- Lisp type languages are easy to parse.
- Forth type languages are easy to implement.
Do you need functions as first class objects to implement this? If you do then you will need to at least have some JavaScript.
I have actually implemented a Forth type language on top of a block language, not MakeCode specifically. It was a small part of a bigger project. I found it to be doable. I did need to have functions as first class objects and dictionaries to do it well. JavaScript has both of those, but you could first start the project by adding those two things as extensions to the block language if that is what you want to use.
So like creating your own, unique language? Interesting idea.
You’d need to start by defining the language itself. You could consider this a domain-specific language (DSL), where the language is created for a specific purpose – rather than a general programming language, which can be used many places for many different reasons. Writing a DSL is a common exercise for computer science students in college.
If you’re interested in learning how to write a programming language, then give this course a try. I’ve read a couple of the books that it’s based on.
If I’m still misinterpreting what you’re trying to do, Jupiter, then let me know!
yes, that is exactly it