Home / Software / Computer programming / Programming language idea (not a question)
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: 1 2 [All] - (Bottom) Print
Author Topic: Programming language idea (not a question)  (Read 1783 times)
Linux711
Topic Starter
Adviser



Thanked: 49
Posts: 921

Certifications: List
Computer: Specs
Experience: Experienced
OS: Windows XP

Programming Blog 1
« on: November 21, 2009, 09:32:01 PM »

This is my idea for a programming language. I came up with it during a free period at school. It will be implemented as an interpreter in C++. I tried to design it so that it would be easy to program the interpreter. That's why it is made up of combinations of single characters. It is almost impossible to understand without reading what each character means. Please comment on it.

Vars:

     * There are variables a-z and a stack
     * Each of the a-z variables has 5 data types (total of 130 vars; 26 per array)
     * The data types are string, bool, int, long, char

     The data types are accessed this way:
          VS - vars.string
          VB - vars.bool
          VI - vars.integer
          VL - vars.long
          VC - vars.character

     The stack is accessed like this:
          SS - stack.size (for all data types)
          ST - stack.type
          SA - stack.add (same as push in assembly)
          SR - stack.remove (same as pop)
          SO - stack.obtain (get without popping; only for top stack item)

     Examples:
          VSA"Hello World!" - puts the string 'Hello World!' into vars.string.a
          ---------------------------
          SS10 - stack is size 10
          STB - changes to bool

Commands/Reserved Words (Chars)

     CO - command.output
     CI - command.input
     CS - command.screen (mainly used to clear screen)
          CCT - command.compare.true?
          CCF - command.compare.false?
          CCG - command.compare.greater?
          CCL - command.compare.less?
          CCE - command.compare.end

     Example:
          VIA350 - the integer a is set to 350
          VSA"A is equal to 350." - the string a is set to ...
          CCTVIA,350 - integer a is compared with 350
          COVSA - if true, the string a is output
          CCE - end compare

Loops:

     For like loop:
          >#3 (code goes here) < - loops three times
          >VII (code goes here) < - loops i times

     While like loop:
          >CCTVBX,1 (code here) <CCE - loops while the bool x is true (1=true,0=false)
          >CCGVIX,VIY (code here) <CCE - loops while int x is greater than int y

     It can also be done like this:
          >CCGVIX,VIY
          ....
          ....
          ....
          <CCE

If you are still reading this, thank you. It is not even close to done. I think I may need to add semicolons or something to separate commands in a single line loop.

So what do you think?
IP logged

YouTube

"Genius is persistence, not brain power." - Me

"Insomnia is just a byproduct of, "It can't be done"" - LaVolpe

BatchFileCommand
Hopeful



Thanked: 1
Posts: 339




« Reply #1 on: December 01, 2009, 04:05:43 PM »

Well, I don't think that it is necessary for you to have long and complicated commands.

Quote
VSA"Hello World!" - puts the string 'Hello World!' into vars.string.a

It would pose a problem doing commands like this. There needs to be some kind of separator or something to identify the variable A and it's contents, "Hello World!". I think it would be best to stick to something like var.str.a = "Hello World!"
IP logged

οτη άβγαλτος μεταφ βαθμολογία
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #2 on: December 01, 2009, 05:25:35 PM »

Well, I don't think that it is necessary for you to have long and complicated commands.

It would pose a problem doing commands like this. There needs to be some kind of separator or something to identify the variable A and it's contents, "Hello World!". I think it would be best to stick to something like var.str.a = "Hello World!"

um...there are only one character variables- so VS<character>"value" That's pretty easy to parse.

IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
BatchFileCommand
Hopeful



Thanked: 1
Posts: 339




« Reply #3 on: December 01, 2009, 06:36:27 PM »

Quote

um...there are only one character variables- so VS<character>"value" That's pretty easy to parse.

Okay, so it wouldn't matter. But using commands like that is going to curse you with unmaintainable code. I don't like it.
IP logged

οτη άβγαλτος μεταφ βαθμολογία
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #4 on: December 01, 2009, 06:37:59 PM »

I would think it's more a practice in string parsing and language theory then an attempt to make a feasible programming language  ::)
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
Geek-9pm
Sage



Thanked: 373
Posts: 8,930

Computer: Specs
Experience: Expert
OS: Windows XP


Geek After Dark

Geek 9pm blog
« Reply #5 on: December 01, 2009, 06:47:56 PM »

Hey, go easy on him. He is learning as he goes.
Yes, he could make is a lot more simple. But why? If you learns from the process, let him do it.
Multiple stacks are seldom needed. But if you want them and it makes you feel good, do it!
As for parsing, you can parse almost anything.
Except plain English.
IP logged

itburnswhenipee
Beginner



Thanked: 1
Posts: 69


« Reply #6 on: December 06, 2009, 06:56:43 PM »

wouldnt it be easier just to use assembly? faster anyway...
IP logged
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #7 on: December 06, 2009, 07:00:02 PM »

wouldnt it be easier just to use assembly? faster anyway...

I would think it's more a practice in string parsing and language theory then an attempt to make a feasible programming language 
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
itburnswhenipee
Beginner



Thanked: 1
Posts: 69


« Reply #8 on: December 06, 2009, 07:02:22 PM »

thats weird, i was reading, i skipped yours and read the next one...
IP logged
Linux711
Topic Starter
Adviser



Thanked: 49
Posts: 921

Certifications: List
Computer: Specs
Experience: Experienced
OS: Windows XP

Programming Blog 1
« Reply #9 on: December 07, 2009, 09:44:39 AM »

Quote
I would think it's more a practice in string parsing and language theory then an attempt to make a feasible programming language
You're right.

Quote
Yes, he could make is a lot more simple. But why? If you learns from the process, let him do it.
A lot more simple. How do you mean?
Do you mean easier to read? It's not meant to be easy to read, but easy to interpret.

Also, how do I make libraries in my programming language? If there are too many different ways to explain, then how do they do it in C?

Anyway, thanks for the replies.
« Last Edit: December 07, 2009, 09:56:24 AM by Linux711 » IP logged

YouTube

"Genius is persistence, not brain power." - Me

"Insomnia is just a byproduct of, "It can't be done"" - LaVolpe

BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #10 on: December 07, 2009, 11:03:31 AM »

for a library you could allow for different functions; for example, you could have a "CALL" instruction- for example:

Code: [Select]
VSA"string"
CALL UPCASE

the CALL'd functions could then work with variables in predefined locations, for example, in this case, perhaps UPCASE uppercases whatever is in VSA. Again- similar to assembly, since almost all Assembly interrupts access/modify registers to perform their task. This type of thing could easily be extended to basic functions as well, such as ADD, SUB, etc.
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
Geek-9pm
Sage



Thanked: 373
Posts: 8,930

Computer: Specs
Experience: Expert
OS: Windows XP


Geek After Dark

Geek 9pm blog
« Reply #11 on: December 07, 2009, 11:10:02 AM »

Creation of a library is not alwasy needed. I mean you do not have to make your own lirary manager. Just use one that is already available. You can build a libray in almost any system-level language. The idea is to reduce that size of the compiled EXE file by not including the kitchen sink.
Or, the alternative, is to have a run-time library. This is a masive hunk of code that is loaded at run time, the needed parts are lcopied into the work area memory.  This is a pratical way to smake things simple.
For example, a specific program does not use the floading-point stuff. It is in the library, but it is not loading into the program memory because it is not neeed. But if another program needes it, it will be loaded for that program to use.
IP logged

BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #12 on: December 07, 2009, 11:11:39 AM »

it's an interpreter, I don't think there are any plans to make a compiler for it. Therefore all the core stuff such as floating point and string parsing or whatever else they choose can be placed within the interpreter.
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
aiko
Rookie



Thanked: 1
Posts: 33



☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆

lol
« Reply #13 on: December 18, 2009, 02:04:41 PM »

i think it is impassible to do this all alone you need someone else you need a lot of people to make commands to program to test and more it's impassible but don't give up it could happen if you have a lot of people to work with and i think it is impassible to do alone
IP logged
aiko
Rookie



Thanked: 1
Posts: 33



☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆

lol
« Reply #14 on: December 18, 2009, 02:06:42 PM »

by the way you need to write exe files too...
i can help you if you want ... :)
IP logged
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #15 on: December 18, 2009, 03:23:38 PM »

i think it is impassible to do this all alone you need someone else you need a lot of people to make commands to program to test and more it's impassible but don't give up it could happen if you have a lot of people to work with and i think it is impassible to do alone

No, it's actually quite "passible". it's a good little one-man project.

IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
aiko
Rookie



Thanked: 1
Posts: 33



☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆

lol
« Reply #16 on: December 19, 2009, 03:04:23 PM »

yeah i know, but what i mean is
if he/she want to do this you need to have more people else it's to much
IP logged
Geek-9pm
Sage



Thanked: 373
Posts: 8,930

Computer: Specs
Experience: Expert
OS: Windows XP


Geek After Dark

Geek 9pm blog
« Reply #17 on: December 19, 2009, 04:14:50 PM »

 Right here!
We will help the OP.
http://en.wikipedia.org/wiki/Tiny_C_Compiler
That is a start. You can see how somebody else did a very small C interpreter.
cats of course, he does not have to duplicate that effort. That would be pointless. But it should increase him to see how that that individual along with others developed a very small implementation of a language that is considered to be rather difficult.
In the original poster could call his new language almost anything he wants. There are no fast and hard rules about how you do something for your own entertainment. As long as it does not infringe on the rights of others.
Also, the language does not even have to be complete. It does not have to pass any academic standard. It does not have to be flawless. If it produces some result that pleases the creator, that is good. Whether or not other people would approve should not be the criteria. Now some point, he might want to publish his work. That would be another issue.
A simple interpreter with a built-in line editor can be made in about all I would say, maybe just under 3000 lines of code. I just don't remember. That was a long time ago when I did that.
IP logged

BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #18 on: December 19, 2009, 10:39:41 PM »

yeah i know, but what i mean is
if he/she want to do this you need to have more people else it's to much

No. It isn't, actually. It might be overwhelming if they had no design; but they have already planned out a good bit of the project, and once you have a good design the programming behind it often comes a lot easier.

Oh, and I wrote a far more comprehensive and complicated Script language myself.. one person. It literally took a single night after good design much like the original posters, whereas many of my other whimsy project that I go into without any real plan take ages, and even then I usually end up scrapping it all and starting again with the design stage.
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
Geek-9pm
Sage



Thanked: 373
Posts: 8,930

Computer: Specs
Experience: Expert
OS: Windows XP


Geek After Dark

Geek 9pm blog
« Reply #19 on: December 20, 2009, 11:53:47 AM »

Quote
It literally took a single night after
good design much like the original posters
That's right on target!
IP logged

Pages: 1 2 [All] - (Top) Print 
Home / Software / Computer programming / Programming language idea (not a question) « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.13 seconds with 20 queries.