SitePoint Sponsor

User Tag List

Page 4 of 4 FirstFirst 1234
Results 76 to 87 of 87
  1. #76
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku
    You've probably read it already, and if not - you should: modules in Programming Ruby.
    OK, I just read it (haven't before).

    It is indeed an interesting concept -- sorta kinda a non-abstract Interface.

    Off Topic:

    But what happens in Ruby if you include two modules that both have a (different) implementation of the same method?

  2. #77
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BerislavLopac
    It is indeed an interesting concept -- sorta kinda a non-abstract Interface.
    Actually, modules are abstract - they can't be instantiated. They just aren't completely so, as methods are indeed concrete. Effectively, they're abstract classes without abstract methods that can be multi-inherited.

    Off Topic:

    But what happens in Ruby if you include two modules that both have a (different) implementation of the same method?
    The latter simply takes precedence. It's no different from replacing a value with another.

  3. #78
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku
    Actually, modules are abstract - they can't be instantiated. They just aren't completely so, as methods are indeed concrete. Effectively, they're abstract classes without abstract methods that can be multi-inherited.
    They're not classes, because they're not types, just a bunch of methods to be included. And also, if they can contain non-public methods they are not interfaces either. So, they are neither classes nor interfaces, hence the new name "mixins".

  4. #79
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku
    Uh. Looks like programming in io would require some serious reorientation.
    My first though too. I just took 10 minutes to read the first chapter of the manual, and it all makes sense to me. I must say that's quite cool.
    Then again. "Extreme simplicity" is everybodys goal at first. The real challenge is when you move out of the lab and into the real world. Without any keywords, I would fear that it's all too easy to get lost with something like io.

  5. #80
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mx2k
    i noticed what some are doing with objects in javascript as far as having their own namespace is something like following, keep in mind i'm using the prototype library and this example is for a lazy loaded class
    Quote Originally Posted by Ryan Wray
    Interesting. That is the great thing with JavaScript, there is alot of flexibility to pull off alot of functionality. All the same, a standard EMCAScript defined way of doing this would be much better.
    Quote Originally Posted by Ezku
    The only thing he seems to be using Prototype for is the constructor method "initialize". A plain JS solution wouldn't differ that much.
    I didn't catch this at first. Basically as Ezku says, this is vanilla javascript. MochiKit is a good example of how the technique is used. Every member in mochi is declared inside the window.MochiKit namespace, but then selected members are exported to the global scope. That way, you can use the shorthand-version as long as there are no nameclashes with other libraries, but should it ever happen, you can just use the fully qualified name instead. Internally, the full form is always used to ensure compatibility.

    dojo and jsan both provides some frameworky code to formalize this, but it really isn't needed - it's more a matter of convention.

  6. #81
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kyberfabrikken
    I didn't catch this at first. Basically as Ezku says, this is vanilla javascript. MochiKit is a good example of how the technique is used. Every member in mochi is declared inside the window.MochiKit namespace, but then selected members are exported to the global scope. That way, you can use the shorthand-version as long as there are no nameclashes with other libraries, but should it ever happen, you can just use the fully qualified name instead. Internally, the full form is always used to ensure compatibility.

    dojo and jsan both provides some frameworky code to formalize this, but it really isn't needed - it's more a matter of convention.

    so is moo fx and a couple of other libraries.

    acutally... Class.create() is also prototype as well and i had some other logic that i stripped out for the example in there.
    in the initialize ....
    Event.observe(body, 'load', this.preload.bindAsEventListener(this));

  7. #82
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Stekene, Belgium
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ryan Wray
    I also don't like how there is a headers_out property in the HttpRequest class (nitpicking! Also, why headers_out rather then headersOut, following the scheme of the rest of the properties).
    I'll change this in the next version. As a developer sometimes you don't see things, somebody else sees immediately.

    Quote Originally Posted by Ryan Wray
    Another thing that would probably bug me is the wx prefix to the names of general classes, for instance, wxFile.
    The wx-stuff is because wxJS uses wxWidgets. And it's also to be sure, that wxJS defines unique classes.

    Quote Originally Posted by Ryan Wray
    What I do like about the project that is it relatively new and clean and if thought out cleary it could turn into a very useful langauge. One important thing though is JS needs to get packages (or some sort of namespace support). At least then we can avoid many of PHP's problems.
    This will be added when SpiderMonkey supports packages/namespaces.

    The binaries of wxJS which are part of the download are windows-only. The source code is portable to other systems. I just don't have the time to build and test wxJS on other platforms. Everything is done in spare time. Is there someone interested in building wxJS one other platforms? Please let me now.

    If you have questions about wxJS, visit http://wxjs.sourceforge.net
    Good artists copy, great artists steal (Picasso)

  8. #83
    SitePoint Wizard Ren's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    1,060
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just thought I resurrect this, as noticed haxe ( http://www.haxe.org/ ) has just gone to its first release candidate.

    I think its could be a contender. Uses nekovm for the server side execution, but also can target flash/actionscript, or javascript (write once run anywhere anyone?

    Haven't tried todo anything in it yet. Has anyone else?

  9. #84
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face

    A bit more philosofic but it counts...

    1. Define Perfect
    2. Nothing is perfect
    3. Perfection is what keeps us from being creative in the first place
    4. Be creative
    5. It's the artist controlling the tools not the tools controlling the artist that creates something

    I'll leave it there...

    Edit:


    What the Haxe,.... looks nice
    Business as usual is off the menu folks, ...

  10. #85
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hAxe is interesting because it puts language-design capabilities into the hands of the end-programmer. As PHP programmers, we generally use PHP, but don't nescesarilly have a lot of insight or influence on the language engine itself. If haxe became a standard platform, all sorts of amateurs could conjure up their own implementation/variations of languages specific to a particular task. Much like people are now designing frameworks for PHP. That of course will bring a whole new load of problems along, but it's an interesting thought.

  11. #86
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ren
    Just thought I resurrect this, as noticed haxe ( http://www.haxe.org/ ) has just gone to its first release candidate.

    I think its could be a contender. Uses nekovm for the server side execution, but also can target flash/actionscript, or javascript (write once run anywhere anyone?
    Haxe doesn't seem too shabby at all. I browsed the language reference, and it seems to be a mix of C++ and Javascript: strongly C-fashioned syntax, optional type hinting, anonymous functions and objects - and it compiles into bytecode. Basically looks like a really intriguing choice for web development. A sort of framework is provided, with Http objects and such, but the actual application is entirely in the developers' hands - a bit like PHP indeed. I didn't quite grasp how support for Javascript et al. is exactly supposed to work, though.

  12. #87
    SitePoint Wizard Ren's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    1,060
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku
    Haxe doesn't seem too shabby at all. I browsed the language reference, and it seems to be a mix of C++ and Javascript: strongly C-fashioned syntax, optional type hinting, anonymous functions and objects - and it compiles into bytecode. Basically looks like a really intriguing choice for web development. A sort of framework is provided, with Http objects and such, but the actual application is entirely in the developers' hands - a bit like PHP indeed. I didn't quite grasp how support for Javascript et al. is exactly supposed to work, though.
    Yes, neko can JIT down to x86 too. Quite amusing that the jit compiler is actually written in neko too, which inspires confidence, imo.

    I think you can write code in haxe, then compile it with to target, js/swf/nekovm. So for instance if wanted todo client side validation, could presumably use the same haxe validation code thats used on the server, to generate the js. I think, got to find some time play


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •