English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 26 March 2015, 00:55   #1
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
What programming language to write a commodity?

Hello,

I want to write a simple commodity for the Workbench 3.1 however I do not know which is the best programming language for this. For now I just want to start with something simple; such as a simple "Hello World".

Any suggestions?
Sim085 is offline  
Old 26 March 2015, 01:18   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
I would say C is ideal. Commodity Exchange is exposed through commodity.library, so any language that allows you to use shared libraries should work.
Leffmann is offline  
Old 26 March 2015, 10:44   #3
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Quote:
Originally Posted by Leffmann View Post
I would say C is ideal. Commodity Exchange is exposed through commodity.library, so any language that allows you to use shared libraries should work.
Thanks for your reply. Is there any flavor of C you would suggest? I notice some applications change the content of the Workbench Menu when running. Would I be able to do this as well with C on an Amiga? I found some tutorials of C online so I'll try to follow those.

Last edited by Sim085; 26 March 2015 at 11:25.
Sim085 is offline  
Old 26 March 2015, 12:32   #4
Michael
A1260T/PPC/BV/SCSI/NET
 
Michael's Avatar
 
Join Date: Jan 2013
Location: Moscow / Russia
Posts: 841
Examples

in C
http://aminet.net/util/cdity/ToolsMenu.lha

in E
http://aminet.net/dev/e/E_Commodity.lha
Michael is offline  
Old 26 March 2015, 22:03   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Quote:
Originally Posted by Sim085 View Post
Thanks for your reply. Is there any flavor of C you would suggest?
None of them are more suited for programming AmigaOS than the other, so any current flavor will do. I mostly use VBCC which has both C99 and C89.

Quote:
Originally Posted by Sim085 View Post
I notice some applications change the content of the Workbench Menu when running. Would I be able to do this as well with C on an Amiga? I found some tutorials of C online so I'll try to follow those.
Yes of course, C was always intended as the main language for the Amiga, there are C bindings for all of the AmigaOS APIs.
Leffmann is offline  
Old 27 March 2015, 21:02   #6
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Is there a reference I could use to know the system calls I can do?
Sim085 is offline  
Old 27 March 2015, 21:54   #7
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 722
Quote:
Originally Posted by Sim085 View Post
Is there a reference I could use to know the system calls I can do?
http://amigadev.elowar.com/read/ADCD.../node00DF.html
alkis is offline  
Old 28 March 2015, 20:15   #8
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Here is also the main chapter on Commodities in the RKM, with documentation and examples:
http://amigadev.elowar.com/read/ADCD.../node03FF.html
Leffmann is offline  
Old 29 March 2015, 12:23   #9
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Quote:
Originally Posted by Leffmann View Post
Here is also the main chapter on Commodities in the RKM, with documentation and examples:
http://amigadev.elowar.com/read/ADCD.../node03FF.html
Thanks for those two links. I will read through them
Sim085 is offline  
Old 29 March 2015, 13:52   #10
Vot
Registered User
 
Join Date: Aug 2012
Location: Australia
Posts: 651
Quote:
Originally Posted by Leffmann View Post
Yes of course, C was always intended as the main language for the Amiga, there are C bindings for all of the AmigaOS APIs.

Note true.

"In AmigaOS 1.x, the AmigaDOS portion was based on TRIPOS, which is written in BCPL. Interfacing with it from other languages proved a difficult and error-prone task, and the port of TRIPOS was not very efficient.

From AmigaOS 2.x onwards, AmigaDOS was rewritten in C and Assembler, retaining full 1.x BCPL program compatibility, and it incorporated parts of the third-party AmigaDOS Resource Project,[6] which had already written replacements for many of the BCPL utilities and interfaces."

Taken from http://en.m.wikipedia.org/wiki/AmigaOS
Vot is offline  
Old 29 March 2015, 14:20   #11
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,026
Quote:
Originally Posted by Vot View Post
Note true.
You are wrong. AmigaOS was always intended to be used with C. TRIPOS was bought from a third party to keep the development time short. But this does not change the intention to use C as the main language.
thomas is online now  
Old 29 March 2015, 14:22   #12
Vot
Registered User
 
Join Date: Aug 2012
Location: Australia
Posts: 651
Quote:
Originally Posted by thomas View Post
You are wrong. AmigaOS was always intended to be used with C. TRIPOS was bought from a third party to keep the development time short. But this does not change the intention to use C as the main language.

Actually you are right, i have read that. Maybe i should have just said. It wasn't always c .
Vot is offline  
Old 29 March 2015, 14:27   #13
Vot
Registered User
 
Join Date: Aug 2012
Location: Australia
Posts: 651
Actually I was quite taken back when i read the article about the amiga TRIPOS origins, to learn that some of the things I liked the most about the amiga was developed elsewhere was a surprise to me. Back when I had my amiga in the day I wasn't aware of its origins.
Vot is offline  
Old 01 April 2015, 23:09   #14
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Quote:
Originally Posted by Leffmann View Post
Here is also the main chapter on Commodities in the RKM, with documentation and examples:
http://amigadev.elowar.com/read/ADCD.../node03FF.html
Hello again, I have created a new project with HiSoft C. I then copied the Broker.c code provided here; http://amigadev.elowar.com/read/ADCD.../node0586.html

When I compiled I got some error saying "Suspect '=' in condition". Just out of curiosity. Is Broker.c just an example which does not compile?

Last edited by Sim085; 01 April 2015 at 23:42.
Sim085 is offline  
Old 02 April 2015, 08:03   #15
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
Sounds more like a warning than an error. What line(s) was it referring to?
Hewitson is offline  
Old 02 April 2015, 12:29   #16
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Quote:
Originally Posted by Hewitson View Post
Sounds more like a warning than an error. What line(s) was it referring to?
It was on this line:

Code:
while(msg = (CxMsg *)GetMsg(broker_mp))
{                                                               <<<<<<<<<<<<<
Note HiSoft C pointed to line after the while.
Sim085 is offline  
Old 02 April 2015, 12:31   #17
ajk
Registered User
 
ajk's Avatar
 
Join Date: May 2010
Location: Helsinki, Finland
Posts: 1,341
There are several conditions of that form in the code:

Code:
if (broker_mp = CreateMsgPort())
...
if (broker = CxBroker(&newbroker, NULL))
...
while(msg = (CxMsg *)GetMsg(broker_mp))
...
As Hewitson says, these should not stop the program from compiling. It's just a message from the compiler, since a comparison (==) is more commonly used as a condition than an assignment (=) is.

It is possible though that your compiler is configured to fail the build even with just warnings or messages, I'm not familiar enough with HiSoft C to say.
ajk is offline  
Old 02 April 2015, 17:52   #18
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
It's just a warning about a bad programming practice.

If you're programming directly on the Amiga, I would recommend using SAS/C instead:
http://eab.abime.net/showthread.php?t=33781
Leffmann is offline  
Old 02 April 2015, 23:56   #19
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Quote:
Originally Posted by Leffmann View Post
It's just a warning about a bad programming practice.

If you're programming directly on the Amiga, I would recommend using SAS/C instead:
http://eab.abime.net/showthread.php?t=33781
Thanks leffmann for the link
I will install SAC/C and try again with that one.
Sim085 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
Translators for a little commodity wanted bubbob42 support.Apps 12 29 May 2014 16:40
Amiga C programming language Kenan support.Apps 3 25 June 2013 18:50
Save Prefs on Blanker Commodity manic23 support.Apps 3 22 April 2013 20:12
Looking for Caps2Ctrl commodity kolla support.Apps 7 24 October 2009 17:14
Most common programming language in Amiga games manicx Amiga scene 38 10 March 2004 14:20

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 14:39.

Top

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