26 March 2015, 00:55 | #1 |
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? |
26 March 2015, 01:18 | #2 |
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.
|
26 March 2015, 10:44 | #3 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
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. |
26 March 2015, 12:32 | #4 |
A1260T/PPC/BV/SCSI/NET
Join Date: Jan 2013
Location: Moscow / Russia
Posts: 841
|
|
26 March 2015, 22:03 | #5 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
Yes of course, C was always intended as the main language for the Amiga, there are C bindings for all of the AmigaOS APIs. |
|
27 March 2015, 21:02 | #6 |
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?
|
27 March 2015, 21:54 | #7 | |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 722
|
Quote:
|
|
28 March 2015, 20:15 | #8 |
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 |
29 March 2015, 12:23 | #9 | |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Quote:
|
|
29 March 2015, 13:52 | #10 | |
Registered User
Join Date: Aug 2012
Location: Australia
Posts: 651
|
Quote:
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 |
|
29 March 2015, 14:20 | #11 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,026
|
|
29 March 2015, 14:22 | #12 | |
Registered User
Join Date: Aug 2012
Location: Australia
Posts: 651
|
Quote:
Actually you are right, i have read that. Maybe i should have just said. It wasn't always c . |
|
29 March 2015, 14:27 | #13 |
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.
|
01 April 2015, 23:09 | #14 | |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Quote:
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. |
|
02 April 2015, 08:03 | #15 |
Registered User
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?
|
02 April 2015, 12:29 | #16 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
|
02 April 2015, 12:31 | #17 |
Registered User
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)) ... 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. |
02 April 2015, 17:52 | #18 |
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 |
02 April 2015, 23:56 | #19 | |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Quote:
I will install SAC/C and try again with that one. |
|
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 |
|
|