Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Software Development Tools

Software Development Tools Tools to help encrypt, install or anything else for Software Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-17-2007, 06:24 AM
kenna kenna is offline
Learning Programmer
 
Join Date: Jul 2007
Posts: 30
Rep Power: 5
kenna is on a distinguished road
Smile new C-like programming language

Hi, what would my chances be of finding someone to help me with creating a new C-like programming language?

I'm not interested in anything fancy, I mostly want to do it because I want to tidy up and improve on C. Initial target would be x86, but additional targets could be added later on, I'm quite interested in making sort of a macro compiler, so creating new targets would be quite simple. A set of definition files (foo.def) would define how to create object files for a specific target.

Anyway, personally I don't think it should be too difficult, the difficult part would be the parser (especially if the use of def files is used), but the compiling is basically just assembly.

Anyway, would there be someone interested in at least discussing it...?

C is basically the only language I like, f**k C++, f**k C# and all the rest T_T I don't like it, and I hate how C so often get's shunned by these newcomers! Well, I also like Lua, but it's a scripting language.

Anyway, any *CONSTRUCTIVE* feedback is much appreciated!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-17-2007, 07:17 AM
v0id's Avatar   
v0id v0id is offline
Super Moderator
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,458
Last Blog:
CherryPy(thon)
Rep Power: 27
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

Do you have any programming experience, and if so, which languages?

To make a new language is really hard. Most people thinks that the hard part is the parser, and it's, but designing the language is also very hard. Just look at a language such as C++, there's so many aspects of the language, and so many small nifty details.

How are you gonna make the language? You can choose just to make a specification, implementation or both. An example of a specified language could be C, and an example of an implemented could be Java. The difference is that everybody can follow the specification, and make their own compiler, but if there's only an implementation, there's no one that can make a compiler, except for those making the single and only one implementation like Sun, with their Java.

Before you're even thinking about making a new language, check out the already existing language, because there's many C-look-a-like-languages. Some of them are Objective-C, D, C--, C++, etc. Maybe some of the languages already full-fills your needs, and maybe you don't even need a new language.

Another thing you need to think about is how, if you chooses to make an implementation yourself, how it shall be done. Will you both do the assembler and compiler, or will you use another assembler as backend - or what are you going to do. Take f.ex. GCC, it uses GAS as a backend for the assembling. GCC itself only compiles the C code into Assembly code, which then is assembled by GAS, and later linked. If you're going into the compiler development, you should think about reading the book, "Compilers: Principles, Techniques, and Tools", which is considered as the best book at compiler designing and implementation. If you're going to make an assembler, you should maybe take a look at some Open Source assemblers, like FASM, where all the source is freely available for DOS, Linux and Win32.

I'm actually working at a compiler myself, just as a private project. But it's for a much simpler language, which you maybe know, Brainfuck. I'm not making the assembler, only the compiler. I'm using NASM as a backend for the assembling process. I'm coding it all in the C language. Brainfuck is also a specified language, but also have an original implementation (written by Urban Müller) So I don't need to think about the language design, because it's already fixed, so I just have to care about the compiler. Brainfuck is not a big language, so you don't have to make million of lines of code, but it's just to tell you about a real-world example.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-17-2007, 08:04 AM
kenna kenna is offline
Learning Programmer
 
Join Date: Jul 2007
Posts: 30
Rep Power: 5
kenna is on a distinguished road
Default

I've worked with C, Lua, and some assembly (mostly RISC, only a little x86).

Quote:
To make a new language is really hard. Most people thinks that the hard part is the parser, and it's, but designing the language is also very hard. Just look at a language such as C++, there's so many aspects of the language, and so many small nifty details.

Before you're even thinking about making a new language, check out the already existing language, because there's many C-look-a-like-languages. Some of them are Objective-C, D, C--, C++, etc. Maybe some of the languages already full-fills your needs, and maybe you don't even need a new language.
Well, I'm not aiming to make a C++ clone, my aim is actually to simplify C. I've read about and tried Objective-C, C#, C--, C++, D, etc., but I like none of them. What I want is a strict, regular, pure procedural, simplistic, lightweight, portable, mid-level programming language, resembling C and assembly.

I'm planning to make both a specification and an implementation, and will probably use FASM for assembling the x86 code. However, the aim is for the compiler to support any target, so I'll have to create my own assembler as wel, but I can do that later on, x86 is the most important target.

"Compilers: Principles, Techniques, and Tools", wonderful book indeed, I have it, but haven't read it all yet. Only browsed through it, and it looks like a goldmine!

yes I have heard of Brainfuck, and if my memory serves me correct, it truly lives up to its name ^o^
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-17-2007, 08:16 AM
v0id's Avatar   
v0id v0id is offline
Super Moderator
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,458
Last Blog:
CherryPy(thon)
Rep Power: 27
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

Quote:
Originally Posted by kenna
Well, I'm not aiming to make a C++ clone, my aim is actually to simplify C. I've read about and tried Objective-C, C#, C--, C++, D, etc., but I like none of them. What I want is a strict, regular, pure procedural, simplistic, lightweight, portable, mid-level programming language, resembling C and assembly.
If you can live up to that, I'll probably look into the language. I miss a language like that, though I like C and C++. It would be nice with a language like you're talking about, instead of all the new high-level languages, where everything is about pulling as much in it as possible, so the user doesn't have to do anything in the end.

I think you should start trying to make a specification, and then afterwards make your implementation. You should maybe start reading the book as well. Personally, I've also only browsed through it too, but that's mainly because I don't have a wish of making a new language.

I can't help you much from here, I simply don't have much more experience with it, than I've told you in this thread. It would be nice if you some day could announce your specification, and I'll be glad to look into it.

Quote:
Originally Posted by kenna
yes I have heard of Brainfuck, and if my memory serves me correct, it truly lives up to its name ^o^
You remember right. It's really... f u c k e d.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-17-2007, 11:23 AM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 2,057
Last Blog:
wxWidgets is NOT code ...
Rep Power: 24
WingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the rough
Default

As far as creating a compiler, you may want to look at the source for GCC/MinGW, as that could help you create a compiler for the new language.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 07-20-2007, 04:10 PM
kenna kenna is offline
Learning Programmer
 
Join Date: Jul 2007
Posts: 30
Rep Power: 5
kenna is on a distinguished road
Default

There are basically two things which eventually got me to think about a new language, operating system development, game development. I do both, but the x86 architecture is so messy that I really don't feel like learning to create an OS for it, so for a year or two I've been thinking about creating an emulator, so that I'd be able to create my own architecture, everything from cpu, pic, to video and audio. From my point of view, that would be easier, it would take longer, but the end result would be much better. OS development is kind of my hobby (one of them), since I don't like any of the currently available OSs, not even linux. The kernel is great, but as a platform linux kind of sucks, just as much as windows.

Anyway, the thing that really made me make up my mind is game development. For years I've been designing various games, a few times tried to get a team, but always screwed up, and lost my team (kind of the early days, newb stuff ^^). I've been looking at all kinds of engines, and found that Irrlicht is the best one so far. However, I'm still not satisfied, so some time ago, a year maybe, I started thinking about my own game engine. The fact that Irrlicht was C++ and not C also contributed to not settling for it, as well as Irrlicht not being as modular as I'd want. Anyway, C is quite nice, but there are times (quite often), when I wish I'd be able to create my game engine and physics engine etc. in assembly...the language I love t he most...and that's where I got my idea.

So I thought that maybe a virtual architecture, similar to the one I've been designing for my emulator. However, to create a pure assembly language (a virtual one) would be too restrictive, as there are many different architectures. So, mixing assembly with some C-like syntax to create a mid-level language would be the ultimate solution. The simplicity of assembly, but still not low-level enough, to restrict the assembler to any certain architectures.

So there would be a basic set of instructions that include the most essential operations and nothing more, a set of assembler commands that provide the essential metalanguage and platform independent commands, and lastly a set of the most essential system calls, which are paltform dependent instructions.

E.g. there would be only a "write byte to stdout", no additional crap, so if you wanted something similar to the stuff in string.h from C, you'd have to built it yourself. Another important thing would be whether it's a single-data or multiple-data instruction.

E.g.
Code:
add rs, rt, rd;
would add two numbers, while
Code:
iterate add (
    rs0, rt0, rd0;
    rs0, rt0, rd0;
)
would add several numbers, and the important thing here is that you should never use add several times, i.e. add ... add ... add ..., but always use iterate instruction. The idea is that the assembler generates different code based on the context. So the definitions files contain different rules for different usage, so "add" uses one set of rules, while "iterate add" uses another set of rules. Ofcourse, this is kind of a simple example, not really too descriptive, but you get the idea. It gives the assembler more room to generate correct code for various architectures. So, besides the basic set of instructions, there would be a few mid-level commands that sort of change the context of the instruction, so two almost identical lines could generate completely different code, because of the context...the modifiers, that's a better word for it.

So basically I'd want to get as close to assembly as possible without causing too many restrictions.

The standard instructions must always be defined, but you can also define your own instructions to extend the functionality of the assembler. MEL (as I like to call my language, after Mel from "My Parents Are Aliens" ^^) also doesn't use labels like most assembly languages, but this is replaced with way of creating procedures, which can behave in a different ways.

Data handling is quite similar to assembly, MEL does not use C-like variables, but instead deals only with bytes, which can be arranged in different ways to create arrays, tables, sets, lists, etc. MEL also doesn't restrict variables like C, where you have to define a type for each variable, e.g. int, float, etc., instead it depends on the expression what the assembler does, so no matter what length, or what you intend you use it for, so e.g. add will always treat any data as a number of bytes, you need to use special modifiers/instructions to manipulated the data in a different way, just like plain old assembly. I might think of a way to optionally allow type checking for those who are a bit lazy, but I'm not so sure.

I'm also thinking alot about how the instructions should look, if it should be just like real assembly (rt, rs, rd) or something more abstract to give additional assembling-room for the assembler. Also, I like RISC architectures very much, especially MIPS, so the virtual architecture is very simple and clean, definately something to look forward to.

Anyway, I guess MEL is sort of a "portable assembly language" ^^ although the additional non-assembly commands make it more of a mid-level language.

Anyway, I'm glad that you're interested, and once I get a decent specification written, I'll post it, but so far I still have a lot to write ^^, and hopefully my rambling here made some sort of sense!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-31-2008, 05:41 PM
ViRuSS's Avatar   
ViRuSS ViRuSS is offline
Learning Programmer
 
Join Date: Aug 2008
Location: London, England
Age: 14
Posts: 70
Rep Power: 2
ViRuSS will become famous soon enoughViRuSS will become famous soon enough
Default Re: new C-like programming language

you making your language cool
__________________
I didn't write here anything this is Illusion
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 09-01-2008, 04:37 PM
marwex89's Avatar   
marwex89 marwex89 is offline
Programming God
 
Join Date: Jul 2008
Location: In that city Norway y'know
Posts: 691
Rep Power: 6
marwex89 will become famous soon enoughmarwex89 will become famous soon enough
Send a message via AIM to marwex89
Default Re: new C-like programming language

Humph. Old thread....

But since it's now revived: How's that language goin'? v0id is still around, dunno about thread starter.... Did his dreams come true?
__________________
Sex is one of the most wholesome, beautiful and natural experiences that money can buy.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 09-01-2008, 11:43 PM
v0id's Avatar   
v0id v0id is offline
Super Moderator
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,458
Last Blog:
CherryPy(thon)
Rep Power: 27
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default Re: new C-like programming language

I've been talking with him some times since, and he did continue working on it, I've even seen samples of it. I think he has dropped the idea now though, but I'm not sure. I'll ask him, if I get the chance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 09-02-2008, 07:56 AM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,321
Last Blog:
Web slideshow in JavaS...
Rep Power: 45
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: new C-like programming language

I just learnt how to Brainfuck - v0id.dk: Learn how to Brainfuck.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best language for starting programming? Onur General Programming 6 10-11-2007 07:47 PM
D Programming Language. R-G General Programming 2 04-12-2007 11:22 AM
Learning the Programming Language. mysticalone General Programming 3 01-19-2007 07:50 AM
How do you learn a programming language? Dan Software Development Tools 14 08-09-2006 07:12 PM
Is PHP the best web programming language to learn? Kaabi PHP Forum 9 07-05-2006 09:20 PM


All times are GMT -5. The time now is 10:45 PM.

Contest Stats

GoogleKeyw ........ 20.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 67%

Ads