The question is answered, right answer was accepted and everyone is arguing
How to create my own programming language?
I want to create my own programming language. I know absolutely nothing about it, and after extensive browsing of the interwebz on the topic, I have gained no knowledge and have come to the conclusion that these existing "tutorials" are meant for people significantly more intelligent than Steven Hawkings. How does this apply to Unity? I not only want to make a language, I want to make it so that it works extensively with Unity, like UnityScript and C# do with MonoDevelop-Unity. Perhaps if I do a good job It could be a default part of Unity in the future (I intend to make it very simple to use.) My question is, does anyone know anything on the topic or have halfway decent links that dummies can understand? I know a little bit of C# already, I know this or another common language is necessary to make a language.
-EDIT- I deleted what was previously written here because I made a childish comment and I shouldn't have said what I did.
Ok so... How can i explain this. I am new, my account only has questions, but even i can say the following: Your question is... "exaggerated" probaly someone will answer you, but really, think about that. You are asking how to make your OWN program$$anonymous$$g language, like literally i want to make a program$$anonymous$$g language, show me how.
A program$$anonymous$$g language is a very difficult thing to do. If program$$anonymous$$g is hard, imagine making your own language. To make your own program$$anonymous$$g language you would need to at least spent some years of your life doing it, it couldn't have any error, and you would literally need to make it. There is no easy way. As far as i know you would need to do magic to create a program$$anonymous$$g language, as you would need another program$$anonymous$$g language. So, in my opinion, go for it: Program$$anonymous$$g faculty
By the way this is a Game Engine forum.
I probably should have mentioned that I'm still in high school. Thanks for the link, though it's something to think about in a few years. I understand I need a language to make a language. And yes, I realize this is a game engine forum. Read my question, not just the title.
However, I'm not an idiot. I learn well enough. I can learn more C# or Java. I'm just looking at my future here and looking for some answers.
This kind of thing runs in my family, by the way. One of my uncles builds computers from scratch and the other programs regularly for fun on a Raspberry Pi.
The big question is, what does your question have to do with Unity? Seems to be more of a (very) gernal program$$anonymous$$g question to me, I'd even say it belong to the broader "computer science" genre. Stackoverflow.com might be a better place for this than UA.
As Cherno and Bryangs have said, this really isn't a question for this website, so you can't outright say "If, by the way, you delete or close this question, I officially hate you. This is a topic I am very passionate about and applies to Unity in every way. There is no reason to not have this on the site." because it really isn't. Even if it was related to Unity, UA is the wrong place to go. The question is simply too broad, and would require too long of a discussion about topics with no relevance to Unity or those who use it for it to be suitable. The Forums would be more appropriate, as stated in the first part of the Answers Guidelines.
If you don't $$anonymous$$d me asking, in which way would your language be either more different or more useful than the current implemented languages for unity?
What kind of program$$anonymous$$g style would it cater for? Honestly I can't find anything more appealing than the C family when it comes to syntax, but I am open for suggestion if you feel something is done better in another language and you were trying to create some kind of hybrid offspring with it and C.
Well, the C family actually has a lot of cryptic symbols which can confuse the hell out of people which are new to program$$anonymous$$g
| || & && ! ^ &= |= != =! % == = <= => ? {} [] ()
If you have never heard about those before you will have a hard time to figure them out intuitively. At first glance <=
and =>
as well as !=
and =!
look very similar so they might be the opposite of each other, but no, they are something completely different.
There are other languages which are much more intuitive (at least when it comes to the basic concepts). I started with Pascal way back then. It uses words as operators where possible like "and", "or", "xor", "not", "mod", "div", "begin", "end". That makes program$$anonymous$$g almost like "chatting" with your computer as you almost use full sentences ^^. They tried to avoid using ambiguous symbols to avoid confusion between them. Pascal was specifically designed as a starter language.
LUA basically uses a combination of many languages but a lot is taken from pascal-like languages.
I see this question like a childs dream of beco$$anonymous$$g a fire fighter, astronaut or world savior. Wait until you are at the point where you can actually decide if you can pull it off or not. I created a couple of small scripting parsers but i know what's behind a whole language. Just look at any open source implementation of pretty much any program$$anonymous$$g language. Also designing a language and writing a parser / lexer for it are two completely different things. That's why those tasks are often done by different people, experts in their fields.
However since the question is actually off-topic we shouldn't really continue bumping it all the time ^^.
$$anonymous$$y idea is to make a script that flows from one function, declaration, variable to the next very smoothly and simply so that it's easy and engaging to write. To me, I find C# very choppy in the way it is written. I find it hard to read and understand. That's why I want to make a language that's versatile but extremely simple, so that people like me can script whatever they want without spending weeks just learning C# or UnityScript.
Answer by Eric5h5 · Nov 27, 2016 at 05:02 AM
You need to learn how to create CIL code (Common Intermediate Language), which is what all languages used by Unity compile to. Here's a tutorial about creating a custom language and writing a CIL (AKA MSIL) compiler for it in F#. (The Unityscript compiler in Unity is written in Boo, hence why certain errors reference Boo.Lang.)
Answer by Shyclyde · Nov 27, 2016 at 07:53 PM
Honestly, and I'm not trying to be rude with this, but get a Computer Science degree when you get to college. I would suggest going post-grad with it as well, then you might have the knowledge you need to accomplish this. The reason what you're seeing looks like it's meant for Stephen Hawking is because you're expecting a simple answer, and sadly, that's not what you're ever going to get on this question. The answer you're looking for takes multiple textbooks and years of study, which is why it's not going to be sufficiently answered here. I see you mention members of your family build computers and plays with a Raspberry Pi, but those are trivial skills the average techy can learn with some weekend tinkering compared to this. Learning how to make a programming language...I would say requires mastering several programming languages first before you actually even think about getting into computer language theory. I'm not denying your passion, I too thought in a similar way in High School, but just know your passion will take dedication and time. Stay curious though!
Answer by Orami · Nov 27, 2016 at 04:16 AM
First off you will need to learn assembly. Then you will also need to know the correct interrupts to call and what needs to be in your registers when you call them. Now that really isn't too hard to be honest, what IS hard is that you will need to know the system architecture of every machine you plan to have this language work on. What this means is you will likely need to support 64bit and 32bit registers(along with the different interrupts between system types not just the 32/64 part). You will need to write a lot of code to just figure out what you are running on. Now assembly is not for the faint of heart. You will have to code VRAM access and the dynamic allocation of memory on the heap. You know what that is? If not then you are way over your head. You are looking at multiple years of coding just to get something that might work some of the time. Then you are going to be looking at debugging for a very long time then trying to figure out if it is a bug in the programming language or in the implementation of the language. So in short the answer should be it isn't a single person endever to make a programming language normally very large groups of people work on things like that for YEARS.
This is not actually true in the context of this question. It's about making a language for Unity, which means learning how to generate CIL code, not assembly. Also it's very possible to do it with one person, since not only was the Boo program$$anonymous$$g language created by one person, but that same person created Unityscript (A$$anonymous$$A "Javascript", but it's a custom language). Not to say that it's a trivial undertaking, by any means.
Follow this Question
Related Questions
How to I make there only be a chance to be sold every 2 seconds. 0 Answers
How to instantiate object dependent on position 1 Answer
Changing Color/Material using HDRP,Modify The Color of a HDRP material 0 Answers
pickup object is floating in the air when dropped. 0 Answers
How to make this shop animation and unlock system? 0 Answers