[ruby-core:32662] Re: Proposal for Optional Static Typing for Ruby

From: Martin Pilkington <pilky@...>
Date: 2010-10-01 01:33:35 UTC
List: ruby-core #32662
Hi Ellie

What do you mean by runtime mutable? Do you mean creating new classes or =
methods at runtime? Do you mean creating a new class at runtime? Do you =
mean adding a method to an existing class at runtime? Swapping the =
implementation of two methods? Loading new code at any point during =
runtime? All of those are things that Objective-C can do. The only thing =
you can't do is to interpret a string containing Obj-C as code, as while =
Obj-C is heavily runtime based, it is still a pre-compiled language =
(that said it is theoretically possibly in the future for such JIT =
compilation to occur).

Yet despite being very dynamic, it also gives the ability for type =
information to be added prior to compilation, so tools can use it to =
help aid developers.

Thanks

Martin

On 30 Sep 2010, at 10:48PM, Eleanor McHugh wrote:

> Hi Martin,
>=20
> Objective-C is a fundamentally different beast to Ruby: yes it's =
dynamically typed, but it's not runtime mutable in the way that Ruby, =
Lisp and Forth are. That's not to say you can't battle against the flow =
of either language - after all, once you have function and void pointers =
you can play tricks with assembler injection and type reinterpretation =
to do pretty much anything you fancy, and that's certainly an option =
with Objective-C thanks to its C heritage and Ruby thanks to the DL or =
FFI extensions.
>=20
> The question is whether trying to fit code in either language to the =
design criteria of the other is such a great idea - let alone insisting =
that either conform to the particular prejudices of a given style of =
development tool.
>=20
>=20
> Ellie
>=20
> Eleanor McHugh
> Games With Brains
> http://feyeleanor.tel
> ----
> raise ArgumentError unless @reality.responds_to? :reason
>=20
>=20
>=20


In This Thread