Slashdot Mirror


Pike Scripting Language

ulrikp writes "The vikings have done it again! The Swedes at Linköping University (home of the cool Lysator archives) have released a new version of their Pike scripting language. It is similar to C++ and C#, but is apparently more type-safe than either. It is interpreted, and runs on many OS's, including Linux, Solaris, and Windows. Check it out!"

56 comments

  1. I got your type safety right here, buddy. by Anonymous Coward · · Score: 0

    <sarcasm>
    More type-safe than C++? Why, that hardly seems possible!!!
    </sarcasm>

  2. LP-MUD strikes back by Jouni · · Score: 5, Informative
    Just a bit of trivia; the Pike language is based on LPC which was the language designed to drive LP-MUDs, after its creator Lars Pensjö. The language is easy to pick up and robust - I like to think of it like object oriented C with better string handling.

    The MUD systems built with the language are very interesting as well; they generally have a central "game driver" object that handles the game objects and their heart beats with an internal call queue approach. This was guaranteed to keep the world and objects "live" at all time even if some of them failed. It was very common to have new areas being built on MUDs while the game was running, new objects being coded and recompiled on the fly.

    Most of the MMORPG games built today have nowhere near this level of sophistication that MUDs reached back in the 80's. Maybe some of them would do well to look at Pike. :-)

    Welcome back, LPC! We missed you!

    Jouni

    --
    Jouni Mannonen | Game Designer, Consultant
  3. Re:Check the license! by Pathwalker · · Score: 3, Insightful

    So being able to take your pick of the GPL, LGPL, and MPL is not free enough for you?

  4. great looking website by josephgrossberg · · Score: 1

    Why can't Python.Org look as clean and well-designed, instead of something circa-1995?

    Maybe that's why we can't get a damn Slashdot icon.

    1. Re:great looking website by greenhide · · Score: 2

      Yeah, but check out the University's webpage! Maybe it's just my browser (Chimera), but the text is so small, it's unreadable!

      --
      Karma: Chevy Kavalierma.
    2. Re:great looking website by josephgrossberg · · Score: 1

      No, it is your browser. And mine too (Phoenix). :(

      I launched MSIE and the text looks significantly bigger (at least two points, probably more).

      I've noticed that, much to my frustration, IE and Mozilla have different interpretations of the very specific "font-size: 10pt ;" attribute in the CSS.

    3. Re:great looking website by Anonymous Coward · · Score: 0

      Which is why only a fool uses point measurements. Pixel sizes specifications are superior.

    4. Re:great looking website by Anonymous Coward · · Score: 0

      The mozilla developers seem to have problems with interpreting point sizes, particularly on X displays. X lets programs query the physical size of the display (it's Dots-Per-Inch). Mozilla seems to disregard the info most of the time, maybe depending on some compile-time switch or something - My display is 120 DPI, X reports it as 120 DPI, ghostcript and the GIMP both recognise it as 120 DPI - but mozilla-on-X seems to assume it is 75 DPI. Leading to teeny-tiny font disease. Aargh.

    5. Re:great looking website by pastorBernie · · Score: 0

      Actually, you are wrong. Usuability experts all agree to NOT use pixel based font sizes. GO look it up.

  5. Am I missing something in the title of this. by Neck_of_the_Woods · · Score: 1, Offtopic


    Mod -1 offtopic, but the Vikings are from Norway not Sweden right? Someone please correct me.

    --
    Neck_of_the_Woods
    #/usr/local/surf/glassy/overhead
    1. Re:Am I missing something in the title of this. by wilhelm9 · · Score: 2, Informative

      The vikings originated from the entire scandinavian peninsula including Denmark. The difference is that the eastern vikings mostly traded eastwards on the rivers of todays Russia, while the the vikings from todays Norway travelled westward on the Atlantic Ocean.

    2. Re:Am I missing something in the title of this. by Neck_of_the_Woods · · Score: 2


      Sweet, thanks for the clarification.

      --
      Neck_of_the_Woods
      #/usr/local/surf/glassy/overhead
    3. Re:Am I missing something in the title of this. by Anonymous Coward · · Score: 0

      While a bit off topic, a tenth century Viking could watch the evening news in Iceland and understand every bit.

    4. Re:Am I missing something in the title of this. by Hognoxious · · Score: 1

      While a bit off topic, a tenth century Viking could watch the evening news in Iceland and understand every bit.

      Even if a mormon fundamentalist used a shoulder launched missile to bring down an airliner, which crashed on a motorway and caused tailbacks of cars several kilometers long?

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  6. Faster than ever! by Pathwalker · · Score: 4, Interesting
    For me, the big improvement is this:
    On systems with IA32, SPARC or PPC32 processors Pike can use native machine code as byte code. This byte code can then be executed directly outside the virtual machine and give a ~30% performance boost compared to the old byte code.


    Hopefully the last few bits of code in Roxen 3.3 that keep it on Pike 7.2 should be cleaned up soon. The last time I tried running the CVS version of Roxen on Pike 7.4, I only had problems with logging.
    1. Re:Faster than ever! by peter+hoffman · · Score: 2

      There's also Caudium which is a fork of the Roxen 1.3 code base. Version 1.3 runs with Pike 7.4.

      Anyone who likes AOLserver but not Tcl should look at Roxen (and/or Caudium) as they are both single process multi-threaded web servers with built-in scripting.

  7. Re:Check the license! by 0x69 · · Score: 1, Troll

    Before anybody gets too excited, check up on this RMS guy. I've talked to him, and he stupidly refuses to assign all his (now blatently UNfree) property and rights to my truly free Stalin Free Society. I recommend that you use only free SFS-owned & -approved languages, not his slaveware.

    --
    It's easy to make up & spread cool- and credible-sounding stuff. Finding & checking hard facts is hard work.
  8. Excellent Mwhaha ;x by pr0c · · Score: 1

    I love c#, i hate microsoft.. there is a dilema(sp?) there.

    Now i can use something as easy as c# and be more and more m$ free.

    I love the mono project (http://www.go-mono.com) but we all know sooner or later m$ is going to blow them out of the water in court :(

    This is so similar to c#! I love it. C++ and C are too time consuming, Java blows ass, c# is a happy medium. C# is the perfect mix of RAD and Power IMHO.

    1. Re:Excellent Mwhaha ;x by ++good-duckspeak · · Score: 2, Funny
      This is so similar to c#! I love it. C++ and C are too time consuming, Java blows ass, c# is a happy medium. C# is the perfect mix of RAD and Power IMHO.

      Way to be insensitive. Some of us have no choice but to use C. I've heard conditions at other shops are so bad that the developers are forced to use Java.

      --
      Why is Triangle Man so MEAN?
    2. Re:Excellent Mwhaha ;x by torpor · · Score: 2

      Hey man, back off on C.

      --
      ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
  9. Never ceases to amaze me... by runswithd6s · · Score: 2

    ...the variants of programming languages available to us. Just when you think you've got your "favorite" language pegged, along comes another to tempt and tease you. Just check out the dmoz.org site out for a list of programming languages. It's nuts!

    --
    assert(expired(knowledge)); /* core dump */
    1. Re:Never ceases to amaze me... by Tablizer · · Score: 2, Interesting

      ...the variants of programming languages available to us. Just when you think you've got your "favorite" language pegged, along comes another to tempt and tease you.

      I think the problem is that everybody has their own preferences which no one language can match (it is a combinatorial problem). Thus, they make their own. I once set out to document most of the key decisions in building a scripting language. Of course I have my own pet draft language also :-)

      I wonder if it would be possible to set a bunch of option switches/selectors based on the possible features like those in the above link, and one can then make themselves a language close to their heart just by setting parameters. IOW, a fully configurable interpreter. Now *that* would be an impressive programming feat.

    2. Re:Never ceases to amaze me... by truth_revealed · · Score: 1

      That's a great language features decision article you wrote. They were exactly the issues I faced when designing an interpreted language. I came to the conclusion that there was little point in creating one (except for interest's sake) because thousands had trod down that road before me making the same mistakes, and probably better designs in the end. In the end it is just a matter of syntactic preference.
      PHP is interesting because it has the syntax of javascript and the $variable syntax of perl/shell scripts. When you live inside quotes as often as you do in PHP the $variable style is often preferable and results in less typing. I had not considered a hybrid approach as you offered in your article: use the dollar variable prefix inside of quotes and drop the dollar variable prefix outside of quotes. Great idea.

  10. Gartuitous, annoying differences by pauljlucas · · Score: 2
    After browsing the documentation, there seem to be several gratuitous differences. One of the most annoying I came across is the meaning of "static" for a class:
    This means that this member variable or method is only available to methods in the same class, and in subclasses (static in Pike does not at all mean the same thing as static in C++. Instead, it is similar to protected in C++.)
    So why not use protected and spare developers the confusion? Differences just to make your language different are bad.
    --
    If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
    1. Re:Gartuitous, annoying differences by __past__ · · Score: 2

      With wich of the 193 meanings of "static" in C++ would you expect it to be consistent?

    2. Re:Gartuitous, annoying differences by pauljlucas · · Score: 2

      Learn to read: I said that protected should have been used instead of static, i.e., that protected should be consistent. There is only one meaning for protected

      --
      If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
    3. Re:Gartuitous, annoying differences by Anonymous Coward · · Score: 0

      This language is older than java. (Much older, in fact) . "protected" is a new usage that java weenies invented, along with "interface" and "package".

    4. Re:Gartuitous, annoying differences by Anonymous Coward · · Score: 1, Interesting

      There was actually a discussion before the release about if the path to deprecating "static" should be initiated in this release. We ran out of time, so we didn't, but in the next release you'll probably get a warning if you use "static" instead of "protected". The latter has been a reserved key word for quite some time.

    5. Re:Gartuitous, annoying differences by larry+bagina · · Score: 1

      only problem is, the discussion was protected vs static in C++, which is older than java. C has had the "static" qualifier since the 70s, and Objetive C and C++ had the protected qualifier years ago.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    6. Re:Gartuitous, annoying differences by grubba · · Score: 2, Informative

      The reason is historical. The static keyword was inherited from C at a time when there was a one class/file limitation in the compiler. The interpretation was then similar to the interpretation of static for global symbols in object files.


      NB: It wasn't until late 1996 there was a syntax in Pike for having multiple classes/file.

    7. Re:Gartuitous, annoying differences by Salamander · · Score: 2

      Lighten up. The grandparent was at least half a joke, and I - like anyone who has grumbled in the past about C/C++/Java's overloading of one reserved word to mean many different things - found it pretty amusing.

      There is only one meaning for protected

      Really? Consider the following:

      class foo: protected bar {
      protected:
      int ugh;
      };

      Note how the two occurrences of "protected" don't have anything like the same meaning. As I just said, this overloading of reserved words is annoying, and deserves to be made fun of.

      --
      Slashdot - News for Herds. Stuff that Splatters.
    8. Re:Gartuitous, annoying differences by pauljlucas · · Score: 2
      Note how the two occurrences of "protected" don't have anything like the same meaning.
      They mean exactly the same thing. Go read a C++ book.
      --
      If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
    9. Re:Gartuitous, annoying differences by Salamander · · Score: 2

      Piss off. I've read 'em, they say exactly the opposite of what you're saying. You're just one of those people who can never admit you're wrong.

      --
      Slashdot - News for Herds. Stuff that Splatters.
    10. Re:Gartuitous, annoying differences by pauljlucas · · Score: 2
      I've read 'em, they say exactly the opposite of what you're saying.
      Then either (a) you've been reading the wrong thing or (b) you don't understand what you're reading.
      You're just one of those people who can never admit you're wrong.
      I do admit when I'm wrong, but I'm not wrong in this instance.

      protected means that only derived classes have access. Protected inheritance means that only derived classes can do the conversion from derived to base class, i.e., they have knowledge of the inheritance and, to them, it's treaded just like public cinheritance.

      Protected data members or members functions means that only derived classes can use them.

      Hence, protected means exactly what I said: only derived classes have access, i.e., one meaning of protected.

      Sorry if you don't understand the answer, but that is the answer. Your understanding is not required for it to be correct.

      --
      If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
  11. Ruined yet? by mechugena · · Score: 1


    So, when does MS Pike come out?

    1. Re:Ruined yet? by Anonymous Coward · · Score: 0

      It's already out under the name C#. It is not as fast and has less fun features, but it is "designed" and has more advertizing.

  12. looks fine in linux mozilla by Anonymous Coward · · Score: 0

    .... no small size or anything ... In Preferences/Appearance/Fonts ... set the minimum size and you won't be disappointed :-)

  13. Haven't seen this question by Quill_28 · · Score: 2

    Why would I want to use Pike?

    It's fast(for scripting language)
    It's OOP's.
    It's multi-platform.

    Anything else?

    Does it excel at any one area or is it just better(why?) than the other scripting language out there.

    Or was this just a college project and they wanted to share?

    Not trying to troll here, just curious

    1. Re:Haven't seen this question by Anonymous Coward · · Score: 0

      This is an old project that has had at least one full time developer working on it for the last six years. Since development begun so far back it tries to solve the same problems as langauges of the same age (java, perl, python), ie. to be a general purpose programming language. It is however closer to java in its ambition to be a "real" programming language.

      It is of course hard to categorize a general purpose programming language, but if I should pick one area it excels in it would be speed. It is one of the fastest, if not the fastest, non-compiled (general purpose) language. It also takes less time to code in than java (the source code is about about half the size once I converted a Java program into Pike).

    2. Re:Haven't seen this question by wsapplegate · · Score: 0, Offtopic
      > Why would I want to use Pike?

      Simple ! You obviously *definitely* want to run a programming language with classes such as :

      String.Elite
      Contains methods that transfer ordinary readable text into leet-speak. A fairly good argument could be laid out for putting this in Crypto as a one way cipher...

      (sorry, I couldn't resist. It's just too darn funny ;-)
      --
      Xenu brings order!
    3. Re:Haven't seen this question by Quill_28 · · Score: 1

      OK that's pretty funny. Thanks for the tip!

    4. Re:Haven't seen this question by eMBee · · Score: 3, Interesting
      it is typed.

      i don't think any other scripting language offers type checking.


      greetings, eMBee.

      --
      Gnu is Not Unix / Linux Is Not UniX
    5. Re:Haven't seen this question by AtATaddict · · Score: 1

      Perl6 will, and it should be able to match Pike's features via quantum superpositions.

      Though some might argue that in a well-behaved program, typing a variable as any one of a selection of types should either be accomplished using a single "parent" or "base" class, or should not be done at all.

  14. Re:Check the license! by JohnnyBigodes · · Score: 0, Redundant

    But does anyone listen to what RMS screams about anymore? Geez...

  15. Pike on Cygwin? by truth_revealed · · Score: 2, Informative

    I can build and run Pike okay on Linux, but building on Cygwin complains about unresolved externals (shmget and other shm* functions). I then #undef'd the appropriate code in memory.c to disable shared memory support, and re-make. Pike.exe appears to link without errors or warnings but the final pike.exe is not functional. All pike scripts appear to run, but do nothing and print no error but the shell returns "10" when queried via echo "$?".
    Any ideas?
    Is Pike supported on Cygwin?

    1. Re:Pike on Cygwin? by grubba · · Score: 1

      Building Pike on Cygwin is not (yet) supported as can be seen in Pikefarm.

      Currently the only supported way of building Pike on WIN32/WIN64 systems is through rntcl.
      Hmm... It does however seem like nobody has released such a binary yet.

    2. Re:Pike on Cygwin? by truth_revealed · · Score: 2

      Thanks for the info. The Pike platform build success grid does not look very encouraging for platforms other than IA32 Linux. Too bad - Pike is an excellent language - much better and faster than any interpreted C-like language I have used. Pike also appears to be roughly 2 to 4 times faster than Perl 5.x and all free ECMAScript implementations. I'm a Pike convert. I'll hack on Pike under Cygwin disabling stuff until it works. I suspect that disabling native code generation might do the trick.

    3. Re:Pike on Cygwin? by Anonymous Coward · · Score: 0

      The Pikefarm success grid is not that bad if you take a closer look at what actually breaks on various platforms.

    4. Re:Pike on Cygwin? by grubba · · Score: 1

      True.

      The current status is:
      Successful builds on:

      • AIX/POWER
      • AIX/IA64
      • FreeBSD/IA32
      • HPUX/HPPA
      • IRIX/MIPS
      • Linux/Alpha
      • Linux/IA32
      • Linux/IA64
      • Linux/PPC
      • NetBSD/Sparc
      • Solaris 8/Sparc V8
      • Solaris 9/Sparc V9
      • WIN32/IA32
      • WIN64/IA64

      Failures were noted for the following reasons:

      • AIX: Breakage due to running out of memory on an old machine.
      • Darwin: Thread library has problems with spawning processes from multiple threads at once.
      • FreeBSD: mktime() is offset by 3600 seconds.
      • HPUX: Problem loading dynamic modules when compiled with cc.
      • IRIX: Problem building the GL module when compiling with cc.
      • Linux/IA64: The colortable fails to find all colors sometimes.
      • OSF/1: The Java module doesn't support calling native functions.
      • OSF/1: cc doesn't like the gmp library.
      • Solaris 9: The Java module runs out of memory.
      • WIN32: Problem loading dynamic modules.

      So I wouldn't say that it only works on Linux/IA32...

    5. Re:Pike on Cygwin? by truth_revealed · · Score: 1

      I stand corrected based on your clarification of platform support.
      Is there a simple way to build a stripped down minimalistic Pike without modules/threads/shmem/java etc?
      Also may I ask what compiler is this "rntcl"? (from "Windows_NT 4.0 x86 CC=rntcl)
      I can't find anything about this compiler on Google except for Pike references.
      Is "rntcl" a commercial compiler?

    6. Re:Pike on Cygwin? by grubba · · Score: 1

      Most modules can be disabled by specifying --without-xxxx to configure. configure --help will list many of the supported flags. Some module specific options may however not be listed.

      rntcl is an abbreviation of Remote NT CL (cl is M$'s compiler). rntcl works by controlling an NT machine through sprsh (Simple Pike Remote SHell) from a Unix machine.

      Example:
      $ src/Pike/nt-tools/init_nt
      Using rc-file /home/grubba/.init_ntrc
      We are not Hubbe.
      NT kali $ uname -a
      Windows_NT kali 4.0 x86
      NT kali $ cd src/Pike/7.5/build/NT/
      NT kali $ ls -lF pike pike.exe
      -rwxr-xr-x 1 grubba grubba 315 Dec 27 12:01 pike*
      -rwxr--r-- 1 grubba grubba 6239657 Dec 27 12:01 pike.exe*
      NT kali $ cat pike
      #!/usr/local/bin/pike
      inherit "/home/grubba/src/Pike/nt-tools/tools/lib.pike";
      int main(int argc, array(string) argv) {
      if (lower_case(getenv("CROSSCOMPILING")||"no") != "no")
      exit(1);
      argv[0]=getenv("NTDRIVE")+fixpath(follow_symlinks( combine_path(getcwd(),argv[0]))+".exe");
      exit(silent_do_cmd(argv));
      }

      The sprsh system makes it possible to compile, link and run binaries on the remote NT system, but still have access to the full set of UNIX commands.

  16. Pike and Mac OS X by AtATaddict · · Score: 1

    Has anyone had luck getting Pike installed on Mac OS X(10.1.x)/Darwin(1.4)?

    1. Re:Pike and Mac OS X by grubba · · Score: 1

      Pike 7.4 seems to compile and link fine on Darwin 6.3 according to Pikefarm.
      It also almost passes the testsuite, except for a 2 second sleep that slept 2.12 seconds (which may be due to load on the test machine).
      I don't know of any reason why it wouldn't work fine on Darwin 1.4.

    2. Re:Pike and Mac OS X by AtATaddict · · Score: 1

      Well, it doesn't seem to be able to find GMP with the standard Dev Tools installed. Downloading GMP from the GNU site, and building and installing it seems to have eliminated the problem, though it occasionally gets a few warnings.

  17. custom php programming and web development scripts by chrisranjana.com · · Score: 1

    php cannot be pike
    and pike cannot be php

    --
    Chris ,
    Php Programmers.