Author Topic: The dawn of a new OOPL  (Read 25872 times)

0 Members and 1 Guest are viewing this topic.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
The dawn of a new OOPL
« on: August 14, 2011, 10:57:19 am »
SEE THIS POST
Spoiler For OP:

In case you haven't looked (or even glanced) at my signature, I'm writing an OOPL called Zenon. :D (In case you don't know what that means, it stands for Object-Oriented Programming Language.)

My only problem is: I'm terrible at coming up with syntax because I have no creativity :( The syntax I have right now looks cool, but it's impractical. It requires more unnecessary typing than I'd like.

This language will be .NET-based, so anything you can do in C# or VB, you'll be able to do in this. This includes designing forms, creating console-based applications, and probably libraries (.dll's) for use with other, non-Zenon programs. My request to you, the Omnimaga community, is to help construct a syntax for this language.

I guess the only thing I want you to keep in mind when suggesting syntax and whatnot is to try to make it fun to write in. Something you'd like to make a program or two with. The language can be simple, complex, or moderate, it can be completely original or it can combine elements of other languages together. But please, this will not be an esoteric language ;)

Syntax last updated: 4:24pm EST (GMT-5) on 19 Aug 2011.
Change with block comments and methods, etc.!!

Spoiler For Current syntax:

* - Indicates a change
+ - Indicates an addition
# - Indicates a removal
Since last edit, that is.
--
As in many languages, a semi-colon will mark the end-of-line.
--
Strings will be like every other programming language; beginning and ending with a (double) quote.
--
*Block comments will be [[ comment ]], single line comments will be "//comment"
--
Modifiers are the same as any .NET language. These include "public," "private," "sealed," and "abstract". However, "public" will be "global," "private" will be "internal," "sealed" will be "closed," and "abstract" will be "open".
--
Threads will be a built-in type for easier access. (yay)
--
#Moved arrays and matrices so they have their own mini-topic
--
Instead of using "." to access the methods of a variable, the colon (":") will be used. I.e. instead of "<var>.<method>;", it will be "<var>:<method>;"
--
Accessing the current application/class will be "current" instead of "this" or "Me".
--
Inheritance will be implemented.
--
"parent" will be used instead of "base" (like in C# or <insert other language that uses "base">) or "super" (like Java).
--
"break" (from C#, not sure on its equivalent in Java, etc.) will be "exit"
--
"quit" will be a general command to exit the program, unless in an infinite loop :P.
--
+Preprocessor directives will only be in the main file and will be denoted by '@'.

VARIABLES
Will be defined by "<type> <name> [= <value>];"
-Here is a list of current types (layout is "<type> : <declaration name> : <default value>")
  -string   : str  : ""
  -integer  : int  : 0
  -boolean  : bool : false
  -byte     : byte : 00

CONDITIONALS
Will be accessed by
 "if (<condition>) {
   <code>
  }
  elseif (<condition>) {
    <code>
  }
  else {
    <code>
  }"
You will also have the ability to use switch/case statements that will be used in a similar fashion.

METHODS / FUNCTIONS
Methods, since they don't return anything, are sub-procedures and therefore will be accessed by
 "<modifiers> sub <method name> ([<arguments>]) {
    <code>
  }"
Functions will be similar, replacing "sub" with their return type.
 "<modifiers> <type> <function name> ([<arguments>]) {
    <code>
    return <type>;
  }"

LOOPS
Will support 4 types of loops:
-While
 "do {
    <code to be executed until condition is false>
  } while (<condition>);"
-Until
 "do {
    <code to be executed until condition is true>
  } until (<condition>);"
---Both of the above loops can have the "test" (the "while" or "until" part) either before "do", or after the closing brackets like in the example.
-For
 "for (<int>[ = beginning], <end>[, increment]) {
    <code>
  }"
-For Each
 "foreach (<type> <var> in <collection [of type]>) {
    <code>
  }"
Thanks to calcdude for the idea of testing before and after.

CLASSES
Will be implemented in the same way that most languages (at least the ones I know) implement them.
 "<class name> <class var name> = new <class name>;"

ENUMS
An enum, in case you don't know what it is, is basically a group of numbers. However, in Zenon, they can be a group of anything. (If that can't be done, then a new group type will be added called Group)
-Declared:
 "<modifiers> enum <name> {
    <name> = <number>,
    <name2> = <number>,
    etc.
  }"
-Accessed:
 "<enum> <var name> = <enum>:<enum child>;"

+ARRAYS/MATRICES
As an example, here are declarations of a string array, matrix, and collections that have more that 2 dimensions:
-Array:  str# hello = new str#[0][1][2];
-Matrix: str# hello = new str#[[0][1][2],[3][4][5]];
-Multi:  str# hello = new str#[[0][1][2],[3][4][5],[6][7][8]];
Or, for non-specific declarations, one can do
-Array:  str# inf = new str#[];
-Matrix: str# inf = new str#[,];
-Multi:  str# inf = new str#[,,];

« Last Edit: December 06, 2011, 04:05:43 pm by BlakPilar »

Ashbad

  • Guest
Re: The dawn of a new OOPL
« Reply #1 on: August 14, 2011, 11:10:24 am »
Will this language be interpreted, or compiled?  If compiled, strong typing is good, and I even suggest you look into the typing system if Haskell; it's pretty awesome.  If compiled, I suggest a typing system similar to Ruby's or Python's.

For syntax, many people will say "keep it similar to other languages!" but I always found that it's cool to make up something a bit different.  One type of syntax I always liked was from my old language project, Verdant (http://ourl.ca/11300) and while the language design was highly flawed, the actual syntax was rather nice.

For a name, you could always just call it "Project Xenon" for now, and come up with an actual name later.

Good luck with this; most language projects here (80% of them were probably mine -- I made *many* attempts at creating programming languages before losing interest, but even still I'm secretly working on one all the time) usually die, but the ones that live to see the light of the world do fabulous.  Hope it goes well! :)

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: The dawn of a new OOPL
« Reply #2 on: August 14, 2011, 11:31:58 am »
Well right now the project name is Yanoopl (yet another object-oriented programming language), but for the name, the misspelling was intentional ;)

The language will be compiled until I figure out how to add some sort of debugging system like Visual Studio and its breakpoints (because I'd imagine there's some interpreting there.)

I don't think this will be dropped. It will slow down when school starts and pick up on breaks, but I think this is something that will definitely help with colleges and jobs in the future lol. Plus this is something I've been meaning to do for a while, and now I know how.

I'm not on a computer now, but I'll look at Haskell and your language when I am.
« Last Edit: August 14, 2011, 07:38:08 pm by BlakPilar »

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: The dawn of a new OOPL
« Reply #3 on: August 14, 2011, 12:35:57 pm »
Is this going to be used with on-calc programming, or will it need to be compiled on a computer?
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: The dawn of a new OOPL
« Reply #4 on: August 14, 2011, 01:01:36 pm »
This has nothing to do with the calculator lol

EDIT: Damnit, wrong forum... Can someone move this? <_< (To here)
« Last Edit: August 14, 2011, 01:05:03 pm by BlakPilar »

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: The dawn of a new OOPL
« Reply #5 on: August 14, 2011, 01:33:59 pm »
This has nothing to do with the calculator lol

EDIT: Damnit, wrong forum... Can someone move this? <_< (To here)
Done.

This sounds like an interesting project. Can't wait to see how it turns out.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: The dawn of a new OOPL
« Reply #6 on: August 14, 2011, 03:08:01 pm »
Thank you!

Until I get some syntax down, really the only thing I can work on is the environment and maybe some compiling :/

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: The dawn of a new OOPL
« Reply #7 on: August 14, 2011, 06:57:20 pm »
This has nothing to do with the calculator lol

EDIT: Damnit, wrong forum... Can someone move this? <_< (To here)

Got it, I was a little confused :)
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: The dawn of a new OOPL
« Reply #8 on: August 14, 2011, 07:21:43 pm »
Lol, sorry about that fredkin.

Anywho, I've added some beginning syntax to start things off. :D

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: The dawn of a new OOPL
« Reply #9 on: August 14, 2011, 11:58:59 pm »
Umm. A couple of things. I think you should make strings be able to be in single our double quotes, just because so many people are so used to that. Also, instead of the @ symbol, PLEASE PLEASE PLEASE use escape characters ("\n"=newline "\t"=tab "\\"=\ "\0"=null "\""=" "\'"=' etc.)
They are used for every computer language I've seen. (Python, Java, C++, C, Groovy, C#, Javascript, PHP, etc.)
Finally, methods can return a value. If they don't want to, then the return type is void.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: The dawn of a new OOPL
« Reply #10 on: August 15, 2011, 12:59:04 am »
Umm. A couple of things. I think you should make strings be able to be in single our double quotes, just because so many people are so used to that. Also, instead of the @ symbol, PLEASE PLEASE PLEASE use escape characters ("\n"=newline "\t"=tab "\\"=\ "\0"=null "\""=" "\'"=' etc.)
They are used for every computer language I've seen. (Python, Java, C++, C, Groovy, C#, Javascript, PHP, etc.)
Agreed. I think the C style of quotes, where single quotes are for a single character, literally replacing it in the program with the ASCII constant, and double quotes for strings, works better, rather than not differentiating between the two, though.
« Last Edit: August 15, 2011, 01:01:17 am by t0xic_kitt3n »

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: The dawn of a new OOPL
« Reply #11 on: August 15, 2011, 01:12:40 am »
I think single line comments using "//" would be nice. I know I usually just use that for all my commenting.

You seem to use a lot of brackets, what if things like arguments were separated by brackets instead of commas, say:

Code: [Select]
MyFunc([arg1][arg2][arg3])

{{or}}

int [var1][var2][var3];

{{or even}}

int array1[5] = [[1][2][3][4][5]];

{{[] == null}}

« Last Edit: August 15, 2011, 01:13:06 am by HOMER-16 »

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: The dawn of a new OOPL
« Reply #12 on: August 15, 2011, 09:34:40 am »
Umm. A couple of things. I think you should make strings be able to be in single our double quotes, just because so many people are so used to that. Also, instead of the @ symbol, PLEASE PLEASE PLEASE use escape characters ("\n"=newline "\t"=tab "\\"=\ "\0"=null "\""=" "\'"=' etc.)
They are used for every computer language I've seen. (Python, Java, C++, C, Groovy, C#, Javascript, PHP, etc.)
Finally, methods can return a value. If they don't want to, then the return type is void.
Going in order:
-I suppose I could use both, but it's just hitting the key associated with both once easier quicker than holding shift then hitting it? (Basically, isn't it easier quicker to just type a ' than a ")
-I'll use the escape character for the single quote, but I had already planned to implement it for other characters like tab, line feed, etc.
-I've never seen something like "private void something() { /*code*/; return void; }". To me, methods and functions are different. "private void" would be a method, and "private <any type other than void>" would be a function.

Agreed. I think the C style of quotes, where single quotes are for a single character, literally replacing it in the program with the ASCII constant, and double quotes for strings, works better, rather than not differentiating between the two, though.
But honestly, how often do you use a char literal? (I'm not being a smart-ass, I really want to know :P) I might implement the char type for shiggles, but I don't even know how often it's used.

I think single line comments using "//" would be nice. I know I usually just use that for all my commenting.

You seem to use a lot of brackets, what if things like arguments were separated by brackets instead of commas, say:

Code: [Select]
MyFunc([arg1][arg2][arg3])

{{or}}

int [var1][var2][var3];

{{or even}}

int array1[5] = [[1][2][3][4][5]];

{{[] == null}}

Well, when I wrote something like "([arguments])", I meant that the "arguments" part was optional, but I like that idea :). The only thing I'd change would be the array part. It's going to be like VB (without the ability to change index numbers :P), so it would be "int array1(5) = ([1][2][3][4][5]);" I'll also put in single line comments with "//".
« Last Edit: August 15, 2011, 09:40:20 am by BlakPilar »

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: The dawn of a new OOPL
« Reply #13 on: August 15, 2011, 10:09:19 am »
Also, global variables could have a symbol, like $[var] and could be defined with <>

int [regvar]<globalvar>
* HOMER-16 wonders if there could be a command that allows the programmer to include other .NET languages within the code

Hmm. Like:

Code: [Select]
{{Zenon code here}}

|<C#>
/*
C# code here
*/
|

{{More Zenon code here}}


Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Ashbad

  • Guest
Re: The dawn of a new OOPL
« Reply #14 on: August 15, 2011, 10:21:13 am »
Umm. A couple of things. I think you should make strings be able to be in single our double quotes, just because so many people are so used to that. Also, instead of the @ symbol, PLEASE PLEASE PLEASE use escape characters ("\n"=newline "\t"=tab "\\"=\ "\0"=null "\""=" "\'"=' etc.)
They are used for every computer language I've seen. (Python, Java, C++, C, Groovy, C#, Javascript, PHP, etc.)
Finally, methods can return a value. If they don't want to, then the return type is void.

^ agreed with all of that

Since is is probably intended to be a bit higher level of a language than C/C++, can ENUMS be composed of algebraic data types instead of just aliases for numbers?

Another thing: the subroutine thing has little point if it *takes* arguments but doesn't return anything.  The function thing is on the right path, though I think you should just stick with the function thing but call it a sub instead (so that way if you in the future decide to add real functional aspects to the language, you don't have to completely re-invent everything)

Also, having something like "var" for declaration of any type and "string" for declaration of a string is a bit mixed up, since if you're going to have a var declaration you should just make it solely "var" or make them type in the type of the declared variable beforehand (the latter is like most statically typed languages, the former is more like dynamic declaration because a variable is never bound to a declared type)

Also, if this is an object oriented programming language, classes are a *must* for any initial release.  Without classes, it's not real object oriented programming, it's more of a struct-defined language, with no firm backbone for objects and no way for users to declare their own slew of object frameworks.