02 June 2010, 14:46 | #1 |
Amiga user since 1985
Join Date: Apr 2005
Location: Middlesex, NJ USA
Posts: 14
|
C# Framework
Like many old time Amiga coders, I find myself irresistibly drawn back to the platform these days. I no longer have any Amiga hardware, only Amiga Forever to play around with.
For many years, I have been kicking around in my head a plan for wrapping the Amiga API within C++ header files to make a bit easier to use. Work, life, etc. always seemed to get in the way for my doing anything about it until now. I am aware of the stillborn Amiga Java project(s). There is also a C# project going on based on Mono, but who has the time to spend on all of that. My thoughts were to create a C# like framework for C++ that gave the modern coder a familiar environment. I think I have succeeded in doing just that (see attached). To do this, I needed properties and events. A quick Google search and I had exactly what I needed. As anyone familiar with C# (and to some degree Java) can see by the attached code sample, I have put together a simple, event driven demo with all the flavor of C# and very little C++. The executable was compiled using AmiDevCpp and is just 75kb. A bit large for Amiga apps, but certainly acceptable given the ease of use. You will notice there is no message loop. That is contained in the forms.h header file which I have chosen not to release just yet as there is still a LOT more to do. When I do release the code, it will be done so under GPL type licensing without any restrictions on it's use. BTW - Since all of the code is in the form of C++ headers, there is no reason at all that the framework could not be used "as is" on Amiga 4.x, AROS and/or MorphOS systems. My next task will be to wrap the menu and gadget subsystems and provide event driven notifications similar to what I have already produced for window events. Here is where I need some help. It's been a LONG time since I have done any C++ coding...most of the past ten years have been spent with Java and/or C#. It's been almost fifteen years since I've done any serious Amiga coding. What I am looking for is a person or persons interested in helping make some of the decisions on this project, specifically in regards to message handling. For instance, do we do it the Windows way and handle ALL messages in the message loop or do we allow users to turn off specific, resource eating messages of (e. g. ReportMouse). I'll do the work, I just need someone who is more up to date with the Amiga API than I am, involved with the project. I don't see this as comsuming a lot of anyone's time... I would appreciate any comments you may have on the work I have done so far and suggesstions on how it should proceed in the future. Barry p. s. I am cross-posting this message in a couple of other locations in order to generate interest in the project. |
17 June 2020, 17:40 | #2 |
Registered User
Join Date: Jun 2020
Location: Bondy
Posts: 1
|
Hi, I realize it has been a long time since this message was posted, but did you make any further progress on this project? I also thought it would be interesting to have a port or some sort of c# in the Amiga.
|
18 June 2020, 08:45 | #3 |
Inviyya Dude!
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,798
|
There is a usable compiled Java around, at least, I remember..
|
18 June 2020, 21:08 | #4 |
Registered User
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
|
Who on earth would prefer C# over C++?
|
18 June 2020, 22:18 | #5 |
Registered User
Join Date: May 2020
Location: California, USA
Posts: 18
|
I do. The runtime is much more complete, with a ton of stuff you have to roll yourself (or buy) in c++. Mostly, though, I like not having to deal with pointers and memory allocation. The runtime does that for you.
Of course, you can't have real c# on an Amiga, because the CLR would use way too much memory to run effectively. However, there's a movement toward native compilation of c# code, and I'd love to see streamlined, native c# compilers for other platforms. |
18 June 2020, 22:46 | #6 | |
Registered User
Join Date: Nov 2010
Location: South Wales
Age: 47
Posts: 944
|
Quote:
Wrapping C, C++ to give C# , is the plan to make a managed version of C or C++ on the amiga, won't that kill the speed ? |
|
18 June 2020, 22:49 | #7 | |
Registered User
Join Date: Apr 2017
Location: Cambridge
Posts: 136
|
Quote:
It'd be cool if Rust could target retro platforms going forward! |
|
19 June 2020, 03:37 | #8 | |
Registered User
Join Date: May 2020
Location: California, USA
Posts: 18
|
Quote:
What makes c# slow at times is the fact that it runs in a virtual machine. And this very thing becomes a non-issue when you switch from a CLR based runtime to native compiled code. A native compiled version of c#, coupled with the GDI+ drawing framework would be both programmer friendly and could perform very well on a 2D GUI like the Amiga's operating system. |
|
19 June 2020, 12:23 | #9 | |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
Quote:
https://www.mikekohn.net/micro/amiga_java.php Java running on an A1000 at decent speed is frankly stunning. It'll be my first port of call whenever I come to writing another Amiga game. Coincidentally, I've just started using C# to write a game for modern platforms and it's a lovely language. I love the syntax for creating a new object and assigning values at the same time for instance. I didn't see this thread at the time and it's shame it didn't get the attention it deserved as compiled C# would be great on Amiga. I also enjoyed using C to write Landfill and learning the nuts & bolts of Amiga hardware, but quite frankly, I don't need pointers to have a good time! |
|
19 June 2020, 16:32 | #10 |
cheeky scoundrel
Join Date: Nov 2004
Location: Spijkenisse/Netherlands
Age: 42
Posts: 6,977
|
It would be stunning, but it isn't actually happening. You are running a native Amiga program, Java is completely out of the picture. It is exactly that fact that makes it at all possible.
That doesn't make it any less clever though, if someone manages to make a full game with it that performs reasonably well then I'd be mighty impressed. |
19 June 2020, 19:14 | #11 | |
Registered User
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
|
Quote:
Yet another attempt by M$ to make something unnecessarily difficult. |
|
19 June 2020, 19:19 | #12 | |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
Quote:
|
|
19 June 2020, 19:22 | #13 |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
Not true. I’m using it now, for the first time. I picked it up in no time at all. Way less time than it took me to learn C. I think your use of “M$” says everything we need to know here.
|
20 June 2020, 13:27 | #14 | |
Amigan
Join Date: Feb 2012
Location: London
Posts: 1,317
|
Quote:
C is definitely better suited to low level stuff. Problem with C is that you really have to know what you are doing. I do like it as a language though. |
|
20 June 2020, 14:55 | #15 |
Registered User
Join Date: Jul 2009
Location: UK
Posts: 112
|
A professional got the classic snake game written in C# in under 8k, further work on optimization hope to get it under 512 bytes.
https://medium.com/@MStrehovsky/buil...s-74c3cf60ea04 |
21 June 2020, 11:08 | #16 |
Registered User
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
|
If a Hello World would require 10s of MB of RAM, then it's obviously not a great language at all...
|
21 June 2020, 13:27 | #17 |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
That’s the runtime, OS libraries, etc. Nothing to do with the language - as seen in asymetrix’s post. The compiled Java demo for Amiga is 138k, for a sense of what could be achieved.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Porting Qt Framework to Amiga OS enviroments | Pyromania | Coders. General | 2 | 24 July 2013 06:42 |
|
|