Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / my own language

Author
Message
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Aug 2005 22:30
ok, say i wanted to make my own programming language (which i dont, but im just curious), how would i go about doing it?

"Well if she dies it'll teach her not to do it again..." - Me
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 9th Aug 2005 23:05 Edited at: 9th Aug 2005 23:06
Quote: " ok, say i wanted to make my own programming language (which i dont, but im just curious), how would i go about doing it?"


I would say that first of all you would need to know a great deal of c++(or c# for that matter). THEN start making it LoL! I don't know much about this since i'm not really good at c++ yet But i do that that to make the IDE you would need to know stuff like window commands and pretty much! Also then you would need to know how to make the commands working and being executed. And also how to make the compiler (The compiler makes your source into machine code wich it will use with all the files). Also you would need to know something about how to make the linker work. Well... I think i just stop now

Visit PanzerGames here
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Aug 2005 23:19
ok, i wont bother then

"Well if she dies it'll teach her not to do it again..." - Me
AndLabs
20
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 9th Aug 2005 23:19
First of all, you should post requests. I myself am making a new programming language, Object Power. Find out more at: http://forum.thegamecreators.com/?m=forum_view&t=57485&b=20&p=0

Also, make a list of features on a new post or on your first post. Give it a name, some goals, and standards. Then, get a website and make a specification. Otherwise, your language will be difficult for people to find out how to use it. Here is a simple spec outline:



For the Software You Want, AMPERSAND LABORATORIES is the place!

AndLabs
20
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 9th Aug 2005 23:22
Oh, and use other programming languages as springboards!

For the Software You Want, AMPERSAND LABORATORIES is the place!

AndLabs
20
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 9th Aug 2005 23:22
And don't bother making a compiler/an IDE unless you're that into it!

For the Software You Want, AMPERSAND LABORATORIES is the place!

Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Aug 2005 23:26
i mean using dbc...

basically, how would i get it to let the user type code, and then execute it...

"Well if she dies it'll teach her not to do it again..." - Me
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 10th Aug 2005 01:19
AndLabs - Did you ever notice that edit button a bit below your av? USE IT!!!!

Don't look at my sig!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Aug 2005 03:31
The main problem with writing another language with DB is that it would be an interppreted language running on top of another interpreted language and would be too slow for practical use.

It could be done however.

Basically, you would have to create an editor where each line is in an element in a string array. Saving/loading the source would be a case of saving/loading the contents of the array.

When run, you would 'pre-process' all the lines of code and convert them to DB code which would do whatever the command is supposed to do. For a very silly example, you might decide that to clear the screen, your language would use:

Flibbit

Your pre-processor would pick up this line, replacing it with

CLS

...which your program would actually do. Eg:

For A=1 To TotalLinesNum
If Proglines$(A) = "Flibbit"
CLS
Endif
Next A

You would continue preprocessing the whole file, substituting each line of your new language with the equivalent DB code.

Not realistic, more of an 'only for fun' thing to do.

More to the point, you couldn't create an exe. Well actually you could by sending the preprocessor output to a file and then sending the file to the DB.exe to compile it.

But you couldn't do that because you probably wouldn't get permission to distribute the DB exe with your 'language'.

TDK_Man
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 10th Aug 2005 03:43
the simplest way to "create" your own language would be to use
FASM ... do a search for it ...
Its ASM, but it supports multi-part macros which is 90% of the work
right there. The rest you could do as sorta a "pre-proccesor" type of thing and just add to it as you go.

As for doing that in basic .... just not at all practical. You would be better off doing .DLL add ons.
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 11th Aug 2005 14:51
...hardness

"Well if she dies it'll teach her not to do it again..." - Me
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 11th Aug 2005 19:26
First of all, you'll need an editor.
Then you can use functions.

Make a search function to detect specified commands.

create functions for the more advanced commands.

...

Immunity and Annihalation makes Immunihalation...
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 11th Aug 2005 22:14
alright.. i cant be bothered making my language anymore, too much effort

"Well if she dies it'll teach her not to do it again..." - Me
Kim Possible
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location: Where ever there\'s trouble.
Posted: 15th Aug 2005 02:59
I think the most important first question is "why?"

What are you trying to solve? Is there a hole in current languages you want to fill?

Or is it for learning purposes?

If the latter, you'll probably want to start off understanding the operating system a bit better, and the abstraction layers (such as System Calls on up to DirectX and similar)

I'd suggest having a look at Gnu C. It's open source, runs on everything, is tight, and is written well.

And, like it or not, you're going to need to get down to the assembler level at the least and probably down to microcode to really do justice to your knowledge-base.

DBP + VC Ent.Studio | Maya, MAX, Soft3D, MilkShape, Character FX | 3.0Ghz P4, IC7G, GF 6800GT (primary) / 3200XP, A7N8x, GF 6600GT (secondary) / 6x dual 2.8Ghz Xeon SuperMicro (renderfarm)

Login to post a reply

Server time is: 2025-05-22 13:22:14
Your offset time is: 2025-05-22 13:22:14