Welcome, Guest. Please login or register.

Author Topic: Learn to program Amiga applications and games in #AmigaE  (Read 21763 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #14 on: August 16, 2011, 06:57:45 PM »
Quote from: desiv;654938
Object oriented??  I hope not.. I got out of serious programming just before that became popular..
And what exactly is wrong with object orientation?
 

Offline Fats

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 672
    • Show only replies by Fats
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #15 on: August 16, 2011, 08:49:13 PM »
Quote from: JJ;654930
Is AmigaE a fully OO language like .net


It's OO but not like you know it. It is a OO language that is not type checking (that's also why I don't consider PortableE a real AmigaE implementation as it is type-checked).
Syntax is more like pascal than C, no curly braces but the use of the END keyword.

greets,
Staf.
Trust me...                                              I know what I\'m doing
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #16 on: August 16, 2011, 08:52:19 PM »
AmigaE is an OOP language.  We're just about to start covering inheritance soon.  There are some bugs in the way that some features are implemented in the emodule format so the class/hash.m module doesn't work right.  I'm working on a replacement for that in my spare time.  There are a few object-oriented classes in it for linked lists and so on but they aren't in a shared library.  In fact, the library mode of AmigaE is so borked that we won't be using it.

We're covering preprocessor macros also in an effort to make our emodule source work on PortablE as well as AmigaE.

@Thorham
OOP uses arrays of function pointers in order to implement inheritable methods.  They make those methods have more calling overhead than ordinary functions.  It's kind of like the way that the jump tables in shared libraries are slower than a normal function due to the calling overhead.
 

Offline jj

  • Lifetime Member
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4052
  • Country: wales
  • Thanked: 2 times
  • Gender: Male
    • Show only replies by jj
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #17 on: August 17, 2011, 12:53:26 PM »
But the adavantages of OO desing well outweigh that disadvantage.
 
As somone explained it to me recently, as I was not up on OO until I started working towards my MCTS is.   Things in world, things in brain, things in code.
 
Trying to understand UML properly at the mo and reading a book on it
“We don't stop playing because we grow old; we grow old because we stop playing.” - George Bernard Shaw

Xbox Live: S0ulA55a551n2
 
Registered MorphsOS 3.13 user on Powerbook G4 15"
 

Offline Amiga_Nut

  • Hero Member
  • *****
  • Join Date: Jan 2007
  • Posts: 926
    • Show only replies by Amiga_Nut
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #18 on: August 17, 2011, 01:12:07 PM »
How fast is AmigaE exactly?

Is it faster for hitting the blitter/copper than Blitz Basic 2.1? And if so by how much percentage wise are we talking?

I only ask because me and another member at A.org are in the very early stages of doing a new 3D (not real 3D...SEGA style '3D') shootemup and we had planned to use Blitz. Nothing much will happen until we both leave our jobs.

However we have also put together quite a sweet little algorithm for an 80s version of Oblivion style '3D' renderer too and may put this either into a 3D RPG or another game e.g. remake of a 2D C64 classic actually.

(PS both games will be released for free btw, with the option of donating to our cause if you like the games).
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #19 on: August 17, 2011, 02:29:21 PM »
It doesn't have a hardware-banging "Blitz Mode" like Blitz Basic has, but you can bang the hardware if you have to.  The code generator should be comparable to Blitz 2 otherwise.

The main advantage of AmigaE is that the modules are reusable for many applications.  You can make system-friendly code really easily with it.
 

Offline commodorejohn

  • Hero Member
  • *****
  • Join Date: Mar 2010
  • Posts: 3165
    • Show only replies by commodorejohn
    • http://www.commodorejohn.com
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #20 on: August 17, 2011, 03:56:10 PM »
Quote from: Amiga_Nut;655044
However we have also put together quite a sweet little algorithm for an 80s version of Oblivion style '3D' renderer too and may put this either into a 3D RPG
Well this makes me tingly with anticipation :D
Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
Synthesizers: Roland JX-10/MT-32/D-10, Oberheim Matrix-6, Yamaha DX7/FB-01, Korg MS-20 Mini, Ensoniq Mirage/SQ-80, Sequential Circuits Prophet-600, Hohner String Performer

"\'Legacy code\' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup
 

Offline Fats

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 672
    • Show only replies by Fats
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #21 on: August 17, 2011, 09:40:23 PM »
Quote from: Thorham;654960
And what exactly is wrong with object orientation?


My major gripe with OO is that it often leads to overdesign by implementing unused methods to make APIs complete, very long inheritance chains etc. OO seems to really get the worst out of (some) mediocre programmers.
And if you look how many times programmers still reinvent the wheel, OO has not fulfilled it's promise of code re-usability either. Don't quote me on it but I think I once read it is inherent with OO and that generic programming is more fit for that.

greets,
Staf.
Trust me...                                              I know what I\'m doing
 

Offline desiv

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1270
    • Show only replies by desiv
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #22 on: August 18, 2011, 03:39:29 AM »
Quote from: Thorham;654960
And what exactly is wrong with object orientation?
The fact that I got out of programming before it started, so I haven't used it.
:lol:

My wife spent a fair amount of time programming OO code (in Windows..  I know, and I still married her...  I'll get her using gcc on Linux yet!! :-), so I could always ask her for help.. ;-)

Might drive her crazy tho; as a programmer, I'm a great sysadmin.  :)

desiv
Amiga 1200 w/ ACA1230/28 - 4G CF, MAS Player, ext floppy, and 1084S.
Amiga 500 w/ 2M CHIP and 8M FAST RAM, DCTV, AEHD floppy, and 1084S.
Amiga 1000 w/ 4M FAST RAM, DUAL CF hard drives, external floppy.
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #23 on: August 18, 2011, 06:08:52 PM »
Quote from: SamuraiCrow;654974
@Thorham
OOP uses arrays of function pointers in order to implement inheritable methods.  They make those methods have more calling overhead than ordinary functions.  It's kind of like the way that the jump tables in shared libraries are slower than a normal function due to the calling overhead.
Yeah, I know, but I don't think function tables are a bad thing... at least not when calling overhead isn't very important.

Quote from: Fats;655115
My major gripe with OO is that it often leads to overdesign by implementing unused methods to make APIs complete, very long inheritance chains etc. OO seems to really get the worst out of (some) mediocre programmers.
And if you look how many times programmers still reinvent the wheel, OO has not fulfilled it's promise of code re-usability either. Don't quote me on it but I think I once read it is inherent with OO and that generic programming is more fit for that.
Yes, but why blame oo for what people do wrong when using oo? It's like blaming your new, sharp knife for getting yourself cut. Would you rather have a blunt knife that doesn't cut well?

Another one is using the right tool for the right job. Using oo for everything is like a carpenter usinmg a hammer for everything. It's just not going to work.

Quote from: desiv;655149
The fact that I got out of programming before it started, so I haven't used it.
:lol:
Then read up on it. It's not very hard to understand and can be very useful sometimes (but not always).
 

Offline desiv

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1270
    • Show only replies by desiv
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #24 on: August 19, 2011, 04:18:03 AM »
Quote from: Thorham;655230
Then read up on it. It's not very hard to understand and can be very useful sometimes (but not always).
I might, but with what I do, bash scripts (grep, sed, awk, etc) and sometimes perl and PHP handle most of what I need..
Sometimes I poke at C code..

But I'm thinking about it..

desiv
Amiga 1200 w/ ACA1230/28 - 4G CF, MAS Player, ext floppy, and 1084S.
Amiga 500 w/ 2M CHIP and 8M FAST RAM, DCTV, AEHD floppy, and 1084S.
Amiga 1000 w/ 4M FAST RAM, DUAL CF hard drives, external floppy.
 

Offline Digiman

  • Hero Member
  • *****
  • Join Date: May 2010
  • Posts: 1045
    • Show only replies by Digiman
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #25 on: August 19, 2011, 09:08:03 PM »
Quote from: commodorejohn;655064
Well this makes me tingly with anticipation :D


We still have quite a way to go to be honest before anything is coded but I think it can be workable, if only on A1200 not A500. Think Forbidden Forest 3D in the style of Sega late 80s Arcade hardware.

We're really excited about both our games :)
 

Offline Fats

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 672
    • Show only replies by Fats
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #26 on: August 19, 2011, 11:50:53 PM »
Quote from: Thorham;655230

Yes, but why blame oo for what people do wrong when using oo? It's like blaming your new, sharp knife for getting yourself cut. Would you rather have a blunt knife that doesn't cut well?


No, but maybe OO is a two sided super sharp knife and most people should stick to using a sharp single sided knife ...

greets,
Staf.
Trust me...                                              I know what I\'m doing
 

Offline kamelito

Re: Learn to program Amiga applications and games in #AmigaE
« Reply #27 on: November 09, 2011, 12:01:41 PM »
hi,

Is the courses done in #AmigaE being archived somewhere for off-line reading?
I also like to know what the best choice between ECX, and PortablE. (I plan to use it under MorphOS)
Is it possible to write inline PPC assembler with them? Who's generating the fastest code?
Thanks
Kamel
« Last Edit: November 09, 2011, 12:12:38 PM by kamelito »
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #28 on: November 09, 2011, 04:07:56 PM »
I've started redoing certain aspects of the IRC sessions on ArosWorld.org in the PortablE forum.  The first example I've done is the bitset inventory example which shows how to do a 64-bit bitset in PortablE.

I didn't archive anything offline but will be doing some of the same examples that I did in AmigaE and porting them to PortablE on the forum I described above.

It is undesirable to write PPC assembler in most compilers because the only inefficiency to be found in the existing compiled code is the cache loading optimizations.  PortablE uses G++ (the C++ frontend for GCC) as its backend.  It should generate clean enough code for most uses.

I forgot to mention that I'm putting the Sunday evening IRC sessions on hold for now.  I'm tutoring a close friend in math at that time.
« Last Edit: November 09, 2011, 04:12:31 PM by SamuraiCrow »
 

Offline nyteschayde

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Re: Learn to program Amiga applications and games in #AmigaE
« Reply #29 from previous page: November 09, 2011, 07:06:58 PM »
It is true that many junior developers write OO code, especially in Java, that has overly long inheritance chains, but junior developers make all kinds of mistakes. This is simply one of them.

I program in C, C++, Objective C, Java, PHP, Python, and web (i.e. HTML/CSS/JavaScript). I do so for a living and am considered a senior developer by my peers. What does this mean? This really means that I've worked myself out of making many of the junior level mistakes when programming.

Are there better developers than me? Hell yes.
Do I see them often? No.
Do I crave to meet and learn from them? Absolutely

For example, Karlos is a developer that I have spoken to many times on A.org and his ability and coding level usually make my head spin. He is VERY talented. I love learning from him.

How does all this pertain to OO? OO is good when used right. It generally can be a slower implementation though because any time you make the language easier for humans it becomes a bit harder for the computer. Most modern OO languages make the safe assumption that you're using a modern computer with modern programming power and therefore this extra overhead isn't much of an issue.

OO features can be leveraged on slower machines without much of a slow down as long as you don't go overboard and objectify every single possible idea in your code. There is quite a bit of reuse of code in my experience with OO design. The problem is, fundamentally, trust. Most programmers don't necessarily give trust to others code so easily. When it comes time to use another person's code, there is often a sinking feeling (when source isn't available) that bottlenecks, problems and poor implementations come from this black box code.

The amount of time saved by using many C++ STL classes for things like vectors, maps and strings over reimplementing the same thing (over and over again) in C is amazing. If I am trying to eek out the most possible performance from a game on a limited architecture (such as say an Amiga), then using C++ STL classes would have to be evaluated on a case by case basis (and obtaining the most performance would likely mean not using them).

There are several other factors such as executable size and memory consumption to consider. Modern languages can well afford to trade speed of development for heavier usage cost because most modern computers have an order of magnitude (or more) more resources to use. Don't blame OO code because it's not well suited to a machine that was built before OO was a term, let alone a popular one.


Quote from: Fats;655115
My major gripe with OO is that it often leads to overdesign by implementing unused methods to make APIs complete, very long inheritance chains etc. OO seems to really get the worst out of (some) mediocre programmers.
And if you look how many times programmers still reinvent the wheel, OO has not fulfilled it's promise of code re-usability either. Don't quote me on it but I think I once read it is inherent with OO and that generic programming is more fit for that.

greets,
Staf.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500