Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #8019

Re: new Java lambda syntax

From BGB <cr88192@hotmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: new Java lambda syntax
Date 2011-09-14 07:40 -0700
Organization albasani.net
Message-ID <j4qeca$vct$1@news.albasani.net> (permalink)
References (9 earlier) <j4meun$99r$1@dont-email.me> <j4o9rt$i0g$1@dont-email.me> <alpine.DEB.2.00.1109132120070.343@urchin.earth.li> <j4p41d$qm5$1@dont-email.me> <Gt_bq.20641$OO1.6700@newsfe02.iad>

Show all headers | View raw


On 9/14/2011 2:29 AM, Arved Sandstrom wrote:
> On 11-09-13 11:36 PM, Joshua Cranmer wrote:
> [ SNIP ]
>
> JS doesn't support OO in the classical
>> way, and how `this' gets resolved is actually handled by the way you
>> call the method.
> [ SNIP ]
>
> I point out somewhat tongue-in-cheek that JavaScript indeed isn't
> "classical" OO, since it's not class-based OO; rather it's object-based
> (prototype-based) OO. I think the argument can be made that it's a purer
> and more fundamental object-orientation, since you dispense with the
> class baggage.
>
> I confess to being seriously biased: lots of experimentation with
> non-Web JS programming, and Self and Lua programming. And certainly some
> strengths of Scala lead one to think more about runtime objects and not
> so much about instances of classes.
>
> Even though "classical" is strictly speaking a correct description of
> class-based OO, I sort of prefer "dominant" or "original". Or just
> "class-based". Again revealing my bias, I think class-based OO has done
> some degree of harm to object-oriented programming, so I am reluctant to
> associate it with a word like "classical".
>

yeah.

my own language started out as pure Prototype-OO, but has since 
implemented more of a hybrid model (partly influenced by ActionScript).

in this model, one can have plain dictionary objects (traditional 
JS-like objects), dynamic class objects (which look more like 
class/instance objects, but can have fields added dynamically), and 
plain class objects (implement class/instance, objects are fixed-form / 
may not be structurally altered at runtime).

whether the language behaves more like static or dynamic typing, or is 
early or late-binding, has more to do with ones' choice of types.

var i:int;	//behaves more like a statically-typed integer
var x;		//is more dynamically type.
var obj:SomeObject;

i=3.0;	//will coerce the type to an integer
x=3.0;	//will simply assign the value
i="3";	//bad/error
x="3";	//yep, now x holds a string
...
x.someMethod();		//late-bound / duck-typed
obj.someMethod();	//early-bound (sort of)

in a technical sense, the VM doesn't support early binding in the JVM 
sense (where the method call's type/... is defined in the bytecode ops), 
rather it is theoretically bound at load-time/"prejit-time" (in reality, 
this is an optimization feature, and is technically optional).


a partial merit of delaying type-handling until load-time or run-time is 
that it allows a lot more flexibility (and greatly simplifies things 
like having a semi-transparent C FFI without needing explicit compiler 
support).

one can also do many more things which look like dynamic and duck-typing 
without incurring nearly as many costs related to run-time type-checking 
and similar as well (to the codegen, they may still appear as static types).

a downside though is that a lot more of the "work" is shifted onto the 
VM, so "a simple naive bytecode interpreter which is also really fast" 
is mostly ruled out. however, this issue is mostly eliminated by using a 
JIT, and even with its slowdown, the plain interpreter is often "plenty 
fast enough" for most tasks.


or such...

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

new Java lambda syntax markspace <-@.> - 2011-09-08 13:19 -0700
  Re: new Java lambda syntax Roedy Green <see_website@mindprod.com.invalid> - 2011-09-08 15:18 -0700
    Re: new Java lambda syntax Arne Vajhøj <arne@vajhoej.dk> - 2011-09-08 18:27 -0400
    Re: new Java lambda syntax BGB <cr88192@hotmail.com> - 2011-09-08 15:40 -0700
      Re: new Java lambda syntax Arne Vajhøj <arne@vajhoej.dk> - 2011-09-08 19:27 -0400
        Re: new Java lambda syntax BGB <cr88192@hotmail.com> - 2011-09-08 16:29 -0700
          Re: new Java lambda syntax Arne Vajhøj <arne@vajhoej.dk> - 2011-09-08 19:48 -0400
          Re: new Java lambda syntax Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-09-08 17:56 -0700
            Re: new Java lambda syntax BGB <cr88192@hotmail.com> - 2011-09-08 22:23 -0700
    Re: new Java lambda syntax "Nasser M. Abbasi" <nma@12000.org> - 2011-09-08 16:41 -0700
    Re: new Java lambda syntax Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-09-08 20:50 -0500
  Re: new Java lambda syntax bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-09-09 09:33 +0100
  Re: new Java lambda syntax Tom Anderson <twic@urchin.earth.li> - 2011-09-10 14:48 +0100
    Re: new Java lambda syntax Steven Simpson <ss@domain.invalid> - 2011-09-10 16:17 +0100
      Re: new Java lambda syntax Tom Anderson <twic@urchin.earth.li> - 2011-09-11 13:06 +0100
        Re: new Java lambda syntax Steven Simpson <ss@domain.invalid> - 2011-09-11 17:18 +0100
          Re: new Java lambda syntax BGB <cr88192@hotmail.com> - 2011-09-11 11:08 -0700
            Re: new Java lambda syntax Steven Simpson <ss@domain.invalid> - 2011-09-11 20:14 +0100
              Re: new Java lambda syntax BGB <cr88192@hotmail.com> - 2011-09-11 14:08 -0700
              Re: new Java lambda syntax Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-09-11 17:07 -0500
                Re: new Java lambda syntax BGB <cr88192@hotmail.com> - 2011-09-11 16:18 -0700
                Re: new Java lambda syntax Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-09-13 02:00 +0200
                Re: new Java lambda syntax Arne Vajhøj <arne@vajhoej.dk> - 2011-09-12 20:59 -0400
                Re: new Java lambda syntax Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-09-12 21:24 -0500
                Re: new Java lambda syntax Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-09-13 21:04 +0200
                Re: new Java lambda syntax Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-09-13 15:22 -0500
                Re: new Java lambda syntax Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-09-13 23:25 +0200
                Re: new Java lambda syntax Tom Anderson <twic@urchin.earth.li> - 2011-09-13 21:29 +0100
                Re: new Java lambda syntax Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-09-13 23:26 +0200
                Re: new Java lambda syntax supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-09-13 20:25 -0400
                Re: new Java lambda syntax Tom Anderson <twic@urchin.earth.li> - 2011-09-15 21:58 +0100
                Re: new Java lambda syntax Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-09-13 21:36 -0500
                Re: new Java lambda syntax supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-09-13 22:49 -0400
                Re: new Java lambda syntax "supercalifragilisticexpialadiamaticonormalizeringelimatisticantations" <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-09-14 02:49 -0400
                Re: new Java lambda syntax supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-09-14 03:01 -0400
                Re: new Java lambda syntax "winkleMeister" <..00@00.00.00.1> - 2011-09-14 09:59 +0000
                Re: new Java lambda syntax supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-09-15 10:16 -0400
                Re: new Java lambda syntax supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-09-14 06:40 -0400
                Re: new Java lambda syntax supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-09-15 10:16 -0400
                Re: new Java lambda syntax lightworker <etts@0n.org.null> - 2011-09-16 01:57 +0000
                Re: new Java lambda syntax thoolen <th00len@th0lenbot.thorium> - 2011-09-15 22:41 -0400
                Re: new Java lambda syntax Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-09-14 06:29 -0300
                Re: new Java lambda syntax BGB <cr88192@hotmail.com> - 2011-09-14 07:40 -0700
                Re: new Java lambda syntax Lew <lewbloch@gmail.com> - 2011-09-14 08:01 -0700
                Re: new Java lambda syntax BGB <cr88192@hotmail.com> - 2011-09-14 14:50 -0700
                Re: new Java lambda syntax Lew <lewbloch@gmail.com> - 2011-09-14 18:02 -0700
                Re: new Java lambda syntax BGB <cr88192@hotmail.com> - 2011-09-14 21:08 -0700

csiph-web