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

0 Members and 1 Guest are viewing this topic.

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 #15 on: July 15, 2011, 01:32:46 pm »
Okay. Umm. Do you have example source code for that? I think I get what you are saying, but I'm not entirely sure. Also, will this be  GNU, GPL, or something else?
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 #16 on: July 15, 2011, 01:55:07 pm »
I did GPL with Antidisassemblage before (which was basically "paste this into your stuff"); but I'm not sure what my options are for that, or what's necessarily better.

Perhaps I can get a sample of it; I will let you see what I have for the Token class :) ... email me at [email protected] and I will reply

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #17 on: July 15, 2011, 01:56:50 pm »
If you're going to write a serious compiler, it's pretty much a prerequisite to read the Dragon book. I've found it to be really good at explaining a lot of the techniques and difficulties in building a compiler.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

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 #18 on: July 15, 2011, 02:15:59 pm »
Yes, thank you.  I've found many compiler books, and most of them were way outdated and all about the importance of using tools like "Lex" etc. ... Anyway, I've only ever really found 2 books very useful for me, and that was one of them. I at least glanced at every page, skimming over the stuff that was repetitive, ignoring what I wasn't into (i.e. JIT and Parallel stuff ... that's not happening on z80); but I totally soaked up some good stuff from it that I wasn't finding elsewhere!

The other book, which I think is the best book in the world for what it's about, is "Modern Compiler Implementation In Java" by Appel. That book showed all the good stuff about polymorphic language design, data-flow analysis, register-coloring, etc. Honestly, I don't quite remember what came out of the Dragon Book for me, just that it was helpful and I wouldn't have found it elsewhere.

There have been ideas I've come across on my own as well though, only to discover that it's been talked about in not a few places (Code mutation to store variables; using jump tables; and symbol tables ... I never understood them the way the books tended to explain them, but I came up with a "great idea" about how to track that kind of stuff, and realized that it was the same thing; only I'd do it in a more OOP manner).

...But yes, references are VERY important. When I first started on compiler design, I thought I could just "figure it out"; but I was referred to the "Lets make a compiler" tutorials by Jack Crenshaw, from which I mastered the idea of a recursive decent pattern and recursive expression parsing and tokenizing (which actually are quite fundamental if you want to make a compiler, period). ...anyway, from there is was my own tinkering and thinking, and then the Dragon Book, and then the Java book, and then a bunch of outdated books that I didn't get squat from :P ... But those 2 books (and Jack Crenshaw, which I think is an excellent place to start) helped more than anything else could have.

 ---> If anyone wants to be involved more directly, I just made a FaceBook group. Just search "OPIA" <---
« Last Edit: July 15, 2011, 02:48:54 pm 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 #19 on: July 15, 2011, 03:03:07 pm »
Two things, I would like to be involved more directly, however, I do not have a Facebook account and will not be getting one any time soon (of my own vocation I might add). But I check my email almost daily. Send anything to there.
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 #20 on: July 22, 2011, 01:48:53 am »
FYI, this discussion has moved almost entirely to Cemetech.net , So if anyone wants to participate further, I recommend either going there or emailing me at [email protected]

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 #21 on: July 24, 2011, 09:50:18 am »
FYI, this discussion has moved almost entirely to Cemetech.net , So if anyone wants to participate further, I recommend either going there or emailing me at [email protected]

I think crossposting stuff is better to make the project more popular, why the full move to Cemetech?

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 #22 on: September 20, 2011, 10:16:54 am »
ATTENTION ALL!

If you want to be involved directly and/or see what's what at this point, take a look: http://tinyurl.com/z80opia
I am hosting the project at Google Code, since it comes with a Wiki and repository!!!

... I imagine I've made many-ish changes since I've sneezed a word about it in here; but it is ready to start becoming code if there are no further points in the way (and if there are points, I have thought pretty hard about all the reasons for things, and its all very solid now). :)

Offline NanoWar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 140
  • Rating: +18/-6
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #23 on: September 21, 2011, 09:15:46 am »
You should involve the community for testing later. Also example programs would help :) .

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 #24 on: September 22, 2011, 09:42:52 am »
Oh, I'll do the coding; but I just wanted to make a point about where/how in case anyone wants to follow the progress and observe the making of a compiler/language. Otherwise, I will indeed make a noise when it is ready to test and make libraries/utils; and there will be examples I am sure.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: OPIA - A full OOP language for z80
« Reply #25 on: December 31, 2011, 02:13:41 pm »
I'm a bit late but I think Nanowar and Ephan points are that it's generally considered a bad practice for a forum member to constantly advertise his own site (or another) on someone else's instead of directly posting updates or copying them there, especially when you only have 10 posts. From a bunch of older member's perspective, this might look like the posts author is trying to use Omnimaga and Cemetech primarily to lure members for his site rather than getting project feedback and this might tarnish his reputation. This isn't to mention that some people are under parental control and may not be able to visit other specific sites.

On the old Omnimaga board, there was a rule disallowing forum members to advertise their own calculator site (except if they got permission) unless they had at least 2000 posts.
« Last Edit: January 01, 2012, 09:42:05 pm by DJ_O »

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 #26 on: January 01, 2012, 09:50:48 pm »
Sorry DJ ... I began posting about it in both places, and got a decent initial response in both. However, it only REALLY took off at Cemetech, and thus decided to keep most of the posts there (they are time consuming, because they are thought out). Rather than just abandon [these people] altogether, I left notifications ... but I see how that could be a problem. I don't want to "steal" followers from one site to another, and I suppose I could have just copied posts and reposted them here. So much information was interchanged at Cemetech that I found it would be an overwhelming task to keep it all in both places; however, to give SOMETHING of substance, perhaps I will go back and take the key points and put them in a post here. That way there is a glimpse of what's going on, and some of the key discussion.

However, my project is hosted at google code ( http://code.google.com/p/opia/ ), and even when I discuss it anywhere, I leave links there regularly, because that is where one must go to see the language documentation and source etc. (I am not going to host it in multiple places). I will, however, go back and put a lot of the key discussion here as well.

Sorry for the misunderstanding! ... I promise a lot of information HERE soon.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: OPIA - A full OOP language for z80
« Reply #27 on: January 01, 2012, 10:19:28 pm »
Hi shkaboinka. I was talking to Homer-16 on XBox one day and he told me about OPIA. I decided to look it up and I must say: it looks very promising. I admire the syntax you've come up with as it is not overly complex, and elegant. I especially like your implementation of anonymous functions. All in all, though, nice work. :)

I haven't read all of the Cemetech conversation, but do you happen to have an ETA for some kind of an alpha or beta release?

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 #28 on: January 02, 2012, 01:37:20 am »
It's hard to say. The vast majority of the time spent on it (more than 95%) has been conversational and hammering out all the theory. Look up "Antidisassemblage" (but make sure you find version 1.6 alpha), which is a precursor. I spent 2ish years on it, and roughly 6 months of that involved coding what it is; and not more than 20% of that time was actual coding. OPIA is me deciding to scrap that altogether and start all over again, but with much of the same ideas ... so you could say I've been at it for 6 years (not counting a 2 year leave). OPIA was GOING to be very Java/C#-ish, and was VERY nearly all figured out; but then I came across the design of Google's "Go" language, which offers the same polymorphism in a more flexible and simplified form. Thus, just over a month ago, I redesigned the language (again (again (...))); but I have some code in place now, and I spent perhaps a month on the Tokenizer (between school etc.), and basically the last week writing the Preprocessor (finished), and I have yet to write the syntax-tree stuff (at least 2 weeks), the code analysis stuff (at least a month), the assembly conversion (at least a month), other aspects between those (a week), and other touch ups etc. (another week) ...

... So my guess is at LEAST 3 months from now; and that is assuming that school and moving etc. do not push it way to the back (which is likely) and that I do not run into other major changes I want to make (I can scarcely think of any way to improve it more) ... but supposing there are delays, probably 6 months ... I want to have it pretty well set within this year though.

However, even now, there are working & testable aspects of the compiler, and I'd like people to try things out and give me feedback if they want to assist. ... Random thought: if I finish this up, and there is a demand for it, perhaps I can make another version that uses the Java/C#-ish form instead (it would be very similar though and use a lot of the same compiler parts) ... but I don't know if that is likely. I chose the new design because it was simpler and more powerful and lighter weight, which I felt was appropriate for a z80/embedded-ish language.

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 #29 on: January 02, 2012, 04:40:54 pm »
A random list of points discussed previously on other forums (modified):

BOOLEANS - Booleans are a whole byte because it takes extra instructions to extract/insert just one bit, which adds more than just another byte to the program just for using it; so it actually saves space that way.

MEMORY MANAGEMENT - No Garbage collector will be built-in. However, functions can be written which will enable the "new" (and "delete") operators for the language. The idea is that any kind of memory management can be plugged in (whether coded manually, or already part of the platform/OS). As for static allocations, there are preprocessor directives whuch can be used to signify sections of "same RAM" which the compiler will use for larger things that lack initialization values.

VIRTUAL FUNCTIONS - I was originally going to have the compiler just KNOW when functions should be virtual/late-bound because of the overridden definitions (like Java). However, requiring one to explicitly say which functions are virtual (like C#/C++) means that a the internal representation of a class can be determined without having to look at other code. This is important because OPIA allows you to specify an address where something is already stored (e.g. precompiled or otherwise already existing) rather than allocating space for it otherwise.

ENVIRONMENT DEPENDENCIES - If a program is completely generic (i.e. nothing platform-specific), then it will run anywhere (directly on the bare hardware). Standard representations of functions, arrays, etc. also allow things to be picked out explicitly and used with new code. The whole compilation process is going to be very modularized, such that it can be used an API by other tools (e.g. an IDE which uses the compiler itself to highlight syntax and find errors, but without doing a full compile).

FEATURES - OPIA will ONLY include features which would be difficult to do with the language otherwise, which can be implemented using close to the same overhead NECESSARY as if done manually, and which do not add unnecessary complexity to the language. For example, I was going to have classes & interfaces (I will post more about that later) because one would HAVE to use late-bound functions and virtual tables to simulate that anyway; but I have even replaced classes & inheritance with structs and simpler interfaces because it makes the language simpler, adds more power/flexibility, and provides a much closer representation of the underlying mechanisms used. OPIA will NOT include operator overloading, bounds-checks (or any built-in error handling), excpetions, or assertions (though interpreted aspects can be used to compile code dynamically). I was going to provide parametric types (using type-erasure, since that provides a single representation for each thing); but with the new Go-style interfaces, OPIA might be fine without them ... maybe in the future, but I'm not promising it.

VALUE PASSING - Always pass-by-value. I was going to provide reference-types, which use pointers internally, but now that I've switched to a simpler Go-like setup, one can just use pointers directly as needed.

NAMING - I really do not see what it wrong with the name "OPIA" (except for the similar spelling to "opium"); but the only other name suggested so far that I even like at all was "Candu" (Malay for "opium"). No Z++, because there are too many letters and pluses and sharps etc. already. No "TI" anything, because it will run on ANY z80 machine (though heck yes, TI's are the focus) ... but seriously, is "OPIA" such a bad name? (Object-oriented Pre-Interpreted Antidisassemblage ... though admittedly, the Go-style is polymorphic and object-based without being truely object-oriented in the traditional sense).