[Coco] Swift

James Ross jrosslist at outlook.com
Sat Dec 5 05:36:08 EST 2015


> From: matju at artengine.ca
> .... I think it would be best to port that
> framework, though I suppose you could break it down into smaller pieces
> and perhaps omit some less used parts at first.

True, one would probably want a subset of the most used classes and/or you could have a smart linker that strips the classes that is are not used. 

>> And yes, a 6809 target would be COOL! for sure!
> Then you first better define how you are going to port it to a 8/16-bit
> platform... adapt the integer types, or keep them as they are on 32/64-bit
> platforms ?

I am not well versed in Swift as of yet. I am gearing up to learn it. But from what I understand you have the types Int8/Int16/Int32/Int64 (signed and unsigned versions) which dictate the exact size. As for the standard "Int" for it to make sense on the 6809 would have to be 16 bit (i.e. the D register) by default and the programmer would have to be aware they were writing an app that would be running on a 8/16 bit processor and make judicious use of the different int types... 

However, as Boisy pointed out, it would be a huge, project. Probably not something I would tackle anytime soon.  

I have recently given some thought and considered a Java/JVM or C#/CLR byte-code AOT compiler that would generate 6809 assembly language. It would have a very small subset of the run-time + a smart linker that stripped unused parts of the standard libraries.  Don't know if it would be worth the effort, but possibly simpler than say the Swift compiler, as generating 6809 code from byte-code would ultimately be simpler than going through the Abstract Syntax Tree (AST) to generate 6809 code -- especially if you have to create that Parser / AST from scratch.  However, using the existing Swift infrastructure which is a layer on top of LLVM to begin with would give you a big head start on that, but good luck coming up to speed on all that code! Massive amounts of code. 

However, either idea (Swift compiler or Byte-Code compiler) sounds like it would be fun to work on *if* time were not an issue...  

James

 		 	   		  


More information about the Coco mailing list