Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
GNU is Not Unix Programming Software IT Technology

Pike 7.6 Released 67

An anonymous reader writes "Today version 7.6 of the Swedish programming language Pike was released. Some of the noteworthy additions are support for the Bittorrent protocol, the OBEX protocol (to communicate with cellular phones), IPv6, PGP and Bz2. If you want to beat the crap out of your Python/Perl program speedwise, try porting it to Pike..."
This discussion has been archived. No new comments can be posted.

Pike 7.6 Released

Comments Filter:
  • by Hanji ( 626246 ) on Wednesday May 05, 2004 @05:24PM (#9067682)
    How a Language can support the BitTorrent protocol.
    • For example, if Java supported BitTorrent, it could look like this:

      BitTorrent torrent = new BitTorrent();
      torrent.get("Star Wars Episode 3.avi"); ...
      • But that's not Java. That's a Java Library - pardon me class. And probably a package or two. In a strict sense, the Java language wouldn't change one iota if javax.bittorrent was added as a standard package.

        This really got to the heart of Sun's Vison of Java vs. Microsoft's Vision of Java. Microsoft looked at Java and said, "Nice Language," and proceeded to create wrappers for their Windows platform and called it a "Good Thing." Sun said, "A pox upon thee! For thou hast strip'd the soul from Java!" (

    • by Vaevictis666 ( 680137 ) on Wednesday May 05, 2004 @05:29PM (#9067721)
      BitTorrent support can be added as a module, built-in functions, etc.

      It's the same as how PHP supports the ftp protocol.

      • Built in functions maybe, just adding a lib that someone has written to talk to bittorrent and claiming the language now supports something which anyone could have written a lib for at any time is pretty lame imho.

        You could claim perl supports (take your pick, there is a prewritten module for EVERYTHING). But it would make more sense simply to say perl is a complete programming language (meaning if it's software, you can do it).
        • by Anonymous Coward
          The point isn't that anyone could have, but that someone actually did. Anyone could have discovered America, but it was Cristopher Columbus who did. :-)
        • I'd say it depends on context and packaging. If the basic distribution of the language includes a library for something, it makes sense to say that it's included in the language. If you have to download a separate library and install it to get the functionality, it doesn't make sense to say it's included in the language. With Perl, you can download a library supporting almost anything, but only a limited number of things are included in the standard distribution of Perl. It's all a matter of whether you c
      • by Anonymous Coward

        I had not known PHP supported the File Transfer Protocol protocol. FTP protocol transfers occur via your NIC card. I I wonder if that's the protocol used in ATM machines, you know, when you put your PIN number in?

    • That's simple. Here's an example:

      10 input $fname
      20 bittorrent $fname, "wares.exe"
      30 goto 10
  • How much faster? (Score:4, Interesting)

    by EnglishTim ( 9662 ) on Wednesday May 05, 2004 @05:29PM (#9067725)
    The poster implies that Pike is faster than perl and python, but by how much? A little extra speed does not in general outweigh the benefit you get from the large libraries that perl and python have.

    Why would someone want to use pike rather than a better-known langauge?
    • Re:How much faster? (Score:2, Informative)

      by mykdavies ( 1369 )
      The language shootout page [bagley.org] gives an idea - it's up there with Java!
      • Huh? Looks very mixed to me. looking at just a few examples, while it seems consistently better than perl (except in regexp, where perl is very fast), it's not up to java par.

        Looks like a minor speed increase to me.

        But then, I'm looking at a shootout from 2001. Have things changed?
        • Re:How much faster? (Score:3, Informative)

          by Anonymous Coward
          Things have changed quite a bit, still a bit behind java though (see this [dada.perl.it] more recent shoot out); OTOH I hear a *lot* has happened between 7.4 and 7.6.

          The biggest nicety with pike is not the speed though .. it's the way of writing code. It's just lovely.
        • Re:How much faster? (Score:1, Informative)

          by Anonymous Coward
          Rerunning parts of the shootout with recent versions of the most interesting languages gives this for me (do view source for proper formatting):

          row 1: ackermann 8
          row 2: ary3 7000
          row 3: fibo 32
          row 4: hash 1000000
          row 5: hash2 200
          row 6: heapsort 100000
          row 7: lists 128
          row 8: methcall 1000000
          row 9: nestedloop 20
          row 10: objinst 1000000
          row 11: random 1800000
          row 12: sieve 1000
          row 13: strcat 5000000

          Java PHP Perl Pike Python Ruby TCL
          1: 4.13 12.72 4.89 0.61 4.55 9.32 Failed (ackermann)
          2: 1.69 11.

          • Re:How much faster? (Score:5, Informative)

            by Anonymous Coward on Wednesday May 05, 2004 @07:14PM (#9068697)
            Rerunning parts of the shootout with recent versions of the most interesting languages gives this for me (do view source for proper formatting):

            row 1: ackermann 8
            row 2: ary3 7000
            row 3: fibo 32
            row 4: hash 1000000
            row 5: hash2 200
            row 6: heapsort 100000
            row 7: lists 128
            row 8: methcall 1000000
            row 9: nestedloop 20
            row 10: objinst 1000000
            row 11: random 1800000
            row 12: sieve 1000
            row 13: strcat 5000000

            Java PHP Perl Pike Python Ruby TCL
            1: 4.13 12.72 4.89 0.61 4.55 9.32 Failed (Ackermann)
            2: 1.69 11.87 4.85 1.38 3.06 8.61 14.88 (ary3)
            3: 2.90 12.09 6.69 1.44 4.27 6.96 11.57 (fibo)
            4: 6.85 5.92 5.57 4.71 3.69 17.90 7.83 (hash)
            5: 7.15 4.95 3.98 2.28 2.93 3.98 5.11 (hash2)
            6: 1.53 8.59 3.57 1.12 2.54 6.29 8.34 (heapsort)
            7: 5.54 Missing 3.21 2.76 2.06 2.43 27.30 (lists)
            8: 2.18 Missing 6.70 2.15 4.68 3.47 Missing (methcall)
            9: 7.30 Failed 17.92 0.90 13.52 35.70 34.25 (nestedloop)
            10: 3.65 Missing 13.08 3.34 5.68 6.19 Missing (objinst)
            11: 1.99 5.81 2.33 2.30 2.94 5.96 5.85 (random)
            12: 6.59 Failed 12.27 4.66 9.77 18.19 50.58 (sieve)
            13: 3.19 4.63 2.30 1.78 4.46 3.73 7.05 (strcat)
  • by TheRealFoxFire ( 523782 ) on Wednesday May 05, 2004 @05:33PM (#9067757)
    There is (or should be) a strong difference between a language and its libraries. Perl has done a poor job separating the two. Its nice to see Pike (or at least the poster) carry on that tradition.

    Contrast with C, Java, or Scheme.
    • Exactly how can you tell the difference between
      an intrinsic function and a library function in
      Scheme?

      I note that the Java language specification spends
      quite a few pages on defining the library routines
      which are required by the language.

      Likewise C has "standard library" functions which
      may be implemented by an external library or as
      intrinsics by a compiler.

      Why should there be a strong difference? Isn't
      extensibility a good thing?
      • Firstly, the library has nothing to do with extensibility. Extensibility is a property of the language which just means that the syntax and semantics make it easy to add new syntax or library functionality.

        Library functions are any which can be (but don't have to be) implemented in terms of other existing functions. As you note, the JLS specifies a bunch of primitive functions. These are the functions without which it would be difficult or impossible to write other Java programs.

        The problem with not ha
        • What the hell are you talking about?

          Perl, for example, whose language and syntax is frightingly complicated because of the inbreeding between language and library.

          Care to qualify that at all? How are perl libraries any different than in any other language? They don't alter the core language in any way(at least not without serious voodoo). In fact, perl 6 is going to allow libraries to introduce new syntax, which seems to contradict what you were saying about it.

    • by Anonymous Coward
      Like this, for example:

      private void
      show_user(int|string id, void|string full_name)
      {
      write("Id: " + id + "\n");
      if(full_name)
      write("Full name: " + full_name + "\n");
      }

      notice the first argument can be either a string OR an int - but nothing else. Sort of like limited generics.
  • by Anonymous Coward
    If you want to beat the crap out of your Python/Perl program speedwise, try porting it to Pike...

    Or use the Psyco [sourceforge.net] runtime compiler for Python. It gets to within 50% (or more) of the performance of C in many cases.
  • by mbadolato ( 105588 ) on Wednesday May 05, 2004 @05:55PM (#9067923)
    Ok, it's a Swedish programming language. Thus, I'm assuming that error handling consists of log entries reading "[Bork Bork Bork!!] Some error text here"
  • by Leif Stensson ( 777309 ) on Wednesday May 05, 2004 @06:28PM (#9068256)
    There is at least one more noteworthy addition in Pike 7.6: the support for the semantic web formats RDF and OWL.
  • kinda OT (Score:3, Insightful)

    by DrSkwid ( 118965 ) on Wednesday May 05, 2004 @07:03PM (#9068574) Journal

    having stuff supported at the programming level is stupid

    Whatever happened to 'everything is a file'

    Plan9's [bell-labs.com] user level file systems are far more suitable.

    One programs services to appear as file system in the process' namespace. The canonincal example of this is ftpfs [bell-labs.com] which presents a remote ftp server as part of one's local file system.

    By using this method, *no* programs need be compiled with knowledge of the ftp protocol and sockets nd the like. In fact it wouldn't even know it was talking with an ftp server.

    All services and devices are presented like this in plan9. Most things can be achieved with cats and echos.

    • Re:kinda OT (Score:4, Interesting)

      by LWATCDR ( 28044 ) on Wednesday May 05, 2004 @08:48PM (#9069422) Homepage Journal
      The question is that level of abstraction always a good thing? What about graphics? Is the display a file as well? sound? I admit Plan9 is interesting I will have to try it out in my free time :)

      • There are multiple interfaces to the graphics side.
        • The Screen memory is presented as a regular file for R/W
        • /dev/draw accepts drawing primitives via it's ctl file
        • using the calls directly from

        sound : cat soundmusic.pcm > /dev/audio

        what to know what the mouse is up to :
        cat /dev/mouse

        Anyway my point was that if one wrote a bit-torrent file system in plan9 then *every* programming language would suddenly have bit-torrent capabilities.

        It's all about 9p.

        I have python libs that can do 9p so it's not

        • couldn't this be added to say Linux with some device/file system drivers? It might make an interesting project.
          I wounder could you do a seek on a multimedia file to a timecode with that system? Or would you have to do a seek to a byte in the multimedia file to start it from a certian location?

          • reading and writing is by offset and count.

            Which also means that giant sparse files are trivial to implement.

            It's just a protocol for manipulating a file tree. A suprisingly simple concept that yields so much more than it sounds.

            • But is the offset and count also abstracted? For a multimedia file like audio or video the timecode would be a better metric than the byte count. I know this getting way off topic but I find it very interesting.
              • Here's the protocol

                http://plan9.bell-labs.com/sys/man/5/INDEX.html [bell-labs.com]

                one supplies an offset and count and the server returns whatever data it feels like.

                So yes, you are free to play games with the units be it bytes or timecode.

                one issues :
                size[4] Tread tag[2] fid[4] offset[8] count[4]

                and gets returned
                size[4] Rread tag[2] count[4] data[count]

                tag is an ID for this request, fid is an id for the file
                size is the packet size, the rest is the payload.

                The thing you would have to be careful of, though, is the

          • I should also mention that one *big* problem with backporting such a system is the division between user and kernel space.

            Unix is broken by design. The inventors themselves say so. They redesigned it to make hard things easy and plan9 [bell-labs.com] was born.

            Durable != optimal

    • BAD IDEA (Score:3, Insightful)

      by FAT_VIRGIN ( 775824 )

      Ever since the first networks, the "holy grail" of networking computing has been to provide a programming interface in which you can access remote resources the same way as you access local resources. The network becomes "transparent".

      One example of network transparency is the famous RPC [techtarget.com] (remote procedure call), a system designed so that you can call procedures (subroutines) running on another computer on the network exactly as if they were running on the local computer. An awful lot of energy went into th


      • you make some valid points for WANs

        but the constant gains outweigh the infrequent losses

        my LAN *is* always available

        single step debugging a broken process on a MIPS machine in NY from an x86 in Paris made possible by such things are such a gain that saying 'yeah but what about resume uploading eh, bet you hadn't though of that?' is a bit specious.

      • You could have just linked to Joel's rant [joelonsoftware.com] instead of copying it without attribution.

        Anyway, I think that the way to go is to make the standard local-file-access API more powerful. That way, you can still have a unified API. Which is why "FtpOpenFile" isn't the best way to go.

        And it doesn't necessarily have to be much harder to access local resources with the more powerful API. The common/simple cases can be streamlined. For example, language features like exceptions can let you ignore errors th

  • I think the syntax of Pike is rather nice. I might have to give it a whirl.
  • by osewa77 ( 603622 ) <naijasms@NOspaM.gmail.com> on Thursday May 06, 2004 @07:55AM (#9072065) Homepage
    What about simply using C++ or Java for the performance-intensive aspects?

The Tao is like a glob pattern: used but never used up. It is like the extern void: filled with infinite possibilities.

Working...