Subscribe to gabehabe's on-topic ramblings        RSS Feed
-----

A New Language, For Complete Beginners

Icon 24 Comments
I've decided that I'm going to develop my own language. For now, it will be interpreted, but as I get more into compiler theory, I'm hoping to be able to build a compiler for it.

It's going to be as close to English as possible. And the way that I'll do this is not to parse every single word, but to only parse certain ones.

Example, the programmer could type something like this:
print "This language is going to rock my socks" on the console

which would simply be interpreted as this:
print "This language is going to rock my socks"

Note that the programmer could also write it exactly as it will be interpreted. Basically, they can just go for whatever makes sense to them.

It's basically going to be aimed at people who have never written code before. I know it's going to be difficult to get it so close to English, but those of you who know me know that I'm always game for a challenge.

Let's look at a better example. To read a file into a string variable, then output the string, the programmer could do this:
create str as type: string
read file "C:\\file.txt" to str
print str on the console


The code would be executed at runtime, like my BF interpreter, so the user wouldn't have to see any C++ in an output file, or anything like that. Since it'll be done at runtime, the variables that the user creates will most likely be stored in some kind of memory array, since we can't name variables at runtime.

The code that would then be executed (in C++ since I'll be doing this in C++) would be something along the lines of:
// create str as type: string
string str; // actually stored in some kind of array of data, since we can't name variables at runtime
// read file "C:\\file.txt" to str
ifstream file;
file.open("C:\\file.txt");
if (file.is_open()) {
    while (!file.eof()) file >> str;
    file.close();
} else { // automatically generate an error message
    cout << "Error: File could not be located";
}
// print str on the console
cout << str;


If anyone has any suggestions, please let me know. :)

Thanks for reading!

24 Comments On This Entry

  • (2 Pages)
  • +
  • 1
  • 2

Amadeus Icon

04 November 2008 - 01:33 PM
When you move into the compiling portion, I recommend what's known as the Dragon Book. Complex, but very informative...it allowed me t build several compilers for projects when i was in school.

Compiler theory is pretty neat.
0

gabehabe Icon

04 November 2008 - 01:34 PM
That's brilliant, thanks Amadeus! :D

I was looking for some advice, and I did come across a lot of good reviews on the dragon book. I think that's a must on my Christmas list then. :)
0

abgorn Icon

04 November 2008 - 02:40 PM
Give it a really kick-ass name. Like "Quortin", "R67K" or "Steve".
0

gabehabe Icon

04 November 2008 - 02:41 PM
I'm liking "Steve."
0

gbertoli3 Icon

04 November 2008 - 04:38 PM
I think that it is a great beginning language for anyone who wants to program. :^:

Also I think that Steve is perfect for your language. Your Syntax and Name should reflect each other(which it does). They are both simple, but effective.
0

gabehabe Icon

04 November 2008 - 04:54 PM
I've also got another one in the works, which will be known as "boob."

I'm going to aim to make that one the hardest to understand, since women have boobs, and women are hard to understand.

B)
0

AdamSpeight2008 Icon

04 November 2008 - 06:53 PM

gabehabe, on 4 Nov, 2008 - 10:54 PM, said:

I've also got another one in the works, which will be known as "boob."

I'm going to aim to make that one the hardest to understand, since women have boobs, and women are hard to understand.

B)

or G. (pronounced G Spot)
Where progress bars have a screaming orgasm when it reaches 100%.
0

Noldona Icon

05 November 2008 - 12:30 PM
If you want something that is really hard to understand, look at intercal as that is exactly what it was designed to be.
0

abgorn Icon

05 November 2008 - 01:34 PM
Steve damn you STEVE!
0

gabehabe Icon

05 November 2008 - 04:11 PM
Yes, yes~ It's going to be called Steve.

If you'd have read the comments, you'd know that Boob or G. or whatever is going to be another language.

Or maybe George.
0

TonicX57 Icon

08 November 2008 - 07:38 PM
Sorry, this is kind of off topic, but how do you do an incomplete code box? Like where you have:
print "This language is going to rock my socks" on the console
You have it in a code box, but not the full code box.

Thanks,
TonicX57
0

gabehabe Icon

09 November 2008 - 07:15 AM
It's the inline tags.
[il] [/il]

OR:
[inline] [/inline]
0

badjava Icon

11 November 2008 - 02:49 AM

gabehabe, on 4 Nov, 2008 - 03:54 PM, said:

I've also got another one in the works, which will be known as "boob."

I'm going to aim to make that one the hardest to understand, since women have boobs, and women are hard to understand.

B)


Boobs might not be the best choice, since boobs are warm, fun and squeezy and on their own VEEEEERY simple to operate, and u want this language to be hard, crazy and intimidating.

Lets see... Hmm...whats a simple one word way to say: understanding what women think (you notice i didn't say how women think, cause that'd just be insane....well... all puns intended)

what about a language called Female_Utility_Responses, or F.U.R. for short?

still thinking....
0

5ubw0r1d Icon

11 November 2008 - 06:23 AM
Love the concept of your language. I think it would be really good for beginners to learn a a simple language other than basic :P, one which is actually going to teach them something.

I read this post with my GF (thats RL GF) and she took offence at you calling your other language boob. Instead she thinks you should call it Time of the Month. In this language once a month all Booleans will be inverted, variables will be scrapped for lack of commitment, programmers swearing and cursing at the screen when an error occurs will be replaced by an error message swearing and cursing at the programmer for causing the error in the first place. :P
0

gabehabe Icon

12 November 2008 - 06:05 AM
It can be written as . and pronounced period. How's that?
0

Noldona Icon

12 November 2008 - 11:15 AM
That would be awesome. I would learn to program in that language just for the fun of the responses.
0

5ubw0r1d Icon

14 November 2008 - 05:36 PM

gabehabe, on 12 Nov, 2008 - 05:05 AM, said:

It can be written as . and pronounced period. How's that?


I'm normally quite a witty person. Can't believe I missed that.

*applaud*
0

TonicX57 Icon

16 November 2008 - 10:50 AM

gabehabe, on 9 Nov, 2008 - 06:15 AM, said:

It's the inline tags.
[il] [/il]

OR:
[inline] [/inline]

Thanks, gabehabe.
0

satukoro Icon

18 November 2008 - 05:05 PM
Steve actually looks promising. It would be easier than basic to pick up, and yet be able to accomplish more things.

(also, I can't believe I missed . *clap*)
0

abgorn Icon

22 November 2008 - 03:21 PM
I'm a freakin' genius!
0
  • (2 Pages)
  • +
  • 1
  • 2

July 2014

S M T W T F S
  12345
6789101112
13141516171819
2021222324 25 26
2728293031  

Request A Topic!

Want me to blog about something? Perhaps a language? A piece of software? A specific topic? Let me know! Even guests can post here on my blog!

If you would like to request a topic, please post a comment here and I'll get on it right away! smile.gif

Search My Blog

0 user(s) viewing

0 Guests
0 member(s)
0 anonymous member(s)

gabehabe's off-topic ramblings

Follow me on Twitter!
lol, my other blog died a horrible lonely death. Ah well.

Smiley of the [however often I change it]

IPB Image

Contact Me

e-mail: gabehabe@gmail.com

Google Talk: gabehabe@gmail.com
MSN: gabehabe@hotmail.com
Yahoo: gabehabe (rarely used)
AIM: gabehabe (rarely used)

Skype: gabehabe

Want me to work for you? [click]