English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 25 October 2015, 22:21   #1
TenLeftFingers
Registered User
 
TenLeftFingers's Avatar
 
Join Date: Sep 2013
Location: Ireland
Posts: 800
Non-game programming - what does that leave me with?

Forgive me if this has been answered but I have been through plenty of threads and can't distinguish between what advice is for gaming and which is for appliactions.

I'm interested in developing workbench applications. I understand on Amiga there are three common languages/environments to use:

  • Assembler
  • C/C++
  • Basic (Blitz, AmigaBasic, AMOS etc)

I also understand that on my list above the get progressively easier as we go down the list, but performance suffers also.

My questions are about options for applications using standard GUI widgets and what of the available info online I can ignore:

ASM
Can 'desktop' apps on workbench be coded in assembler? I've found references to intuition.libarary in Amiga ASM threads here - but I when we did ASM in college it was purely for access-all-areas coding on the 8051.

C/C++
I tried using Object Windows Language back in 2001 and it was horrendous trying to get basic graphics. I ended up using VB to control my electronics project. C/C++ was just used for CLI apps from there on in. Is it still that complex on Amiga?

BASIC
Since I'm not interested in games (I'd love to, but I'd only be interested in making a damn good game which would take longer than I care to invest), is the performance of basic adequate for workbench applications?

Hopes
Don't expect much from me - I'm very rusty and Java has both spoiled me and bored me to pieces But I'd hope after a year or so of tinkering I'd be able to make a decent application that has some value today - maybe incorporating a basic simple http web service of some kind.

One thing I thought of was since we can't even access Wikipedia from OS3 these days, I could have a webservice that takes a search term, finds the article on Wikipedia and returns it without the need of SSL/TLS.
TenLeftFingers is offline  
Old 25 October 2015, 22:55   #2
desiv
Registered User
 
desiv's Avatar
 
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
My (probably useless) thoughts on the issue:
Quote:
Originally Posted by TenLeftFingers View Post
ASM
Can 'desktop' apps on workbench be coded in assembler?
Yes, you can. Back in the day, I wrote a small calculator app (that didn't actually divide properly, and not sure about multiplication; I wasn't very good..) that was a WB app in assembly.
That being said, I wouldn't recommend it myself.
Quote:
Originally Posted by TenLeftFingers View Post
C/C++
I'd do this, but not C++.. The Amiga GUI stuff seems designed around C.

All the intuition stuff is easy.
I wrote a Solitaire game with full menus, etc... Straight forward and easy to follow.
Why not C++? I don't know object oriented stuff.. ;-)
Quote:
Originally Posted by TenLeftFingers View Post
BASIC
Could be done, but I wouldn't bother. If you know/can do C, I'd stay there..

Just my $00.0000000000002

Good luck!

desiv
desiv is offline  
Old 25 October 2015, 23:25   #3
demolition
Unregistered User
 
demolition's Avatar
 
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 43
Posts: 4,190
GUI stuff in WB is done by calling Intuition.library and it can be reached fairly easy through both through Asm and C/C++, so that part is quite similar. However, you'd probably prefer having the convenience of reading C code instead of Asm. Speed-wise it is not that different unless you are doing some hard calculations. The Intuition.library calls takes the same time so if the majority if the time is spent in those calls, the difference is minimal. If you have some hard core stuff you can still use C for the basic structure and do the hard stuff in Asm.

Regarding C or C++ I have no idea what is preferred. On modern platforms I much prefer having OO available but never tried it on Amiga so it may not have been as mature back then. Also depends on whether you are used to C++.
demolition is offline  
Old 26 October 2015, 04:38   #4
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
As Desiv said, you can perfectly use ASM for WB programming but when programming utilities one is usually more interested by language flexibility rather than by pure performance and C is much better for this. Especially if you are not a seasoned programmer.

You cannot at the moment do C++ on the Amiga unless you use very old versions of gcc and obviously given the code they generate this is not recommended. VBCC is a good C compiler which produces reasonable code and can be very easily compiled as a cross compiler which allows you to produce Amiga executables from Windows/Linux/OS X.

Basic-s seem easy initially but often they restrict how your code can grow, moreover they are rarely portable so if you want to re-use existing code you will have to convert it. I would really strongly recommend to avoid it. C code is very portable so that is usually a big bonus when you start since you can examine/re-use other people's code.

For the task you mentioned (extracting information from Wikipedia), a language like Python would actually be quite nice. It is high level, multi paradigm and has an enormous amount of libraries, but (it's a big but!) I am not sure it exists for OS3 and if it does it is probably horribly slow. (Also, Python uses dynamic typing so you will encounter plenty of runtime bugs if do not have yet a good type-safety discipline.)

You can certainly do the job with C by relying on an http library such as libcurl but you might have to adapt it for the Amiga as I am not certain it is available for OS3 (maybe it is, I confess ignorance).

But in short, I recommend starting with C (VBCC specifically).
ReadOnlyCat is offline  
Old 26 October 2015, 14:19   #5
TenLeftFingers
Registered User
 
TenLeftFingers's Avatar
 
Join Date: Sep 2013
Location: Ireland
Posts: 800
desiv, demolition, ReadOnlyCat, thanks for all your input and clarifications.

@Desiv, it sounds like the consensus is around C! But why do you dismiss Basic? (I know it's supposed to be limiting for games)

@Demolition, I think I agree that lexically ASM will slow me down. Thanks for the advice

@ReadOnlyCat, that's a good reason. But I'm not a big coder so really I'll just be trying to scratch some itches. I'm sure I'll never be porting an Amiga app to another platform.

VBCC sounds great, thank you!

For the Wikipedia program, I would run a service (which is Amiga browser friendly) on the internet using php or something similar which accepts http requests and goes to the necessary website and returns something usable to the Amiga application. Who knows, it could just become a web proxy for IBrowse or similar, but I'll start with something simple.
TenLeftFingers is offline  
Old 26 October 2015, 14:30   #6
demolition
Unregistered User
 
demolition's Avatar
 
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 43
Posts: 4,190
I would dismiss BASIC for the fact that I don't consider it a serious programming language.

I've used BASIC since the C64 and also used the more recent MS Visual Basic, mainly through ASP pages or scripts, but always found the syntax very odd and hard to grasp as the code base grows. Obviously some people like it since it is still used for serious stuff, so perhaps my brain is just not shaped the right way to be compatible.

On the Amiga, I've tried Amiga Basic for some simple stuff, but I've never tried Blitz which is more powerful and shaped to work better in sync with the hardware.
demolition is offline  
Old 26 October 2015, 14:41   #7
TenLeftFingers
Registered User
 
TenLeftFingers's Avatar
 
Join Date: Sep 2013
Location: Ireland
Posts: 800
I had to do some VB for an Excel sheet in work some time back. It was indeed convoluted and horrible.. I might take a quick look at a Blitz Basic tutorial but I'll most likely take the C route then
TenLeftFingers is offline  
Old 26 October 2015, 15:30   #8
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,348
AmiBlitz has pretty decent support for writing Workbench programs - full support for GadTools and Intuition and performance isn't that huge a deal when most of the time your program sits waiting for an Intuition signal to arrive. SMBMounter and InstallerGen are two examples of mine, and HD-Rec is a far more advanced application that's worth looking at to see just what Blitz is capable of.

I've written some detailed Blitz tutorial and reference pieces on AmigaCoding.com, covering both games and non-game programming. It's not finished yet but should be plenty to give you an idea of what's involved.

However, if you've already got a good handle on C then that might be the way to go. The OS calls are all generally designed with C in mind so if you already have C experience then it's really just a matter of reading the autodocs, which are available online here.

Whichever way you go, have fun!

Last edited by Daedalus; 26 October 2015 at 15:33. Reason: Added links
Daedalus is offline  
Old 26 October 2015, 16:26   #9
TenLeftFingers
Registered User
 
TenLeftFingers's Avatar
 
Join Date: Sep 2013
Location: Ireland
Posts: 800
Thanks Daedalus, that fills in the gap for me. I'll spend a little time on both and see which I get the hang of first. The autodocs aren't jogging my memory of C at all - I might need to go back a bit further.

Edit: Found a refresher here> http://fresh2refresh.com/cprogramming/

Last edited by TenLeftFingers; 26 October 2015 at 16:39.
TenLeftFingers is offline  
Old 26 October 2015, 17:03   #10
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,348
The Autodocs are really a reference for Amiga-specific C aspects and assume the reader is already very comfortable with standard C concepts, particularly pointers and structs. So it probably is a good idea to do some general refreshers and get some simple shell-only programs working before you start tackling the Amiga API. That'll also get you used to the compilers on the Amiga.
Daedalus is offline  
Old 26 October 2015, 17:09   #11
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
Quote:
Originally Posted by TenLeftFingers View Post
Forgive me if this has been answered but I have been through plenty of threads and can't distinguish between what advice is for gaming and which is for appliactions.

I'm interested in developing workbench applications. I understand on Amiga there are three common languages/environments to use:

  • Assembler
  • C/C++
  • Basic (Blitz, AmigaBasic, AMOS etc)

I also understand that on my list above the get progressively easier as we go down the list, but performance suffers also.

My questions are about options for applications using standard GUI widgets and what of the available info online I can ignore:

ASM
Can 'desktop' apps on workbench be coded in assembler? I've found references to intuition.libarary in Amiga ASM threads here - but I when we did ASM in college it was purely for access-all-areas coding on the 8051.

C/C++
I tried using Object Windows Language back in 2001 and it was horrendous trying to get basic graphics. I ended up using VB to control my electronics project. C/C++ was just used for CLI apps from there on in. Is it still that complex on Amiga?

BASIC
Since I'm not interested in games (I'd love to, but I'd only be interested in making a damn good game which would take longer than I care to invest), is the performance of basic adequate for workbench applications?

Hopes
Don't expect much from me - I'm very rusty and Java has both spoiled me and bored me to pieces But I'd hope after a year or so of tinkering I'd be able to make a decent application that has some value today - maybe incorporating a basic simple http web service of some kind.

One thing I thought of was since we can't even access Wikipedia from OS3 these days, I could have a webservice that takes a search term, finds the article on Wikipedia and returns it without the need of SSL/TLS.
Have you considered AmigaE? It can do some OOP like Java and C++ (though not yet as advanced), some BASIC-like syntax (no weird punctuation like C or Java but uses simple keywords), and if you need to optimize some code using Assembly, the user-mode 68000 instruction set is available.

Also, some newer offshoots of the language can do some things better: ECX is written in E but supports next-gen Amiga platforms on PPC, PortablE is written in itself and can use C++ as a backend for compatibility with other platforms using different foundation class frameworks (though memory heavy in the current beta), and CreativE which is derived from the original Assembly source of AmigaE and supports only 680x0.
Samurai_Crow is offline  
Old 26 October 2015, 17:16   #12
desiv
Registered User
 
desiv's Avatar
 
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
Quote:
Originally Posted by TenLeftFingers View Post
@Desiv, it sounds like the consensus is around C! But why do you dismiss Basic? (I know it's supposed to be limiting for games)
Two reasons.
1: I'm not that familiar with the better BASIC variations on the Amiga. I did some AmigaBASIC back in the day, and it wasn't hideous, but slow... Decided to try C and ASM after that.. Didn't look back.
2: C isn't any harder than BASIC for Amiga WB programs.

Once I tried C and ASM, I realized that C for standard things actually makes a lot of sense and isn't as complicated as I initially thought...
When I found my old C code recently, I took a look and it basically made sense...
Now, I don't know that I'd want to try to write a shooter in C, but for standard progs with a WB interface, it's not that tricky at all...
And there's a lot of great source/docs online...

desiv
desiv is offline  
Old 26 October 2015, 18:26   #13
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,767
Quote:
Originally Posted by readonlycat View Post
you cannot at the moment do c++ on the amiga unless you use very old versions of gcc and obviously given the code they generate this is not recommended.
sasc 6.58
Thorham is offline  
Old 26 October 2015, 20:25   #14
TenLeftFingers
Registered User
 
TenLeftFingers's Avatar
 
Join Date: Sep 2013
Location: Ireland
Posts: 800
Quote:
Originally Posted by Daedalus View Post
The Autodocs are really a reference for Amiga-specific C aspects and assume the reader is already very comfortable with standard C concepts, particularly pointers and structs. So it probably is a good idea to do some general refreshers and get some simple shell-only programs working before you start tackling the Amiga API. That'll also get you used to the compilers on the Amiga.
I'm actually looking forward to this Thanks for the clarification. I'm starting to remember some C console apps I made for linux that could run exec() on system exectuables. i'm also remembering the gcc compiler args so hopefully I'll be back up to speed sooner.

Quote:
Originally Posted by Samurai_Crow View Post
Have you considered AmigaE? It can do some OOP like Java and C++ (though not yet as advanced), some BASIC-like syntax (no weird punctuation like C or Java but uses simple keywords), and if you need to optimize some code using Assembly, the user-mode 68000 instruction set is available.
Ack, just when I thought I'd made my mind up! I thought AmigaE was an IDE but looking into it more now I see it's a very tidy looking language. If I start getting headaches with C, I'll certainly give this a try.

Quote:
Originally Posted by desiv View Post
Two reasons.
1: I'm not that familiar with the better BASIC variations on the Amiga. I did some AmigaBASIC back in the day, and it wasn't hideous, but slow... Decided to try C and ASM after that.. Didn't look back.
2: C isn't any harder than BASIC for Amiga WB programs.

Once I tried C and ASM, I realized that C for standard things actually makes a lot of sense and isn't as complicated as I initially thought...
When I found my old C code recently, I took a look and it basically made sense...
Now, I don't know that I'd want to try to write a shooter in C, but for standard progs with a WB interface, it's not that tricky at all...
And there's a lot of great source/docs online...

desiv
That's a final nail in the BASIC coffin then, thank you, I feel lighter already! I have fond feelings for the language because of the C64 but as you say, C isn't much harder.
TenLeftFingers is offline  
Old 26 October 2015, 21:45   #15
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,767
Quote:
Originally Posted by TenLeftFingers View Post
C isn't much harder.
It's actually easier in a way because it's VASTLY more powerful than old school BASIC dialects.
Thorham is offline  
Old 27 October 2015, 00:00   #16
desiv
Registered User
 
desiv's Avatar
 
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
Quote:
Originally Posted by TenLeftFingers View Post
I have fond feelings for the language because of the C64 but as you say, C isn't much harder.
That's actually specifically why I went to C.
My BASIC experience was line numbered 64 BASIC.
Moving to a "structured" BASIC like the AmigaBASIC isn't all that smooth a transition actually. (Well, it's a big change.)
As a result, moving to C isn't that big a jump, and there is a lot of great info on learning / using Amiga C...

Good luck whatever you choose..

desiv
(Now, I suppose I could have LABELed each line in AmigaBASIC with a number and used a GOTO from there.. But it really is best I learned NOT to do that..) ;-)
desiv is offline  
Old 27 October 2015, 00:32   #17
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,348
I'd just like to point out that Blitz isn't really one of those old school BASICs, since it as all the access to constants, structs and API calls that C has. It runs a little slower and creates larger executables, but there's very little that you can't actually do in Blitz but can in C.

As a result, I tend to use C for speed critical stuff (like the MP3 decoder engine in my MP3 player), and Blitz for everything else like GUI building, but that's just my personal preference.
Daedalus is offline  
Old 27 October 2015, 03:25   #18
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,338
There's a great introduction to E here: http://cshandley.co.uk/JasonHulance/beginner_toc.html
idrougge is offline  
Old 27 October 2015, 11:04   #19
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Seems that (as usual) i will disagree with most people


Quote:
Originally Posted by TenLeftFingers View Post
Forgive me if this has been answered but I have been through plenty of threads and can't distinguish between what advice is for gaming and which is for applications.
Personnally I don't distinguish between games and apps. Even share code between them.


Quote:
Originally Posted by TenLeftFingers View Post
ASM
Can 'desktop' apps on workbench be coded in assembler? I've found references to intuition.libarary in Amiga ASM threads here - but I when we did ASM in college it was purely for access-all-areas coding on the 8051.
Everything can be done in asm, in spite what some folks may pretend.

However it has to be 68k asm - doing that on another kind of cpu, errh, no, sorry.
AND...
... You have to reuse code. Writing one's own function library to get reused in just about every program makes life a lot easier.
Honestly with enough macros and reusable functions Asm may be nearly as easy as Basic.


Quote:
Originally Posted by TenLeftFingers View Post
C/C++
I tried using Object Windows Language back in 2001 and it was horrendous trying to get basic graphics. I ended up using VB to control my electronics project. C/C++ was just used for CLI apps from there on in. Is it still that complex on Amiga?
Getting basic graphics is quite easy on the Amiga, regardless of used language.


Quote:
Originally Posted by TenLeftFingers View Post
BASIC
Since I'm not interested in games (I'd love to, but I'd only be interested in making a damn good game which would take longer than I care to invest), is the performance of basic adequate for workbench applications?
Workbench apps normally don't need performance, but it depends on what you're doing - the UI doesn't need much but who knows what else you may want to do.


Quote:
Originally Posted by ReadOnlyCat View Post
As Desiv said, you can perfectly use ASM for WB programming but when programming utilities one is usually more interested by language flexibility rather than by pure performance and C is much better for this. Especially if you are not a seasoned programmer.
For a seasoned programmer it may be quite the opposite. I find asm much more flexible than C. And C has some stupidities inside, like its strange operator priorities and the fact it insists upon converting everything to 'int' (try showing sizeof('c') to get a preview of it).


Quote:
Originally Posted by ReadOnlyCat View Post
You cannot at the moment do C++ on the Amiga unless you use very old versions of gcc and obviously given the code they generate this is not recommended.
Hisoft C++ 4.0 allows doing C++.


Quote:
Originally Posted by ReadOnlyCat View Post
C code is very portable so that is usually a big bonus when you start since you can examine/re-use other people's code.
*cough*
Very portable, really ?


Quote:
Originally Posted by ReadOnlyCat View Post
But in short, I recommend starting with C (VBCC specifically).
Does VBCC have an IDE, with a good debugger inside ? I don't think so


Quote:
Originally Posted by demolition View Post
I would dismiss BASIC for the fact that I don't consider it a serious programming language.
It's still excellent for learning for those who have never programmed at all.


Quote:
Originally Posted by demolition View Post
On the Amiga, I've tried Amiga Basic for some simple stuff, but I've never tried Blitz which is more powerful and shaped to work better in sync with the hardware.
AmigaBasic is rumored to be the worst basic to ever see the light of day


Quote:
Originally Posted by Thorham View Post
sasc 6.58
May be a good compiler, but it still lacks an IDE. Like for doing things such as source-level debugging, setting breakpoints in the editor, you see...


Quote:
Originally Posted by Thorham View Post
It's actually easier in a way because it's VASTLY more powerful than old school BASIC dialects.
You can't compare. Old school BASIC dialects were interpreted and ran on very slow machines.
However, try to do basic graphics on these dialects : it was damned easy.
Now try to do the same with C : the language itself just doesn't support it !


Quote:
Originally Posted by Daedalus View Post
As a result, I tend to use C for speed critical stuff (like the MP3 decoder engine in my MP3 player), and Blitz for everything else like GUI building, but that's just my personal preference.
C isn't good at MP3 decoding. I strongly suggest to do that in ASM - and avoid floats. A 030 can play 22khz mono mp3 at full quality, if done properly.
meynaf is offline  
Old 27 October 2015, 12:23   #20
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,348
Quote:
Originally Posted by meynaf View Post
C isn't good at MP3 decoding. I strongly suggest to do that in ASM - and avoid floats. A 030 can play 22khz mono mp3 at full quality, if done properly.
Yes, but it's better at it than BASIC is. And also, ASM has a tougher learning curve than both of the others, so if I was to use ASM it would never have been made. Also, I never wanted to play my MP3s at 22kHz in mono, that to me isn't worth bothering with. Of course hand-coded ASM makes the tightest, most efficient code - if you're a good programmer, but more often than not there's a compromise to be made between code efficiency and ease of development. ASM will only ever be easier than C or BASIC if you're absolutely proficient at ASM and haven't a clue about the others. Otherwise it's an exercise in frustration for what is realistically very limited benefit in many cases, and is very likely to put you off programming altogether.
Daedalus is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amiga 3D game programming Steve Coders. General 37 17 June 2013 22:15
Game Programming for Teens, 3rd Edition Book Amiga Forever MarketPlace 3 28 February 2011 20:19
Andre Lamothe's Tricks of the 3d game programming gurus Anding Coders. General 1 18 December 2010 10:58
The wrong attitude over bedroom programming and legendary game developers! manicx Retrogaming General Discussion 51 10 January 2004 14:09
GBA Game Programming Project CHiEF Retrogaming General Discussion 6 15 November 2002 00:15

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:38.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13541 seconds with 13 queries