Author Topic: Antelope (formerly "OPIA") - A Polymorphic z80 language  (Read 43938 times)

0 Members and 1 Guest are viewing this topic.

Offline shkaboinka

  • LV3 Member (Next: 100)
  • ***
  • Posts: 86
  • Rating: +10/-1
    • View Profile
    • Antelope (polymorphic z80 language)
Antelope (formerly "OPIA") - A Polymorphic z80 language
« on: July 15, 2011, 09:23:16 am »
Sorry to link it like this rather than posting all the details, but I already have it nicely formatted:

[EDIT: here is the current link): http://tinyurl.com/z80antelope

This language has gone through MUCH theorizing and many changes, and now it is about ready to code. Before I do so, I'd like some feedback. I have many of the same goals as were with the AXE Parser; but the differences are large enough that the two language will not be in direct competition with each other. For example, OPIA must be compiled on a computer; but it has the same feel and features as C#/Java/C++, and rather than having "everything you need" built in, it can be used or developed in all different kinds of ways.
« Last Edit: July 11, 2012, 12:13:35 am by shkaboinka »

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #1 on: July 15, 2011, 09:25:43 am »
This looks good. I'll be interested to see what comes of it.

What is the speed of this?
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Ashbad

  • Guest
Re: OPIA - A full OOP language for z80
« Reply #2 on: July 15, 2011, 10:00:20 am »
Shouldn't this go in "Other calc related ideas and projects"?

Also, sounds like a cool idea :). I've been secretly working on something similar for a while so, so feel free to ping me if you want to discuss some aspects of the language and some down-and-dirty specs of the 84+ :)
« Last Edit: July 15, 2011, 10:00:44 am by Ashbad »

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: OPIA - A full OOP language for z80
« Reply #3 on: July 15, 2011, 10:21:08 am »
So, in a sense it's a C# or C++-like language that compiles into Z80? (If so, then you are a god!) :P

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 ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #4 on: July 15, 2011, 10:28:01 am »
So, in a sense it's a C# or C++-like language that compiles into Z80? (If so, then you are a god!) :P
It seems that it is a very C++ like language(I read through part of the readme)
You are an epic god shkaboinka
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #5 on: July 15, 2011, 10:31:03 am »
Shouldn't this go in "Other calc related ideas and projects"?

Of course, not everybody gets a Major Community Project XD

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #6 on: July 15, 2011, 10:32:42 am »
This reminds me of something Ashbad and I tried to do a while ago. But it never really got started. I think I still have the basic compiler source that I started on (C++). Want it?
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 shkaboinka

  • LV3 Member (Next: 100)
  • ***
  • Posts: 86
  • Rating: +10/-1
    • View Profile
    • Antelope (polymorphic z80 language)
Re: OPIA - A full OOP language for z80
« Reply #7 on: July 15, 2011, 10:54:33 am »
OPIA itself is a do-over of a previous project ... I made the mistake of releasing it with all kinds of bugs and lack of [sufficient] testing; but I learned a lot from it. Yeah, I'd love to talk about other related projects/ideas, and perhaps we can refine this a bit? ... I'm happy that there are other people out there doing this kind of thing though; until AXE came out of nowhere (and BBC Basic), I thought I was the only one.

Any emails I get ([email protected]) with "OPIA" on it will get filtered, and I can talk more specifics

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #8 on: July 15, 2011, 10:55:43 am »
perfect.
What language were you going to do the compiler in? C++?
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 shkaboinka

  • LV3 Member (Next: 100)
  • ***
  • Posts: 86
  • Rating: +10/-1
    • View Profile
    • Antelope (polymorphic z80 language)
Re: OPIA - A full OOP language for z80
« Reply #9 on: July 15, 2011, 11:18:21 am »
I am going to do it in Java (packaged into an executable Jar) for 2 reasons:
 - It can be run on any machine.
 - It will code it as an API that can be exploited to construct a program in an OOP way rather than by typing it out ... if, hypothetically, someone makes such a thing; but it will be possible (like Bluej) ... basically, if another java-based tool wants to analyze OPIA code before compiling it, instead it can just have the compiler do it anyway, tinker with it, and then hand it back to the compiler.

I am going to make it command-line based, like the Java compiler is, so you just go "OPIA myprogram" or something; but you can pass in other things about where to look for files, and what environment to use (otherwise having to be specified in the code), etc. That will ALSO allow it to be interfaced with a nice GUI editor, which perhaps has it's own ideas about "projects" and managing files, and associating an environment in some other way than as part of the code ... I wanted it to be flexible. I can see this hooking right up to Notepad++, for example.

One other point: If there is a nice Java-based assembly compiler out there, that would be nice. Otherwise, I wouldn't mind undertaking to make one, JUST so that I can have one tool (or a couple of them) to spit out a ready program :)
« Last Edit: July 15, 2011, 11:20:15 am by shkaboinka »

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #10 on: July 15, 2011, 11:39:09 am »
Humm. Java-based assembler. I don't happen to have one on hand, but I would love to work on one. I would also love to work on this compiler thing.
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 shkaboinka

  • LV3 Member (Next: 100)
  • ***
  • Posts: 86
  • Rating: +10/-1
    • View Profile
    • Antelope (polymorphic z80 language)
Re: OPIA - A full OOP language for z80
« Reply #11 on: July 15, 2011, 11:49:31 am »
Language aside, I can talk compiler-theory all day :) ... I have my own technique for Tokenization (inspired by Java's approach to enums) that I think is the stuff :P ... it seems like a small part of the process, but using final class instances for tokens gives you some solid tools that can make a compiler amazingly fast (and cleaner)! :D
« Last Edit: July 15, 2011, 11:50:58 am by shkaboinka »

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #12 on: July 15, 2011, 12:15:20 pm »
I love compiler-theory. It's so interesting. I prefer making class instances for each statement, but I think your way might be better, I'm just a little worried that it wouldn't have support for class names and such (you really need instances for that). But I think a middle-ground could be achieved.

EDIT: Btw, what IDE do you use?
« Last Edit: July 15, 2011, 12:16:26 pm by Binder News »
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 JustCause

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 810
  • Rating: +115/-5
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #13 on: July 15, 2011, 12:30:26 pm »
OOP? For z80?
* JustCause dies of wanting this

Good luck!
See you, space cowboy...

Offline shkaboinka

  • LV3 Member (Next: 100)
  • ***
  • Posts: 86
  • Rating: +10/-1
    • View Profile
    • Antelope (polymorphic z80 language)
Re: OPIA - A full OOP language for z80
« Reply #14 on: July 15, 2011, 01:19:19 pm »
Oh yeah JC, this is it.  Since 2004, my mind has been on this topic, and I've read 1 tutorial, 1 amazing book, skimmed a bunch of others, but mostly spent countless hours/days/months at a time pouring over various aspects of an OOP language for z80, and compiler techniques ... this is happening ... maybe not tomorrow, but it will happen :)

...instances and tokens... Yes. This is why I did not actually use the Java ENUM; but my Token class contained a whole list of static final instances for all the keywords and operators, and some "signals" used by the compiler; For identifiers ("names"), it would store an internal tree of Token objects for each identifier it found. When it encountered one, a method would feed it into the tree, and if it existed already, it would return THAT instance; otherwise it would make a new instance and put it in the tree, and return that. That way, comparing names, keywords, operators ... anything... was a matter of straight-up reference comparison ( == rather than .equals). For numbers and strings (and other literals) though, I just let it make new ones. Anyway, each token object contained a final int value that flagged what "kind" of token it was, another final int that stored bit-flags (or for number tokens, stored the numeric value), and a string value that contained the actual string-value of the token. That might sound like a lot of work, but each final instance is declared with the right values in the first place, and identifiers get certain values set ... and then there were methods that looked at that kind of information, so you could just get a token and ask "is it an operator? is it an overloadable operator ... with 1 or 2 arguments (or both)? is it a keyword? is it a control-flow construct? is it numeric?" ... etc, and those checks would not have to check if it was one of some 50 tokens, but just a simple value or a bit or something.

As for OOP on everything else, I had OOP constructs to represent classes, functions, variables, blocks of code, statements, expressions, etc., so pretty quick I could get a whole structure of a program into a very easy to manage tree-like structure, and easily go "Ok, let's look at all the classes and make sure they don't have any circular inheritance, and that they behave together". I had constructs for DataTypes too, which were flexible (polymorphic; some were just primitive Tokens; others were classes; others were complexities of arrays of things). One thing I may do differently this time though ... I went back and made everything that could be the "entity" referred to by an identifier to inherit from "Entity", so that expressions and variables and so on had direct references to "entities". Then I could go back through and replace all the references to Identifier tokens with the actual things they were referencing, without damaging the structure of the parse-tree ... that was actually a bit of a nightmare, because it had to be in a very careful order so that one could identify inner/inherited namespaces properly ("a.b.c"); and the way it handled "private" and "protected" stuff was a bit interesting (it used the "invisible" technique, so things were suddenly "undefined" rather than just restricted). ... But I've done more study about ways to use a symbol table, and I think it would be fine to just stick with that :)
« Last Edit: July 15, 2011, 01:27:07 pm by shkaboinka »