Will FreeBASIC compile on Mac OS X? How hard would it be to port?
Jeremy
Mac OS X?
The OSX/x86 port wouldn't be too hard, in the compiler you would have to create a new fbc_osx.bas and edit the fbc.bas and inc/fb.bi files.
The hardest part would be the runtime library if FreeBSD (used as base by Apple) isn't fully compatible with the rtlib Linux port (the rtlib/linux/*.c files). The gfxlib would be harder to port, if Cocoa and its Objetive-C dependency is involved.
Also, all configure.ac and makefile.in files in the /rtlib, /compiler and /gfxlib2 dirs would have to be updated and GNU autoreconf re-run.
The GNU binutils also would have to be copied to bin/osx and the crt*.o, libgcc.a, etc from GCC OSX/x86 distro to lib/osx.
The only problem is, nobody in the dev team has a Mac, so we can't do the port at the moment. Anybody willing to create the OSX/x86 port *AND* willing to maintain it (what's more important than the port itself as nobody else would have how to make releases, fix bugs, make updates, etc) would become a new member of the dev team in the next minute, getting money, girls and the good stuff in return.
The hardest part would be the runtime library if FreeBSD (used as base by Apple) isn't fully compatible with the rtlib Linux port (the rtlib/linux/*.c files). The gfxlib would be harder to port, if Cocoa and its Objetive-C dependency is involved.
Also, all configure.ac and makefile.in files in the /rtlib, /compiler and /gfxlib2 dirs would have to be updated and GNU autoreconf re-run.
The GNU binutils also would have to be copied to bin/osx and the crt*.o, libgcc.a, etc from GCC OSX/x86 distro to lib/osx.
The only problem is, nobody in the dev team has a Mac, so we can't do the port at the moment. Anybody willing to create the OSX/x86 port *AND* willing to maintain it (what's more important than the port itself as nobody else would have how to make releases, fix bugs, make updates, etc) would become a new member of the dev team in the next minute, getting money, girls and the good stuff in return.
Would you have to port the graphics part? I will play with FreeBASIC on my linux box for a bit. Write a few sample programs of things I do in every day life.
Basically, I am looking for a language that is compiled, more efficient on memory and processor usage than the scripting languages I normally use (Python, Ruby, PHP) but not as complex or dangerous as C.
I know C, but for some apps I just don't want to revert to it. To cumbersome.
Jeremy
Basically, I am looking for a language that is compiled, more efficient on memory and processor usage than the scripting languages I normally use (Python, Ruby, PHP) but not as complex or dangerous as C.
I know C, but for some apps I just don't want to revert to it. To cumbersome.
Jeremy
Right. You'd have to program fbc on another platform first, and have it produce Mac code. FreeBASIC was originally written in VBDos, for 16-bit real mode DOS.
That means making sure the library that fbc depends on (rtlib) works on MacOS, and then making sure that it produces assembly that's compatible.
That means making sure the library that fbc depends on (rtlib) works on MacOS, and then making sure that it produces assembly that's compatible.
OS X has a different calling convention than Linux. (e.g. handles by value types differently iirc). So unless e.g. GCC abstracts you enough from that, it will require both compiler as RTL work.
Still, the basic port (for FPC) was done relatively easily (2-5 days by experienced developer), but he started from an already abstracted Unix port, cleaned of Linuxisms because of FreeBSD.
Still, the basic port (for FPC) was done relatively easily (2-5 days by experienced developer), but he started from an already abstracted Unix port, cleaned of Linuxisms because of FreeBSD.
jeremy wrote:Say I wanted to give it a shot, how would I even be able to work on it as there is no compiler on Mac OS X to begin work on it with, it's a self compiling compiler.
Jeremy
Crosscompiling. E.g. compile on platform A for platform B.
However in general it is often easier for initial ports to generate assembler (text), and assemble and link on the target (B), to avoid mixing the normal linking probs and the specific cross- issues.
Specially in this case, since Mac OS X does not use GNU LD/AS, but an own linker and assembler (based on the NextStep one, which is based on ancient (1985-1990) BSD linkers, with own cmdline etc.
Since, new mac os runs on intel based machines, there are ways of installing osx on normal pc.
check this out:
http://en.wikipedia.org/wiki/OSx86
check this out:
http://en.wikipedia.org/wiki/OSx86
Other then said "normal PC" *must* have SSE2 and it's preferable to have SSE3. This excludes anything predating the P4 and AthlonXP64/Opteron CPUs.
See here: http://en.wikipedia.org/wiki/SSE2
See here: http://en.wikipedia.org/wiki/SSE2
Who is online
Users browsing this forum: No registered users and 16 guests