public inbox for
 help / color / mirror / Atom feed
From: Kresten Krab Thorup <>
To: Jeff Sturm <>
Cc: Tom Tromey <>, Maury Markowitz <>,
Subject: Re: Objective-C vs. gcj (was: Re: Newbie questions)
Date: Sat, 01 Apr 2000 00:00:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Jeff Sturm <> writes:

> > When you say "weak" typing, what do you mean?
> He means Objective-C doesn't do any compile-time binding or even
> checking of method invocations.  Every instance variable can be declared
> as "id" which is equivalent to Java's java.lang.Object class.  

Equivalent is not quite right.  The type `id' is a super-type for all
other types (including root classes such as Object); and indirections
(i.e., method calls) via a reference of type `id' are runtime
type-checked.  The compiler will issue warnings in some cases, i.e.,
if it has not "seen" a method declaration with the given name.

> method name is misspelled or can't be resolved at runtime for any
> reason, a runtime error is thrown and the program generally aborts
> (which I consider a drawback of the language).


> Note that the Java _language_ is strongly typed though bytecode is
> not... all names are dynamically resolved from bytecode, just as in
> Obj-C.

Java byte-code is stronly type checked.  The Verifier implements
almost the exact same semantics checks as the compiler does.

> > What is categorization?

The term `categories' stems from Smalltalk terminology.  In the file
format for `filing in' code in a ST system, there is syntax that
allows methods to be added to existing classes.  This is exactly the
functionality of categories.  In Objective C, such categories can be
loaded at runtime.

> Objective-C has a neat feature which makes it extremely simple to write
> delegate classes.  The runtime attempts to dispatch a method invocation
> to the named method, but if a method is not found it defaults to the
> "forward:" (?) method, which can be overridden to route the invocation
> to another object, or even marshal the arguments for delivery to a
> remote object.  Obj-C had a very elegant solution to distributed
> programming that way.
> Similar tricks could be performed with Java reflection, I'd guess.

In Java, this is not possible; it would require a change to the
language semantics.  The new 1.3 proxy stuff does something that comes
close, though.

-- Kresten

 Kresten Krab Thorup           "I like my eggs ploded"
 Department of Computer Science, University of Aarhus
 Aabogade 34, DK-8200 Aarhus N, Denmark
 +45 8942 5665 (office), +45 2343 4626 (mobile)

  reply	other threads:[~2000-04-01  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-01  0:00 Newbie questions Maury Markowitz
2000-04-01  0:00 ` Tom Tromey
2000-04-01  0:00   ` Objective-C vs. gcj (was: Re: Newbie questions) Jeff Sturm
2000-04-01  0:00     ` Kresten Krab Thorup [this message]
2000-04-01  0:00       ` [OFFTOPIC] " Joerg Brunsmann
2000-04-01  0:00     ` Per Bothner
  -- strict thread matches above, loose matches on Subject: below --
2000-04-01  0:00 Maury Markowitz
2000-04-01  0:00 ` Jeff Sturm
2000-04-01  0:00 ` Jon Olson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).