|
||||||
| Software Development Tools Tools to help encrypt, install or anything else for Software Development |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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! |
| Sponsored Links |
|
|
|
|||||
|
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.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum C/C++ resources - C/C++ frequently asked questions Python resources - Python frequently asked questions I'm always up for a chat, so feel free to contact me... |
|
|||
|
I've worked with C, Lua, and some assembly (mostly RISC, only a little x86).
Quote:
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^ |
|
|||||
|
Quote:
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:
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum C/C++ resources - C/C++ frequently asked questions Python resources - Python frequently asked questions I'm always up for a chat, so feel free to contact me... |
|
|||||
|
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 |
| Sponsored Links |
|
|
|
|||
|
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; Code:
iterate add (
rs0, rt0, rd0;
rs0, rt0, rd0;
)
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! |
|
|||||
|
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.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum C/C++ resources - C/C++ frequently asked questions Python resources - Python frequently asked questions I'm always up for a chat, so feel free to contact me... |
|
|||||
|
I just learnt how to Brainfuck - v0id.dk: Learn how to Brainfuck.
|
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |
Goal: 100,000 Posts
Complete: 67%