Okay we hear about programming languages being made and so forth, but my qestion is this, how do you make a programming language? what would one do to start his own programming language?
Creating Programming Languages
Page 1 of 110 Replies - 3583 Views - Last Post: 29 April 2009 - 03:31 PM
Replies To: Creating Programming Languages
#2
Re: Creating Programming Languages
Posted 26 February 2009 - 08:27 PM
musya, on 26 Feb, 2009 - 09:19 PM, said:
what would one do to start his own programming language?
1st, you would have to have a need, a requirement that another language just simply couldn't fill.
& if you knew why you needed to make a new one, you'd probably know enough about what you're doing to know how to make one
The reality of it is, you need to know the ins & outs of memory usage, cpu usage, & all of the low level i/o of the PC.
An interpreted language, such as brainfuck might be simpler to create.
** Edit **
I'm not saying that's a simple language, it's just the 1st interpreted language that came to mind.
#3
Re: Creating Programming Languages
Posted 26 February 2009 - 08:32 PM
So its not such a thing that you can build it from say c++? would you need to go down to assembly? or c? I'm just kinda lost as to how you would give birth to a language for example such as php?
#5
Re: Creating Programming Languages
Posted 28 February 2009 - 11:52 AM
I stumbled upon this tutorial that shows how to make your own scripting language under linux, actually C and C++ play a major role in it, http://ubuntuforums....ad.php?t=351973 hope this helps, good luck
#6
Re: Creating Programming Languages
Posted 08 April 2009 - 06:44 PM
programming languages are simply an abstraction of the von neumann mahcine.. I recommend you create your language from assembly.
#7
Re: Creating Programming Languages
Posted 20 April 2009 - 08:37 AM
If you are going to create a language, you'll need a lot of knowledge, time, and effort. I've never attempted to do this myself but I heard about some kind of tool, the YACC Parser or something like that helps. I really don't know, I'm a noob when it comes to creating new languages.
However I was really bored one day and I didn't want to write a lick of code so I just opened up Notepad and wrote documentation for a non-existent language... it had syntax similar to C++ and Java, and it looked really cool - but no plans to ever code it.
However I was really bored one day and I didn't want to write a lick of code so I just opened up Notepad and wrote documentation for a non-existent language... it had syntax similar to C++ and Java, and it looked really cool - but no plans to ever code it.
#8
Re: Creating Programming Languages
Posted 20 April 2009 - 01:34 PM
musya, on 26 Feb, 2009 - 07:19 PM, said:
[...] what would one do to start his own programming language?
well you need some background in parsing and code generation. A nice book to start with is "Compiler Construction: Principles and Practice" by Kenneth C. Louden.
And I wouldn't implement the language in assembler. Use whatever language you are comfortable with. At the moment, I'm writing a Scheme interpreter in javascript
Good luck
#9
Re: Creating Programming Languages
Posted 22 April 2009 - 12:16 AM
Kiriran, on 20 Apr, 2009 - 12:34 PM, said:
well you need some background in parsing and code generation. A nice book to start with is "Compiler Construction: Principles and Practice" by Kenneth C. Louden.
Is the the famed "Dragon Book" ?
I've started reading up on VS2008 DSL features (just started).
I'm interested in possible new classes of programming languages that incorporate something innovative, for instance, how about an "embrionic language" that is sort of like the HAL 9000 when it first boots up and requires a knowledgable programmer to proram it, but remembers everything along the way, collecting statistical data about the cognative approach of its users.
Aaron
#10
Re: Creating Programming Languages
Posted 27 April 2009 - 01:44 AM
ayman_mastermind, on 28 Feb, 2009 - 10:52 AM, said:
I stumbled upon this tutorial that shows how to make your own scripting language under linux, actually C and C++ play a major role in it, http://ubuntuforums....ad.php?t=351973 hope this helps, good luck 
scripting languages and programming languages are different.
#11
Re: Creating Programming Languages
Posted 29 April 2009 - 03:31 PM
To create a new language you first have to develop the grammar for the language, meaning the syntax. Like in C++ you have:
That is an example of the grammar of a language.
Once you have the grammar you need to write a parser. The parser goes over what the programmer has written and checks the syntax to make sure the code the programmer has written is correct (This is partly what intellisence does). The parser passes what it has checked to the compiler. The compiler takes libraries, that are usually written in assembly language, but they could be written in a language like C/C++, then passes them to the code generator which makes creates the .exe file or equivalent like bytecode in Java or IL in C#/VB.NET.
That is a bit simplified but it is how things work in a compiler.
while (i < 30)
{
statements...
}
That is an example of the grammar of a language.
Once you have the grammar you need to write a parser. The parser goes over what the programmer has written and checks the syntax to make sure the code the programmer has written is correct (This is partly what intellisence does). The parser passes what it has checked to the compiler. The compiler takes libraries, that are usually written in assembly language, but they could be written in a language like C/C++, then passes them to the code generator which makes creates the .exe file or equivalent like bytecode in Java or IL in C#/VB.NET.
That is a bit simplified but it is how things work in a compiler.
Page 1 of 1

New Topic/Question
Reply



MultiQuote



|