New Programming language via C?

grullborg

Baseband Member
Messages
28
I want to make a new programming language I think you can make your own version based on C. Any pointers to help me with this?
 
All functions, variables and logic will all need to be compiled down to assembly. You will want the abilty to compile to x86 and x64. You can structure your lanaguage to be like C or even c++. However, if you do this I want a goto function. (I don't care if it is bad practice.)
 
That would be incredibly complicated to do! :/ You'd probably find it easier to make an interpreted language though. Then all you'd have to do is implement your own functions and write the interpreter program in C to read a text file containing the code and execute it line by line. That way your program could read it line by line and execute it (or return an error) depending on the syntax you specify for your language. It'd be a lot easier than having to design a program that outputs an actually executable file! :p

Summary : It's a million times easier -assuming you want to torture yourself either way - to write an interpreter than it is to write a compiler.
 
I agree with kaoticnick. It will be much harder building a compiler than an interpreter (like PHP.) Building the language is much the same, it is just that you don't bother with actually compiling into a executable file.
 
lots and lots of *pointers haha... haha... get it?

cough... cough... ehem!

The key is your linker/compiler or interpreter. I think I as mentioned above, interpreter may be easier to write.


...an interpreter (like PHP.)

... and using PHP as an example will be perfect on how NOT to build a language. I knew PHP had a benefit! LOL, i kid. I like PHP but it does introduce some bad practices. Don't use it as a guide.
 
Might be worth taking a step back and saying how much experience do you really have? Writing and compiling a new language is incredibly complicated from a technical standpoint, and creating a language that will actually be used requires years of potential research to try and find a gap (and even then there's little chance it'll be widely adopted.) Why are you aiming to write a new language?
 
Might be worth taking a step back and saying how much experience do you really have? Writing and compiling a new language is incredibly complicated from a technical standpoint, and creating a language that will actually be used requires years of potential research to try and find a gap (and even then there's little chance it'll be widely adopted.) Why are you aiming to write a new language?

ditto!
 
I'm planning on making a new OS as well and this is meant to be the programming language for it. My experience is not very high at the moment, but i'm already planning ahead for the future.
 
If you search far enough back on this site I wrote a very simple example maths processing script language before in C (procedurally). (probably about 6 years ago).
It only had simple add subtract functions, but would work easily.

It's not too terribly difficult to write a scripting language if you're writing the language then you're writing the scripts that run on it. but if you're trying to create something bigger then you have to put in a lot more in the way of error checking!

Certainly a scripting language is easier, BUT, what will your language offer that existing languages don't? (people need a reason to switch).

I like PHP but it does introduce some bad practices.
What bad practices do you believe that PHP introduces?

To be honest I can't think that PHP introduces you to bad practices at all.

it lets you get away with bad practices, (though that would depend on what standard you're trying to write to).
it lets you get away with a sloppy style, (though again, it's your own choice to do that).

a poor workman blames his tools.
 
My language is going to attempt to be even more English-like than Applescript (I know that is a scripting language, but my language will be a full language). Eventually, when more technology and resources become available, I wish to make it into an exact replica of the English language.
If you think I should start off with a scripting language and then work it up to a full language, please tell me.
 
Back
Top Bottom