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

0 Members and 2 Guests are viewing this topic.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: The dawn of a new OOPL
« Reply #15 on: August 15, 2011, 12:15:23 pm »
@HOMER, if that'd be easier to help identify if vars are global or internal, sure, I'll add that. As for the other-language thing, again, nice idea. I think if I did that, though, I would probably have the other-language code be on its own page and have "#imports <file name>;" or something similar at the top.

@Ashbad, for enums, do you mean something like this?
Code: [Select]
int hello = 5;
private enum Test [[
  Times2 = hello * 2,
  Plus2 = hello + 2,
  etc.
]]
As long as the variable used to modify the values is local, I'm sure it wouldn't be too hard to implement. If I can't do that, though, would something like an enum but called a "typegroup" (name off the top of my head :P) that can do that be sufficient? As for "var" I just thought that would be nice because I know that's something people who use Python really like about it. But, if it's redundant, I'll remove it. And I know classes are a must, but are namespaces?

Ashbad

  • Guest
Re: The dawn of a new OOPL
« Reply #16 on: August 15, 2011, 12:44:41 pm »
No, algebraic data types so that the elements of an enum like is:

Code: [Select]
enum colors {
  red,
  blue,
  green,
}

So that red, blue, and green are different values, and don't just correspond to an integer type.  Of course, checking between data types would be done mostly at compile-time.  This is just a little part about how algebraic data types work (different ways to construct them and treat them based on used value constructors, etc.) but it makes things safer and less error prone.

Also, namespaces are good.

SirCmpwn

  • Guest
Re: The dawn of a new OOPL
« Reply #17 on: August 15, 2011, 12:53:16 pm »
What is your goal with this language?  There are already plenty of good object oriented languages out there for .NET.  I don't mean to be discouraging, I just don't want you to be disappointed at the end of this project.  C# and VB.NET have hundreds of developers working on them :/

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: The dawn of a new OOPL
« Reply #18 on: August 15, 2011, 12:59:10 pm »
@Ashbad, alright, I think I understand and can probably implement that.

@SirCmpwn, the goal is just to be a usable OOPL. I know other .NET languages are more widely used, but I just think it'd be neat to have a language to call my own ;D
« Last Edit: August 15, 2011, 01:00:38 pm by BlakPilar »

Offline Spyro543

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1189
  • Rating: +74/-3
    • View Profile
Re: The dawn of a new OOPL
« Reply #19 on: August 15, 2011, 05:12:24 pm »
I should post about my project of making a programming language...

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: The dawn of a new OOPL
« Reply #20 on: August 15, 2011, 05:27:21 pm »
I should post about my project of making a programming language...
You should.

Also...
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)

I disagree. You can have a subroutine that takes arguments yet does not return anything. Especially if you use that subroutine over and over.

For example, before I started using SharpDevelop's TextEditor, I attempted to make my own. In that, I had a subroutine called Reset, and it looked like this.
Code: [Select]
private void SetCurrent(Color highlight, int pos, int len) {

    this.SelectionStart = pos;
    this.SelectionLength = len;
    this.SelectionColor = highlight;

}

I could use that whether I was highlighting a word, or just setting the colors back to normal to resume typing.

Keeping "sub" and "<any type other than sub>" will also help with organization and readability, in my opinion.
« Last Edit: August 15, 2011, 05:29:35 pm 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 #21 on: August 15, 2011, 06:52:32 pm »
I think you should take the C++/C#/Java/Etc way of things and have a modifier if the function doesn't return anything. Also, I thought methods and functions were the same thing more or less and were used interchangeably.

But I think it would add confusion if there was a separate command for void functions than regular functions.

Perhaps:
Code: [Select]
null func1()
[[
{{Code here}}
]]

And I don't think void functions are just subroutines. I've used them for taking objects passed to them via address and modify them directly. Like displaying images to a Window and whatnot. Though idk, would sub make them lighter and faster than just a different data type for a function?

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 #22 on: August 15, 2011, 08:13:31 pm »
How would having a "separate command" add confusion? C# has "null" and "void" which are essentially the same thing. The only difference (between methods and functions) is in voids, nothing is returned because it doesn't take "void" or "null" as an actual type definition.

When I was taught programming in school, I was told that a subroutine could or could not be passed any number of items and it could choose to directly modify those items or use them to modify something else within the program, and a function could or could not take arguments but returned some kind of value whose type was not null or void, but it could be null in value.
So this would be a subroutine (NOTE: in the class that I took, we used VB6; I'm just applying my learning to C#):
Code: [Select]
private void RoutineName(<any number of modifiers>) {

    //do stuff, but don't return anything

}
And this would be a function:
Code: [Select]
private <any type that's not null or void> FunctionName(<any number of modifiers>) {

    //do stuff

    return <variable that is the same type as that specified in the function definition>; //This was the key difference between a function and a subroutine; this actually returned something

}
That's what I mean when I talk about that.
« Last Edit: August 15, 2011, 08:17:44 pm 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 #23 on: August 15, 2011, 09:12:06 pm »
Oh I see. I thought there would be a different way of defining a subroutine and a function other than data type so that threw me off a bit.

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 #24 on: August 15, 2011, 09:16:32 pm »
Nah, it's more of my bad because I assumed that that was how those were generally defined. But, you know what they say about assuming ;)

Offline XVicarious

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +45/-28
  • I F**king Love Twisty Puzzles
    • View Profile
    • XVicarious
Re: The dawn of a new OOPL
« Reply #25 on: August 15, 2011, 09:25:19 pm »
I don't know if someone already responded to you about the whole " vs ' thing yet (I skimmed after a few posts), but for programmers now typing a " for a string is second nature. Making it easier. If it is someone who is learning to program than IDK maybe it is.
Its just my opinion because I am just so used to pressing Shift-' to make a string.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: The dawn of a new OOPL
« Reply #26 on: August 15, 2011, 09:31:21 pm »
Yeah, I agree now. I tried making a few sample dummy codes and I constantly typed " before ', so I'll just leave strings to be what every other programming language does. If I do implement chars, though, I'll make it similar to C# and use 's to define char literals.

Also, DERP on my part. I forgot about loops <_<

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 #27 on: August 16, 2011, 07:22:01 pm »
* HOMER-16 wonders if there could be a new kind of loop that could be useful to add.

I can't wait to try this language. Hopefully it will catch on. :D

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 #28 on: August 16, 2011, 07:51:04 pm »
Hey, if you can think of a new loop and at least it's equivalent in VB or C#, I'll do my best to implement it :)

And I can't wait to try it out either, and hope it catches on too, but I need to at least get the layout finalized and get the compiler ready for a couple of controls :/

Offline Spyro543

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1189
  • Rating: +74/-3
    • View Profile
Re: The dawn of a new OOPL
« Reply #29 on: August 17, 2011, 08:06:32 am »
Add Darl181s to this language!!!
Spoiler For what I'm talking about:
Add Gotos. What did you think I was talking about? <_<