Amiga.org

Amiga computer related discussion => Amiga Gaming => Topic started by: Amiga_Nut on June 14, 2010, 06:16:36 PM

Title: Native Blitz Basic for AROS ever?
Post by: Amiga_Nut on June 14, 2010, 06:16:36 PM
I am [slowly] starting a couple of games but I wondered if there were any plans for AROS specific version of Blitz for some time in the future? One of the games I am writing would look awesome in super highres but even AGA is too slow on initial tests. But on a nice beefy x86 CPU it could work really nicely and give you at least 4x more viewing area improving the game a lot.

It would be nice to be able to write games for AROS in a similarly great language too like the old day, but Google didn't find anything promising.
Title: Re: Native Blitz Basic for AROS ever?
Post by: Amigamia on June 14, 2010, 06:24:39 PM
Quote from: Amiga_Nut;564573
I am [slowly] starting a couple of games but I wondered if there were any plans for AROS specific version of Blitz for some time in the future? One of the games I am writing would look awesome in super highres but even AGA is too slow on initial tests. But on a nice beefy x86 CPU it could work really nicely and give you at least 4x more viewing area improving the game a lot.

It would be nice to be able to write games for AROS in a similarly great language too like the old day, but Google didn't find anything promising.


I know there is a project called Mattathias BASIC which is supposed to be the AMOS basic for AROS but it is far from finished I think:

http://sourceforge.net/projects/mattathias/
Title: Re: Native Blitz Basic for AROS ever?
Post by: bubblebobble on June 14, 2010, 08:50:34 PM
Amiblitz3 has a nice API for system friendly Games, running on Classic, OS4 and MOS, but not natively on AROS.

See here: http://a1k.org/forum/showpost.php?p=320433&postcount=367

I plan to write something in the far future that shall target various AmigaOSes.
Title: Re: Native Blitz Basic for AROS ever?
Post by: xeron on June 14, 2010, 10:14:14 PM
Why not just learn C?
Title: Re: Native Blitz Basic for AROS ever?
Post by: bloodline on June 14, 2010, 10:43:19 PM
Quote from: xeron;564602
Why not just learn C?
I agree with Xeron, C and SDL will hold you in good stead on pretty much any platform (AROS, MOS, AOS4, MacOS, Win, etc)
Title: Re: Native Blitz Basic for AROS ever?
Post by: Amiga_Nut on June 15, 2010, 08:35:08 AM
Thing is as far as Amiga is concerned you won't really get any performance advantage from C over BB2.1 but at the same time for me it would take many times longer to think as C programmer. And I have used C before and I find it inferior personally. It's not really my cup of tea :)

I've used Basic 2, Basic Lightning, Laser Basic, STOS, AMOS, Blitz etc for years, I never found a problem beyond performance in some cases in the 8 bit days. Hell I even wrote a joystick controlled GUI desktop with pull down menus (but no way to execute PRGs so pretty useless) as a project using a C64 and Laser Basic, if only I still had it I could use it with a joystick emulating mouse today....and then I might have re-written my epic 38kb graphical adventure game.

T
Title: Re: Native Blitz Basic for AROS ever?
Post by: Daedalus on June 15, 2010, 08:42:53 AM
Well, there will be a speed advantage to using C over Blitz Basic on the Amiga, depending on how it's used. Blitz supports OS calls ans assembler, which I imagine is not going to carry much of a speed penalty, but other Blitz functions will.

Having said that though, I code in C when I have to, and Blitz Basic when I want to, as with Blitz I personally find it easier and quicker to make progress and gain some satisfaction in the process. C is one step closer to how a computer works internally, hence the speed gain and tight control, but also the longer and more frustrating (for me anyway) development time.

Anyway, for your original topic, AmiBlitz as I understand it still contains a great deal of 68k assembly code, and so a port to Aros would be extremely difficult indeed. Rewriting the compiler from scratch would probably be easier, though if Aros had in-line, transparent 68k emulation like OS4 and MOS have it would solve this and many other problems...
Title: Re: Native Blitz Basic for AROS ever?
Post by: xeron on June 15, 2010, 08:50:31 AM
@Amiga_Nut
I know exactly how you feel. Back when I was an AMOS/Blitz Basic programmer (14 years ago), I had exactly the same opinion of and attitude towards C as you do now. Eventually I taught myself Amiga E, and then moved on to C, and I haven't looked back (well, i also taught myself several flavours of assembler, C++, Java, PHP and a bunch of other languages since then). I wouldn't program in any form of BASIC now unless I was being paid a lot of money. Once you stick with C long enough for it to click, you start to see why it is a better language than BASIC.

Another case in point, where I work, we used to program an embedded board in Z80 assembler. My colleague was a hardcore BASIC fan for hobby programming. When we switched to a more modern board programmed in C, he wasn't happy. Recently he went to do some programming in his spare time and couldn't stand BASIC any more and used C instead. He was surprised; he expected to find doing some hobby stuff in BASIC familiar and a nice break from C, instead he realised he actually preferred it after all.
Title: Re: Native Blitz Basic for AROS ever?
Post by: bloodline on June 15, 2010, 09:36:49 AM
C's syntax is a little difficult at first... Constant ; at end of lines and {} everywhere... But the real difficulty for those coming from BASIC is the lack of built in functions for gfx etc... Thus I suggest learning the library SDL, include that in your project and you will have a nice set of gfx and other I/O functions that you can use quickly and simply.
Title: Re: Native Blitz Basic for AROS ever?
Post by: bubblebobble on June 15, 2010, 10:28:25 AM
I think "lean C!" is not really what one wants to hear if asking for a Basic dialect.

I program C/C++ and Java at work, and Amiblitz in my free time. This says something, doesnt it ;-)
On 68K, C is not faster than Amiblitz since you can always use very easy inline-asm for the ciritical parts. Also, the Amiblitz compiler generates fairly efficient code that does not fall behind GCC. But Amiblitz is not a BASIC dialect.

The biggest concern is anyway not the syntax of a programming language. Given enough training, you can get used to almost anything. It is the runtime that makes the difference. Amiblitz is not faster (to develop) or easier than C per se, if you need to implement everything via AmigaOS calls. It gets faster if you start using the runtime.
For C, you have, apart of the spartanic clib, a lot of "runtimes" in form of linker libs, like SDL. The problem here is, that they dont know each other, and you have to do a lot of dirty work to get them together. SDL is quite a complete runtime, so this is less of an issue here. But SDL can also be used in Amiblitz.
Title: Re: Native Blitz Basic for AROS ever?
Post by: xeron on June 15, 2010, 10:34:17 AM
He wants to program on AROS. 'Learn C' may not be what he wants to hear, but its the best answer.
Title: Re: Native Blitz Basic for AROS ever?
Post by: Karlos on June 15, 2010, 10:44:47 AM
Quote from: xeron;564665
He wants to program on AROS. 'Learn C' may not be what he wants to hear, but its the best answer.


Correct. Plus, once learnt, it opens up a lot of other languages too.
Title: Re: Native Blitz Basic for AROS ever?
Post by: bloodline on June 15, 2010, 11:20:46 AM
Quote from: Karlos;564666
Correct. Plus, once learnt, it opens up a lot of other languages too.
Yeah totally!!! Like Obj-C :lol: I'll get me coat ;)
Title: Re: Native Blitz Basic for AROS ever?
Post by: Karlos on June 15, 2010, 12:17:57 PM
Quote from: bloodline;564667
Yeah totally!!! Like Obj-C :lol: I'll get me coat ;)


Well, provided you don't mind mixing it up with smalltalk.

I have to say, Objective-C is the ugliest mash of two unrelated syntaxes ever. Worse still is Objective-C++.

Although it's doubtless regarded as the pinnacle of beauty by acolytes of the Cult of Jobbs.
Title: Re: Native Blitz Basic for AROS ever?
Post by: persia on June 15, 2010, 12:29:22 PM
Worse still is the non-objective version of C++, that is ordinary C++.  All attempts to implement objects in C fail because C is, in many ways, antagonistic towards the idea.
Title: Re: Native Blitz Basic for AROS ever?
Post by: Karlos on June 15, 2010, 01:33:27 PM
Quote from: persia;564671
Worse still is the non-objective version of C++, that is ordinary C++.

I couldn't disagree more strongly, and neither could the software industry as a whole. C++ is so widely used because it is a 99% compatible superset of C89 with additional features useful for building large applications (OOP, generic programming etc).

Syntactically, C++ is far cleaner than Objective C/C++ although the ugliest syntactical aspect (template) is pretty bad. That aside, it introduces new syntax primarily through additional keywords. It doesn't, unlike Objective C, radically redefine the meaning of existing C syntax when used within the context of classes.

Lastly, absolutely no major company uses Objective-C save for apple. Which doubtless suits their business model just fine.

Quote
All attempts to implement objects in C fail because C is, in many ways, antagonistic towards the idea.

Creating runtime polymorphic objects in C is pretty straightforward if you don't mind function pointers. I used to do that a fair bit before moving to C++.
Title: Re: Native Blitz Basic for AROS ever?
Post by: bloodline on June 15, 2010, 01:49:23 PM
Clam down guys! I happen to have used both C++ and Obj-C... When I first use Obj-C it was a horrible verbose mess of a language, which seemed to lack the more obvious design of C++, but after using Obj-C a lot, I came to undertand the design goals of the designers. I now think that C++ is the more logical evolution of C, but that Obj-C is a purer vision of what an OOP programming language is supposed to be. Neither is a better language, they simply have different design goals.

Personally I now prefer Obj-C, as I fid it easier to come back to a project after not lookin at it for a while and get back into it without having to reread my design notes!
Title: Re: Native Blitz Basic for AROS ever?
Post by: bubblebobble on June 15, 2010, 01:57:26 PM
Is there an Objective C compiler for the Amiga (AROS) at all?

Many aspects of a programming language depend on the degree of "being-used-to", so an objective comparism is very hard.
What counts at the end is how fast you can achive your goal, how stable/fast the result is and how maintainable the source code is.
This mainly depends on the IDE, Quality of Compiler, Runtime and how well the concept of the language matches the requirments. (e.g. Scripting vs. small vs. mid vs. large projects)
Title: Re: Native Blitz Basic for AROS ever?
Post by: Karlos on June 15, 2010, 02:54:32 PM
Well, GCC supports Objective C as far as I know. I haven't looked into it for a long time though. Objective-C v2.x is developed and maintained by apple but as far as I know is still open.
Title: Re: Native Blitz Basic for AROS ever?
Post by: bloodline on June 15, 2010, 02:55:58 PM
Quote from: bubblebobble;564679
Is there an Objective C compiler for the Amiga (AROS) at all?

Many aspects of a programming language depend on the degree of "being-used-to", so an objective comparism is very hard.
What counts at the end is how fast you can achive your goal, how stable/fast the result is and how maintainable the source code is.
This mainly depends on the IDE, Quality of Compiler, Runtime and how well the concept of the language matches the requirments. (e.g. Scripting vs. small vs. mid vs. large projects)
AROS uses gcc which supports Obj-C compilation... But AFAIK AROS has no Obj-C runtime... So I expect it can't be used at this time :(
Title: Re: Native Blitz Basic for AROS ever?
Post by: Karlos on June 15, 2010, 03:30:01 PM
Quote from: bloodline;564677
Clam down guys! I happen to have used both C++ and Obj-C... When I first use Obj-C it was a horrible verbose mess of a language, which seemed to lack the more obvious design of C++, but after using Obj-C a lot, I came to undertand the design goals of the designers.

I do understand the design aims of Objective-C, I just think it's a hideous abortion of a language, especially as a superset of C.

Even the most basic OO operations have a syntax a drunken alien could not have made a worse hash of. Instantiating an object on the free store:
Code: [Select]
Foo* foo = [[Foo alloc] init];
The left hand side of the above assignment is C, right hand side is... gibberish.

Or, in v2 parlance:

Foo* foo = [Foo new];

A bit better, but what the feck is with the square bracket syntax?

Now, in C++
Code: [Select]
Foo* foo = new Foo();
The only unusual thing above from a C perspective is operator new.

Quote
I now think that C++ is the more logical evolution of C, but that Obj-C is a purer vision of what an OOP programming language is supposed to be. Neither is a better language, they simply have different design goals.

I wouldn't call either language an evolution of C. They are both supersets that aim to provide support for paradigms other than basic procedural programming. C++ gives you a strongly typed OOP model with a wide gamut of OOP features many other languages have shied away from (things like multiple inheritance and operator overloading spring to mind), generic programming and metaprogramming, but comparatively weak support for reflective programming. From this we get strongly typed, compile-time dominated optimisation that leads to efficient code but with some limitations on runtime flexibility.

Objective-C brings what I'd define as "narrow" OOP, akin to the Java model of singular inheritance with interfaces and reflection. From this we get a somewhat weaker typed system with emphasis on runtime flexibility rather than performance. Having runtime loadable classes and the like is certainly nice.

Both are decent aims; my argument is purely about the syntax. Objective-C's OOP syntax is simply alien if you come from a C background. One cannot claim with any credibility that resembles traditional C.

Consider a simple C function used as an interface to some structure to discourage direct poking about:
Code: [Select]
struct Foo {
  int bar;
};

int Foo_getBar(const struct Foo* foo)
{
  return foo->bar;
}
In C++, you might have reworked Foo as a class and have a simple inline getter:

Code: [Select]
class Foo
{
  private:
    bar;

  public:
    int getBar() const
    {
      return bar;
    }
};

The basic C function syntax is still perfectly recognisable within the class context. The only unusual thing above is the const qualifier for the code block which provided a guarantee that calling this method will not change the instance of the class. In the end, a nice simple method that will always be optimized away by the compiler to a safe, read-only access to the member value 'bar';

Then we get Objective-C (there may be a few errors here, I haven't used it for years):
Code: [Select]
@interface Foo {
    int bar;
}
 
-(int)getBar;
@end
There's already a fair degree of WTF going on here, but we aren't done yet since as you don't generally have simple inline methods, you must implement your interface elsewhere:
Code: [Select]
@implementation Foo
-(int)getBar
{
  return bar;
}
@end
So, the class to which a member function belongs is delimited with '@', the indication that the function is not an instance method but a class method is the '-' prefix, return type is parenthesised and none given for the arguments taken (if any). How could that look less like C, other than by removing the braces and elemental type names?

Lastly, where are the accessor levels? Even Java has those.

I'm sorry but as far as C goes, all of this is just an utter abortion.

Quote
Personally I now prefer Obj-C, as I fid it easier to come back to a project after not lookin at it for a while and get back into it without having to reread my design notes!
Title: Re: Native Blitz Basic for AROS ever?
Post by: bubblebobble on June 15, 2010, 03:50:41 PM
just curious if people start bashing me, in A/A++, this would be:

Code: [Select]

[b]Struct[/b] Foo {
   [b]int[/b] bar
}

[b]Function[/b] [b]int[/b] Foo::getBar(Foo *this) {
   [b]Return[/b] this.bar
}


I think this is intuitively understandable for all C/C++/Java coders, a very smooth integration of OOP in procedural programming.
WTF, were are the ;'s ?? Eeek ;)
Title: Re: Native Blitz Basic for AROS ever?
Post by: Karlos on June 15, 2010, 03:54:00 PM
Quote from: bubblebobble;564693
WTF, were are the ;'s ?? Eeek ;)


Like JS, in that regard. Personally, I rather like my statements to have some visible terminator.

Imagine what English would be like without the full stop...
Title: Re: Native Blitz Basic for AROS ever?
Post by: unusedunused on June 15, 2010, 03:57:04 PM
Quote from: bloodline;564677

Personally I now prefer Obj-C, as I fid it easier to come back to a project after not lookin at it for a while and get back into it without having to reread my design notes!


this is the biggest problem i have in C++.there cant see a program flow easy, so i dislike to use OO

But can you tell what is in OBj-c better to see more easy the program flow ?
Or do you maybe mean for obj c you have a better editor ?
Title: Re: Native Blitz Basic for AROS ever?
Post by: bloodline on June 15, 2010, 04:47:43 PM
Quote from: bernd_afa;564695
this is the biggest problem i have in C++.there cant see a program flow easy, so i dislike to use OO

But can you tell what is in OBj-c better to see more easy the program flow ?
Or do you maybe mean for obj c you have a better editor ?
Objective C does not try to add OOP to C... If you think about it like that you will see it as a horrible mess.

I prefer to see the Objective parts as a framework around which I can build my code (written using C).

Hmmm, rather the "Smalltalk" part of Obj-C provides the structure... The C part provides the detail...

This allows me to see the OOP nature separate from the algorithmic implementation :)
Title: Re: Native Blitz Basic for AROS ever?
Post by: nicholas on June 25, 2010, 10:24:26 PM
Quote from: Karlos;564694
Like JS, in that regard. Personally, I rather like my statements to have some visible terminator.

Imagine what English would be like without the full stop...

Arabic.
Title: Re: Native Blitz Basic for AROS ever?
Post by: nicholas on June 25, 2010, 10:34:43 PM
Quote from: bloodline;564677
Clam down guys! I happen to have used both C++ and Obj-C... When I first use Obj-C it was a horrible verbose mess of a language, which seemed to lack the more obvious design of C++, but after using Obj-C a lot, I came to undertand the design goals of the designers. I now think that C++ is the more logical evolution of C, but that Obj-C is a purer vision of what an OOP programming language is supposed to be. Neither is a better language, they simply have different design goals.

Personally I now prefer Obj-C, as I fid it easier to come back to a project after not lookin at it for a while and get back into it without having to reread my design notes!

I have 23yrs programming experience, 14 of those as a professional.

Just a few of the languages I have under my belt are C, C++, various 8, 16 and 32bit Assembly languages, several variations on SQL, Ada, Pascal, several RAD tools you've never heard of and even Satan's own Visual Basic.

Enough to know that I can code. I can code very well. I can pick up new languages and concepts very quickly.

Obj-C is a hairdressers language!  I tried it, I tried it again and again and again.

It is ridiculously bad and it is completely ugly. The ugliest syntax i've ever seen in the wild!

Obj-C is akin to AMOS, except it's not as pretty.
Title: Re: Native Blitz Basic for AROS ever?
Post by: nicholas on June 25, 2010, 10:37:22 PM
Quote from: Amiga_Nut;564573
I am [slowly] starting a couple of games but I wondered if there were any plans for AROS specific version of Blitz for some time in the future? One of the games I am writing would look awesome in super highres but even AGA is too slow on initial tests. But on a nice beefy x86 CPU it could work really nicely and give you at least 4x more viewing area improving the game a lot.

It would be nice to be able to write games for AROS in a similarly great language too like the old day, but Google didn't find anything promising.

http://www.sdlbasic.altervista.org/main/