Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

help me create a coding language!

A topic by Pizza.co created Jun 25, 2021 Views: 552 Replies: 13
Viewing posts 1 to 9
(+1)

plz!

Moderator moved this topic to General Development
Moderator(+1)

Sure thing, but how much programming do you know already, and why do you want to do this? For fun, or...?

Moderator (1 edit) (+4)

If you are feeling adventurous, you can try the tools “Lex” and “Yacc”. These are tools traditionally used for creating a compiler for a programming language.

“Lex” is a lexical analyzer, it’s the tool that “tokenizes” the given string, and declares what is a number, what is a variable etc etc

“Yacc” stands for “yet another compiler compiler”. It is a tool that you use to define the syntax of your language, like what does declaring a variable look like? Can I assign a string to an int variable? What happens if I call a function that doesn’t exist?

If I remember currently, those tools were originally used to create early C compilers. Since then C has changed to custom-made tools.

Needless to say, making a language is vastly different than making a game. If you decide to give it ago, keep in mind there’s going to be a lot of new concepts. You can search online for more info on both tools I mentioned here. Both “Lex” and “Yacc” are free and open-source.

(1 edit)

Help me finish my programming language, first, plz

Example of my new coding language:(:\(summon=scratchblock):\)

Moderator

That's not very helpful. What exactly is it supposed to do? Parsing the code shouldn't be too hard, but... why does it look like that?

So does anybody know how to help me?

Why did you ignore Dark Dimension’s advice?

Moderator (1 edit)

Yes, actually, I have some tutorials that might help. Try one of these:

I have more material about it elsewhere, too, but try these first.

(1 edit)

building a new programming language like the ones you see in GameMaker software or scatch requires deep understanding of Window's binary code. This is not something you can finish in a few years, it takes maybe 10 to 20 years to completely make a new code language. If you only want to make it for games you still have a long way to do it since many of the important software like Geforce will not accept unknown language. This problem as been a thing since Linux and no one has still found a stable version for such.

I recommend not creating a new code language without help of at least 10,000 people, any  one else would just go learn C, C++ or HTML/CSS.

(1 edit)

Well no, the language has nothing to do with the operating system. Or maybe by Windows binary code you mean machine code, which is x86_64 on most PCs. It’s not hard per se, too, it just takes a while to absorb all of the topics (I’ve been building my own for a while now).

(To pizzaveloper) Ultimately, a language is nothing more than a document which describes how it works. An example may include the C standard specification, which you can find online. Now if you wish to create a program that reads source code of your language and does something with it, you need to look up compiler or interpreter design, and read books on those. This is a very deep rabbit hole, so you should be well aware on what you’re getting yourself into.

I've also had university lecturers tell me that the worst thing you can do is create a brand new programming language. They see it all the time from PhD students and the world doesn't need more programming languages when the existing ones work perfectly well for the tasks they were built to address.

Moderator

the worst thing you can do is create a brand new programming language.

If your aim is profit, then sure. In an indie dev community there’s plenty of hobby developers that make all shorts of unusual projects for fun.

No point discouraging people that are looking to learn. Each person has their own motives.

https://craftinginterpreters.com should do the trick. Make sure you ain't just blindly copying code, though.