Java on iOS?

S

Steve Sobol

I read somewhere that Apple has relaxed its restrictions on what tools
can be used to develop iPhone/iPad software. This happened a couple
months ago.

So I'm wondering if anyone has done any iOS apps in Java.

I am taking delivery of a Mac Mini in the next week or two, and I could
use Xcode to create iOS apps. But with the exception of a few small
projects I'm doing that require C, I don't want to ever use the language
again.

Ever. :)
 
S

Steve Sobol

If by "modern" one means a language designed 20 years ago and having
enjoyed very little improvement since then, other than a mad rush over
the last few years to play catch up to languages like Java and C#.

The way I understand it, Objective-C *is* C with a couple major changes.
Me, if I were forced to write an iPhone app, I'd much rather use
something like MonoTouch than mess around with a native iOS app. If I'd
seen Objective-C back in 1990, I'd have swooned like everyone else. But
today? Meh.

If you want to write Java on a phone, I'd suggest going Android. And no
Big Brother there to tell you what kind of program you're allowed to write.

Well, yeah. :) But there is a market for iOS apps. (Although Android has
enough market share that there is now ALSO a market for Android apps).
 
S

Steve Sobol

With a bit of flexibility, a developer who's accustomed to Java won't
have much trouble with ObjC. It had, after all, a *lot* of influence on
Java's designers in the early days.

<http://cs.gmu.edu/~sean/stuff/java-objc.html>


I doubt I'd have trouble with Objective-C. I know both Java and C++.
Honestly, the reason I don't like C and its derivatives is because it
gives me way too much power to completely break things :)

And, if you want access to that market, you can't write in Java. That
situation will almost certainly change, given Apple's change in policy,
but that change hasn't happened yet.


Ok.

Thanks :)
 
L

Lew

Sherm said:
Boo hoo. Did I hit a nerve, little boy?

Dude, you take away the power of the plonk when you answer post-plonk. Now
Peter knows he can get a rise out of you even after you claim you aren't
listening. Certainly there's no chance that plonking him again will hit a
nerve, because he won't believe it.

I doubt very much that insulting him will penetrate his opinion. He'll
probably just project it back, insult you back, no doubt to feed his manic
glee, and the discussion of Java on iOS will be gone completely. You want to
defeat him, stay resolutely on topic and let anything else from him be as the
whispering of the wind.

Is there any concrete evidence that Apple is considering supporting Java on
iOS, or is it just expectation?

Oh, and BTW, :)
 
P

projectmoon

Lew said:
Is there any concrete evidence that Apple is considering supporting
Java on iOS, or is it just expectation?

Oh, and BTW, :)

I doubt Apple will ever put a JVM on iOS. The app store has a policy
against running programs that interpret code, if i remember correctly.
This prevents all languages that are interpreted: python, ruby, etc.

If a jvm ever did show up on iOS, it would be restricted just like the
rest of the applications are, and to that end it couldn't really be
called java.
 
C

ClassCastException

Fragile object construction is fundamental to the language, and I don't
think that'll ever change. Some things have gotten a lot better – it
now has closures, which isn't even in Java, and there are a bunch of new
"synthesis" features for auto-generating certain kinds of code

Sounds like they're groping their way slowly and blindly towards
reinventing Lisp -- particularly, functional programming and macros.

Everybody tries Lisp, rejects it because of the infamous prefix math and
parentheses, then spends the rest of their careers using languages that
are trying to recapture all of the goodness of Lisp without giving in to
the evils of prefix math and parentheses.

Some do better -- Ruby, Smalltalk -- and some do worse. (If you want
really bad, try Visual Basic. Now please pardon me while I go wash my
mouth out with soap.)
frankly, Objective-C still has plenty of ways to shoot yourself in the
foot, much more than anything I'd call a _truly_ modern language.

Any powerful language does. The foot bullets just look different.

With C and derivatives it's blue screens and segfaults.

Java gives you exception stacktraces, particularly NPEs,
ClassCastException :))), variations of the themes of ParseException and
IndexOutOfBoundsException, and an assortment of headscratchers. (For
these purposes, SAXException, MalformedURLException, and
NumberFormatException are considered variations on the theme of
ParseException, and NoSuchElementException IndexOutOfBoundsException.)
Oh, and an assortment of anal compiler errors.

Lisp gives you stack overflows and infinite loops when you screw up, or
nils propagating through everything and your program output coming out as
"nil".

Smalltalk has the infamous red-bordered debugger window, almost always a
DoesNotUnderstand caused by a type error that'd silently propagated for a
while.

BASICs run out of memory or give you cryptic wrong results and infinite
loops, thanks to the tendency to write spaghetti code without higher
level constructed types in it. Plus plenty of array bounds errors.

Shell will just quietly erase your filesystem or spam the console with
garbage interspersed with file-not-found errors after going completely
off the rails.

The other scripting languages -- particularly Ruby, Python, and Perl --
generate an assortment of errors mostly reminiscent of either BASIC or
Java depending, although in Perl's case the most common symptom may be
the programmer checking himself into a mental institution after a
while. :)

A unique pattern with the scripting languages is string manglage -- auto-
generated emails sent to "for" or even to "domain@host", for instance, or
serving up a Web page saying "Current temperature: array index out of
bounds Current air pressure: file not found". Yes, it's quite easy for
the TEXT of the error messages to get mixed into the output! But the foot
bullet symptom particularly characteristic of these is your e-voting site
playing the Michigan U fight song every time someone casts a ballot. In
other words, you get hacked.

Haskell and the ML family yield up a wide variety of compile errors
involving type inference, some real hair-pullers, but on the other hand
if it does compile it actually probably works.
I'll give Objective-C props for one thing: it's certainly as powerful as
most any other "modern" language

Well, duh. I assume the developers of Objective-C at least managed to
churn out something that was Turing-complete.
But as programmers have proven time and time again, even
the good ones really benefit a great deal from a language that focuses
on reliability first, and power second.

Why choose only one when you can use Clojure? :)
 
L

Lew

Peter said:
I rarely engage in insults. It's happened maybe once or twice in the
last five years, and it'll take a lot more than Sherm's sensitivity
about negative opinions regarding Objective-C to push me over the edge.

It's interesting to note you taking Sherm's side, when he's the one
throwing ad hominem around. I thought you knew better. But then, you
should have known better than to expect me to resort to insults in the
first place.

OH, I'm so sorry - I actually don't think there's anything wrong with what you
said. There was a smiley-face in my post, you know. It was not arbitrary.

I'm not taking Sherm's side on anything, really - I just didn't want to come
from an antagonistic perspective in my discussion with him. Truly, Pete, I
respect your knowledge and opinions, and agree with you more than you probably
credit. In real life I know you weren't insulting anyone nor have any manic
glee.

Please accept my apology for sounding like I was coming down on you.

That post was a reductio ad absurdum scenario in which I hoped to illustrate
the pointlessness of arguing with you even if you were such a person as I
seemed to describe. It should be obvious to anyone that there's no point in
arguing that way with a person who's being reasonable.

For the record it was a hypothetical scenario - any resemblance to actual
persons living or dead is purely coincidental.
 
T

Tom Anderson

Sounds like they're groping their way slowly and blindly towards
reinventing Lisp -- particularly, functional programming and macros.

Everybody tries Lisp, rejects it because of the infamous prefix math and
parentheses, then spends the rest of their careers using languages that
are trying to recapture all of the goodness of Lisp without giving in to
the evils of prefix math and parentheses.

The funny thing is, LISP was not originally intended to have prefix
arithmetic and lots of irritating spurious parentheses. The brackety
syntax was something like an intermediate representation in a compiler,
and the intent was to define an 'M-syntax' that looked more like a normal
language (for 1958 values of 'normal' - it would probably have been like
FORTRAN or ALGOL), which a frontend would translate into the simpler and
more regular S-expressions to hand to the interpreter or code generator at
the backend.

However, the M-syntax was not even defined by the time the backend was
ready, so LISP was released with just the S-expression syntax. It was
intended that this would be a temporary situation, and the M-syntax would
follow soon, but it turned out people were happy programming in
S-expressions, and were more interested in getting other features
implemented. The M-syntax never happened - or rather, still hasn't
happened. Or rather, there have been implementations, but they've never
really taken off.

At some point, i suppose, ALGOLish syntaxes became so ingrained in the
popular consciousness that the fact that LISP still didn't have one became
a barrier to its adoption.

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top