FreeBASIC on iOS

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
kenshizl
Posts: 10
Joined: Aug 16, 2012 16:28

FreeBASIC on iOS

Post by kenshizl »

I was lookin' around the Apple app store and saw a couple of apps that let you write code and then run it. I was wondering how hard that is to make something like that and if FreeBASIC might consider making an app? I know I would thoroughly enjoy it, having a FreeBASIC code-writer/compiler with me in my pocket. So... Why not?

I have no idea how to do it as 'm only a beginner programmer, but I thought it would be a great project for the community to work on.

Thoughts?
jevans4949
Posts: 1186
Joined: May 08, 2006 21:58
Location: Crewe, England

Re: FreeBASIC on iOS

Post by jevans4949 »

Not knowing what you have seen, I'm guessing these apps are most likely interpreters http://en.wikipedia.org/wiki/Interpreter_(computing), rather than compliers,which is what Freebasic is. Running a compiler on a mobile device would likely be messy.

FreeBasic currently exists for Windows on Intel x86 processors and Linux on x86. I believe somebody has been trying to adapt for Apple on x86 desktop; AFAIK they haven't published this yet.

Most mobile devices are based on ARM cpus, whereas FreeBasic currently generates Intel x86 assembler, so you would have to re-write all the code generation parts of the compiler. You could use the C code generation facility, but then you would have to run that through a C compiler - so why not write C code in the first place?

However, I note that the Orange phone company in the UK is now offering an Intel Atom based mobile phone running Android 2.3 (the "San Diego"); I guess these are available elsewhere in the world. The only problem then would be to develop a version of the compiler to run under the Android operating system.

Long story short: unless somebody has an app development system and a test machine, a burning need to run FreeBasic on a mobile device, and the requisite knowhow, I can't see this happening.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: FreeBASIC on iOS

Post by marcov »

Most mobile devices are based on ARM cpus, whereas FreeBasic currently generates Intel x86 assembler, so you would have to re-write all the code generation parts of the compiler.
True. Moreover note that there is no general "arm". There are a lot of different ones, and there are also platform (ABI,OS) aspects on codegeneration.
You could use the C code generation facility, but then you would have to run that through a C compiler - so why not write C code in the first place?
Why bother with Basic to Assembler compiler then, why not write assembly in the first place? Answer: Not all languages are the same.

Btw, one should keep in mind that most mobile OSes limit what apps can access using sandboxes. One iOS you have to declare in a manifest what directories and OS privileges you are going to access, and you can't access anything outside.

It is not like e.g. Windows where an application can access the bulk even with admin rights.
However, I note that the Orange phone company in the UK is now offering an Intel Atom based mobile phone running Android 2.3 (the "San Diego"); I guess these are available elsewhere in the world. The only problem then would be to develop a version of the compiler to run under the Android operating system.
And jailbreak the phone I guess to get access at all.
codeFoil
Posts: 256
Joined: Dec 22, 2011 4:45
Location: United States
Contact:

Re: FreeBASIC on iOS

Post by codeFoil »

The only problem then would be to develop a version of the compiler to run under the Android operating system.
= dalvik Java machine byte code... so the task remains the same.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: FreeBASIC on iOS

Post by marcov »

codeFoil wrote:
The only problem then would be to develop a version of the compiler to run under the Android operating system.
= dalvik Java machine byte code... so the task remains the same.
No. Android was only kept jvm bytecode only while it was in development (the idea was system software native for speed and batterysaving, and all "apps" only bytecode to have a safe VM, but they abandoned it, because heavier apps would be too slow).

When Android went into production the appstores afaik all allowed native code. The native code must be in a library though, with a very minimal Java application skeleton routing the events into it.
jevans4949
Posts: 1186
Joined: May 08, 2006 21:58
Location: Crewe, England

Re: FreeBASIC on iOS

Post by jevans4949 »

With regard to Apple devices, the other key question is what hoops you have to jump through to get your product into the Apple store (and how much it would cost).
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: FreeBASIC on iOS

Post by marcov »

jevans4949 wrote:With regard to Apple devices, the other key question is what hoops you have to jump through to get your product into the Apple store (and how much it would cost).
The first times a lot, expect to get it back several times before you get all the little details right (specially for new compilers/targets).
The recent sandbox requirements add another layer of complexity.

But that is for FB generated apps. As for FB, on iOS afaik you can't generate anything. The cross-binutils only exist for OS X.

As to cost, $199 annually IIRC.
roook_ph
Posts: 402
Joined: Apr 01, 2006 20:50
Location: philippines
Contact:

Re: FreeBASIC on iOS

Post by roook_ph »

It is easy to see whats the point in this discussion, Apple is enticing developers by creating apps that looks similar if not portable to freebasic . Then what, yearly subscription? Hard to find libs? Im sticking to win/linux
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Re: FreeBASIC on iOS

Post by anonymous1337 »

No way. Objective-C is awesome.

Okay, I'm lying. XCode wasn't too bad of an environment, though. Even having to work in XCode, dev'ing for iPhones was more enjoyable than Android devices, IMO.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: FreeBASIC on iOS

Post by marcov »

roook_ph wrote:It is easy to see whats the point in this discussion, Apple is enticing developers by creating apps that looks similar if not portable to freebasic . Then what, yearly subscription? Hard to find libs? Im sticking to win/linux
Windows and Linux are full, open operating systems. The point is that iOS is not.

The only thing that iOS has going for it is that everybody has a drive to get on the train. For most of those people, that drive is irrational.
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Re: FreeBASIC on iOS

Post by TESLACOIL »

Microsoft is about to launch the 'Surface' tablet, an x86 version which will run win8. It may well be possible to get FreeBASIC running under win8 as that is a full on OS which runs on x86

There are also a few tablets which use win7. There a a large number of atom based tablets and a few atom based smart phones in the pipeline. Be nice to have full x86 integration across all these platforms. Im not sure how far win8 will act as that bridge.

The latent consumer demand for full on windows tablets is very high indeed. Msoft and Intel have been dithering for some time in this market but are now making aggressive moves. Intel under threat from ARM and Msoft under threat from various OS used in smart phones and tablets.

As soon as 'surface' hits the stores ill run down and try out a few FB exe's on it....end of October the release date



A midranged smart phone has 10x the CPU speed and 10x the ram of the first win95 desktops, the processing power to run windows on tablets and phones has been around for a few years, its just that the architecture manufactures use is different, non 86. Computational wise there is no reason why a lite version of windows could not run on a mid-ranged smart phone or tablet. Its more a case of gross industry sagacity than a technological short fall.
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: FreeBASIC on iOS

Post by MichaelW »

TESLACOIL wrote: A midranged smart phone has 10x the CPU speed and 10x the ram of the first win95 desktops...
For the current desktops it's something like 30x in terms of clock speed, and much more in terms of performance, and 100x.
Gonzo
Posts: 722
Joined: Dec 11, 2005 22:46

Re: FreeBASIC on iOS

Post by Gonzo »

it's just too bad that smartphones have a touch-screen, which makes them useful for almost doing almost nothing =)
most types of games are out of the question, and it's positively annoying to type anything on those keyboards
for the record i have a galaxy s3 which i actually like as a phone.. but i dont use it for much else :)
it's nice for reading books and such though

i also developed a few small apps for the android os'es.. i didn't like it very much
a little bit restrictive and the gpu's on those phones aren't exactly strong
but it works at least :) good for anything 2D
i don't think i'd want to code anything on android unless they suddenly got 5-10x faster
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: FreeBASIC on iOS

Post by marcov »

Gonzo wrote:it's just too bad that smartphones have a touch-screen, which makes them useful for almost doing almost nothing =)
most types of games are out of the question, and it's positively annoying to type anything on those keyboards
for the record i have a galaxy s3 which i actually like as a phone.. but i dont use it for much else :)
it's nice for reading books and such though
Trust me, when you get used to a 6" E-ink ebook reader, you never want to go back :-)

But I agree with your sentiment wholeheartly. It is all nice and dandy to talk "revolutionary" about conquering the mobile market, but you need to think if it is actually worth the trouble.

Since not all trouble will be one off (doing the port), since there will also be matter of getting each device either rooted (the happy fews favourite choice), or provisioned via the App market, which comes with associated annual pricetag.

I think development never will be done on such devices (in theory, the largest tablets could, but if it happens it will be fairly marginal), so it is more a crosscompile item.

And for iOS you almost _NEED_ to crosscompile from a Mac (OS X), so if you want to go there, advance the Mac port first :-)

The reason for this is that the binutils for IOS only exist for (recent!) OS X
Post Reply