Implementing Beta for MacOS

image_pdfimage_print

There are some module/fragments supporting a possible implementation of Beta.

  • The object-file format for MacOS is MACH-O. There are fragments in GENERATOR supporting MACH-O. It is probably not supporting ARM – perhaps PowerPC and/or INTEL386. But probably easy to change.
  • We need a code generator for ARM.
  • There is a machine-type MACOSX.
  • We may compile to this ,machine type using beta -t macosx foo.
  • W may also execute the job-file on a remote machine beta -m SomeMachine.
  • We need to get betarun implemented for ARM.
    • May give problems for compiling it to ARM.
    • There may perhaps be problems when compling the C-code.
  • We should find out which of the other platforms that have the simplest structure and use a similar one for MacOS.
beta.bet:
ORIGIN  'compiler';
INCLUDE '~beta/basiclib/systemenv';
BODY 'SYNTHESIZER/synthesizer';
BODY    'GENERATOR/oldbackend';
BODY 'CONTROL/translate_asmbody'
-----program: descriptor---
systemEnv
(# IC: @InteractiveCompiler
do IC
#)

Note! There have been attempts to implement a number of platforms for MacOS.

GENERATOR/oldbackend:
ORIGIN 'machine';
INCLUDE 'REALmachine'; (* declares machine *)
MDBODY sun4s   'SUN4S/SUN4Sbeta'
       sgi     'SGI/SGIbeta'
       linux   'LINUX/LINUXBbeta'
       x86sol  'X86SOL/X86SOLbeta'
       macosx  'MACOSX/MACOSXbeta'
       hpux9pa 'HPUXPA/HPUX9PAbeta'
       ppcmac  'PPCMAC/PPCMACbeta'
       nti_ms  'NTI_MS/NTIMSbeta'
       nti_gnu 'NTI_GNU/NTIGNUbeta'
       macosx   'MACOSX/MACOSXbeta'
       mac_ix86 'MAC_IX86/MAC_IX86beta'
---machineFactory:doPart---
do
   &machine[] -> mch[]
CONTROL/translate_asmbody:
ORIGIN 'translate_controlbody';
INCLUDE '../GENERATOR/machine';
INCLUDE '../GENERATOR/asmlink';
BODY   'translate_libsbody';
---xDependencyLib:attributes---