English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 04 November 2011, 11:50   #1
Doc Mindie
In deep Trouble
 
Join Date: Sep 2004
Location: Manchester, Made in Norway
Age: 51
Posts: 841
So... getting AmigaE to other platforms

How hard would that be?

I mean, the sourcecode for AmigaE v3.3a is about 450kB in a single huge 68k hardcoded assembler...

But I was thinking, Leif Solomonsen has made ECX purely IN AmigaE, and got it to produce PPC runable binaries.... so how easy or hard would it be to get a x86 executable that is essentially the AmigaE compiler, only for GNU/Linux (or even the Redmond tragedy) instead of Amiga, and produces x86-ELF binaries? (alternatively, though not as attractive to me personally, produces Redmond executables)

I do realise, that with my level of coding expertise, I'm asking a daunting question, though mayhaps some more experienced coder could talk me out of making a selfcompiling crosscompiler utlising AmigaE only (no assembly, no system specific functions, only using the AmigaE equivalent of the C/C++ "standard" libraries that comes with any and all C/C++ compiler).

Probably a project I should just throw away, however, it would be nice to code in AmigaE (well, it would be renamed LinuxE, wouldn't it :P ) under GNU/Linux
Doc Mindie is offline  
Old 04 November 2011, 11:58   #2
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,522
Have a look at : http://cshandley.co.uk/portable/
TCD is offline  
Old 05 November 2011, 22:10   #3
Doc Mindie
In deep Trouble
 
Join Date: Sep 2004
Location: Manchester, Made in Norway
Age: 51
Posts: 841
PortablE is merely taking an E sourcecode and translates it to C++, I would like to compile E directly without using a middleman programme, if that makes sense

I know all (well, descriptionwise, anyways ) about PortablE I subscribe to the (very wuiet) AmigaE Positron list
Doc Mindie is offline  
Old 08 November 2011, 03:41   #4
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Cutting out the middle-man is as simple as taking a compiler framework like GCC or LLVM and pasting the equivalent of every C++ code generated by it and feeding it into the rest of the framework like G++ or Clang++ do respectively. If you want to keep it closed source, LLVM's BSD-like license makes it respectable to do so. That should decrease the compilation time slightly by removing the text-based overhead.

If you really want to decrease the compilation time, make most of the statically added code and make a shared library out of it. In Linux it would be a .so file.

I expect that Chris Handley will get to that point eventually, but he's looking for bugs with the existing code first.
Samurai_Crow is offline  
Old 14 November 2011, 08:58   #5
Doc Mindie
In deep Trouble
 
Join Date: Sep 2004
Location: Manchester, Made in Norway
Age: 51
Posts: 841
Acording to the AmigaE's "opensource" license from Wouter, you're not allowed to make a closedsource version, though, are you? Even if it means making a crosscompiled compiler...

hmm... lemme see.... how to explain my way of thinking proper... I fancy coding in E, a programme that can directly crosscompile any (non systemspcific) source into x86 ELF executable format to work under Linux. This (Amiga executable) programme could then be used to compile itself, hence making a Linux ELF executable programme which then could be used to directly compile (under x86 Linux) the sourcecode you make....

My main inspiration for this, is Leiv Solomonsen's ECX, which (if I have understood correctly) can be run "natively" on OS4/4.1, which requires a PPC.

If any of that made any sense, just tell me and I'll rephrase it :P
Doc Mindie is offline  
Old 14 November 2011, 14:18   #6
absence
Registered User
 
Join Date: Mar 2009
Location: moon
Posts: 373
Quote:
Originally Posted by Doc Mindie View Post
Acording to the AmigaE's "opensource" license from Wouter, you're not allowed to make a closedsource version, though, are you? Even if it means making a crosscompiled compiler...
If you're refering to the GPL, it covers the source code of the original compiler, not the language itself.

Quote:
Originally Posted by Doc Mindie View Post
hmm... lemme see.... how to explain my way of thinking proper... I fancy coding in E, a programme that can directly crosscompile any (non systemspcific) source into x86 ELF executable format to work under Linux. This (Amiga executable) programme could then be used to compile itself, hence making a Linux ELF executable programme which then could be used to directly compile (under x86 Linux) the sourcecode you make....
An x86 ELF executable to work in Linux that is an Amiga executable? I'm confused. Anyway, there's an excellent LLVM tutorial that shows how to implement a language front-end, as was suggested. You could even write it in E and use Portable to bootstrap the first version.
absence is offline  
Old 16 November 2011, 12:44   #7
Doc Mindie
In deep Trouble
 
Join Date: Sep 2004
Location: Manchester, Made in Norway
Age: 51
Posts: 841
Quote:
An x86 ELF executable to work in Linux that is an Amiga executable?
No... an AmigaE executable, where you input the AmigaE sourcecode to produce said executable, that will produce an x86-ELF executable from the same sourcecode.

As in:
You write up the (cross)compiler in AmigaE.
You compile it with EC -> producing an Amiga Executable compiler that produces ELF binaries for x86
This Amiga-executable then compiles the sourcecode from step 1, to produce the x86 ELF binary that can then be used directly to compile stuff IN Linux, instead of compiling on the Amiga and then copying the resulting binary over.
Doc Mindie is offline  
Old 16 November 2011, 13:11   #8
absence
Registered User
 
Join Date: Mar 2009
Location: moon
Posts: 373
Quote:
Originally Posted by Doc Mindie View Post
No... an AmigaE executable, where you input the AmigaE sourcecode to produce said executable, that will produce an x86-ELF executable from the same sourcecode.
I understand, that's called bootstrapping and is how GCC and many other compilers are compiled. Whether you use ECX or Portable to do the bootstrapping doesn't matter, but I would advise against targeting "Linux x86" as it's a dying platform. Desktops are mostly x64 (regardless of operating system), and mobile units are mostly ARM. By targeting an abstraction you can support multiple back-ends (platforms) instead. This abstraction and its back-ends can be written by yourself in E, or you can save yourself a lot of work and use an existing framework like Parrot or LLVM. They usually get you both low-level platform specific details and higher-level optimisation, which lets you focus on implementing the actual language instead of reinventing the wheel.
absence is offline  
Old 18 November 2011, 10:55   #9
Doc Mindie
In deep Trouble
 
Join Date: Sep 2004
Location: Manchester, Made in Norway
Age: 51
Posts: 841
ahh, right... now... I thought... seeing as I "only" have the intel ia32 (aka x86) manuals and documentation, i thoguht it would be easier to at elast get the language to there first... then I could recruit some help to get the ia64 support?

Or mayhaps I "only" need to understand howto create an ELF-executable first?
Doc Mindie is offline  
Old 18 November 2011, 12:21   #10
absence
Registered User
 
Join Date: Mar 2009
Location: moon
Posts: 373
Quote:
Originally Posted by Doc Mindie View Post
Or mayhaps I "only" need to understand howto create an ELF-executable first?
If you use an existing compiler architecture (Parrot, LLVM, others), you don't have to understand about CPUs or executables at all. They provide that functionality for you, at least for major platforms. If you want to make Amiga executables in addition to Linux ones, there's a bit more work.
absence 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
Starting on Amiga, experienced on other platforms merry Coders. General 11 23 June 2013 18:59
AmigaE IRC Channel - Please Visit novaburst Coders. General 5 12 February 2011 01:56
How come nobody considers porting Fellow to other platforms? MethodGit Amiga scene 26 09 August 2010 00:15
AmigaE.... any survivors? Doc Mindie Coders. General 11 15 December 2007 01:15
What is your favourite Shoot'em-Up ? (all platforms) RCK Retrogaming General Discussion 177 25 February 2007 17:14

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 23:55.

Top

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