Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 05-27-2011, 08:07 AM   #1
Baseband Member
 
grullborg's Avatar
 
Join Date: May 2011
Posts: 28
Question New Programming language via C?

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?
__________________

grullborg is offline   Reply With Quote
Old 05-27-2011, 10:15 AM   #2
In Runtime
 
BrokenAtari's Avatar
 
Join Date: Jan 2006
Posts: 219
Default Re: New Programming language via C?

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.)
__________________

__________________
Cisco Network Fundamentals Certified
Cisco Routing Protocols and Concepts Certified
BrokenAtari is offline   Reply With Quote
Old 06-05-2011, 08:50 PM   #3
Beta Member
 
Join Date: Jun 2011
Posts: 1
Default Re: New Programming language via C?

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.
kaoticnick is offline   Reply With Quote
Old 06-06-2011, 03:52 AM   #4
Solid State Member
 
Join Date: May 2011
Posts: 18
Default Re: New Programming language via C?

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.
Sefrotox is offline   Reply With Quote
Old 06-06-2011, 07:17 AM   #5
7D8
In Runtime
 
7D8's Avatar
 
Join Date: Oct 2006
Posts: 209
Default Re: New Programming language via C?

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.


Quote:
Originally Posted by Sefrotox View Post
...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.
7D8 is offline   Reply With Quote
Old 06-08-2011, 06:59 AM   #6
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: New Programming language via C?

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?
__________________
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote
Old 06-08-2011, 09:32 AM   #7
7D8
In Runtime
 
7D8's Avatar
 
Join Date: Oct 2006
Posts: 209
Default Re: New Programming language via C?

Quote:
Originally Posted by berry120 View Post
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!
7D8 is offline   Reply With Quote
Old 06-09-2011, 05:23 AM   #8
Baseband Member
 
grullborg's Avatar
 
Join Date: May 2011
Posts: 28
Default Re: New Programming language via C?

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.
grullborg is offline   Reply With Quote
Old 06-09-2011, 12:40 PM   #9
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 7,999
Default Re: New Programming language via C?

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).

Quote:
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.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 06-10-2011, 09:41 AM   #10
Baseband Member
 
grullborg's Avatar
 
Join Date: May 2011
Posts: 28
Default Re: New Programming language via C?

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.
__________________

grullborg is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:55 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0