Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Thoughts On The Pike Programming Language? 235

bilboyablan asks: "Ive stumbled upon the Roxen Web server , mostly implemented in the Pike programming language. I got curious about Roxen, but even more about Pike, and it seems to me like a quite solid scripting OO language, with a C-like syntax, and with a quite good documentation (user manual) to boot. So it seems intriguing to me why Pike hasnt gotten a wider acceptance. So, if some of you fellow Slashdotters have had any experience with Pike (outside of Roxen), could you maybe drop a few lines on it? "
This discussion has been archived. No new comments can be posted.

Thoughts on the Pike Programming Language?

Comments Filter:
  • Ok, moment of honesty: I've never heard of it. Could someone please post some information? Or some urls? Any alternative to perl (which I DO use a lot and appreciate, but. . .) would be most welcome.

    -S

    http://students.washington.edu/steve0/ [washington.edu]
    steve0@u.washington.edu
  • by moibus ( 77968 ) on Saturday June 03, 2000 @11:32AM (#1027659) Homepage
    Pike has Gtk bindings too and my (limited) experience with them has been good. Seems like a pretty cool language. There's a good Pike resource site at http://www.pike-community.org/ [pike-community.org].
  • Sure it's decent, but what does it have that's special? Learning any new language is a significant investiture of resources and time, and if there's nothing special about it, why spend the time? Might as well spend the time learning something new that you know is "bankable".
  • i've used pike quite a bit since i first discovered it. its great-- support for many platforms, better OO than any other scripting language, pretty strong threading support-- and i wouldnt hesitate to recommend it, especially to those comfortable with C.
  • by 575 ( 195442 ) on Saturday June 03, 2000 @11:34AM (#1027662) Journal
    Hark, one more language
    A powerful new system
    Named after a fish
  • According to the pike web site, it is a high-level interpreted language, syntax similar to C, and has an "image processing module" capable of producing anti-aliased text and can do other drawing operations (image scaling, etc). It has a crypto toolkit and can interface with SQL databases. It's even GPL'd and works on quite a few different platforms. Looks like it's from Sweden.

    Sounds pretty cool to me.

  • That's a bad haiku
    You forgot that a pike could
    also be a stick
  • As stupid as this sounds, not having windows support that's readily available in the form of a downloadable binary is a big blow to the language. (actually, last I checked a while back, not even the source was officially supported ... I haven't tried compiling with Cygwin / GCC.)

    Sure, we're talking about the OS from hell created by Satan himself here, but since it's widely used, not supporting it well bites ya.

  • by ZxCv ( 6138 )
    Pike is definitely a very good alternative to Perl-- much better OO, socket support, (easy) threading, support for a good number of platforms, and IMHO is easier to pick up than Perl. I think the homepage is at http://pike.idonex.se, but I know its on Freshmeat too.

  • I don't like Pike, but I definitely like the Roxen Webserver. It is also GPL, and I use it as much as I can. Roxen supports PHP4 now, and I like that better for web development.
  • I played around with Pike for a while, and my gripe with it is that it is too C-like. At least what I want out of scripting language is a high-level environment like Perl or Python. Of course, horses for courses.
  • Object Orient
    You, too, can program in Pike
    Its not just a stick
  • by roman_mir ( 125474 ) on Saturday June 03, 2000 @11:46AM (#1027670) Homepage Journal
    When C was introduced it quickly won the hearts of computer programmers as a high level language that still feels like a low level one (close to Assembler memory management.) It was not like Fortran, Ada or Basic, it allowed something that was never there before C. We have C++ that can do all that C does, we have Python and Perl that can do somethings in more convenient ways, there is Java and VB etc.
    How easy is it to introduce a new language that will catch up with the masses? Java and Python are good examples of such languages. Java allowed many programmers do what C++ does in the sence of OO but easier to learn, Python has the power of Perl plus it allows use of other language libraries. These are clearly improvements (no I am not saying Java is better than C++, I am saying there was (is) a market for this language for those who want some (not all) power of C++ and they want it fast and easy to learn).

    Maybe in order for a language to become widely accepted it must present something new from marketing point of view not only from functional point of view.
    Still it is not impossible that pike will find its own audience. How many of you use ML, Prolog, Lisp or Scheme in your everyday life? But these languages have their own purpose, their own market niche, mainly AI R&D.
    If Pike has something new to offer, it'll be used.
  • by ZxCv ( 6138 ) on Saturday June 03, 2000 @11:46AM (#1027671) Homepage
    There is a Win32 binary download right there on the Pike download page. Granted, the install process wasn't your typical windows GUI install, but was nonetheless painless and simple. Good thing you checked it out before you said something.
  • by IronGorilla ( 77885 ) on Saturday June 03, 2000 @11:48AM (#1027672) Homepage
    The world's largest amateur fantasy and sci fi art/writing site is powered by it. Every page is automatically generated by pike whenever one of the thousands of artists on board update their page. The URL is http://elfwood.lysator.liu.se [lysator.liu.se] and yes, I'm a member (though my gallery shall remain anonymous as my intention here is not to plug myself though I will say I joined when there was less than 100 people involved) and a voulentier staff member on the webpage.

    I'm not sure, but I THINK that Roxen and Pike were created at the Lysator computer club at Linkopeg university in Sweeden, who as you can see in the above link, are hosting Elfwood. The URL for the Lysator computer club is http://www.lysator.liu.se [lysator.liu.se] Of course, there's a high probability of me being wrong about that being where Roxen and pike came from.. but I seem to remember that's what someone told me.

  • proper haiku should
    only have four syllables
    in the last line
  • A starship captain A good programming language Straight ahead, warp five

    --
    It's a fine line between trolling and karma-whoring... and I think I just crossed it.
    - Sean
  • by moibus ( 77968 ) on Saturday June 03, 2000 @11:52AM (#1027675) Homepage
    How will you know until you investigate? It used to be that only M$ was "bankable" in terms of OSes. I'd hate to think what would have happened if noone just went and played with new stuff. Seems to me that an OO C-like scripting language with Gtk and lots of other bindings and modules is pretty interesting at least on the surface.

    Python offers alot of OO features but has a limitation I can't deal with: it considers indentation as syntax. Pike might make a better language for OO scripting than Python given its syntax.

    The point is that it's worth looking at and that innovation and new ideas, even if they turn out to be lame, shouldn't be swept under the carpet because "we've already got one of those." I would much rather see a discussion of the actual features of the language than questions like "what's the point?"

    (BTW I have no interest in Pike other than it looks pretty interesting and appears to already have alot of useful features)

  • by roman_mir ( 125474 ) on Saturday June 03, 2000 @11:54AM (#1027676) Homepage Journal
    well that is a strange statement. Most script languages are hard to use for those who do not know how to use them.
    Here is another one: Unix IS user-friendly, it just chooses its friends very carefully.

    Why are scripting languages hard to use? I use sh, csh, ksh, awk, sed, Perl, Python, jsp, asp and even Dos batch files in primitive basic. What is so hard about 'em?

    Translated languages under Unix/Linux have the same precedence level as compiled binaries (under DOS bat files are secondary). Translated languages don't even have to be compiled! It is true that I have not seing a good IDE for awk or csh but it does not mean the language is bad.
  • doh, I was wrong. never mind
  • Jeez, chill. I said _last I checked_.
  • Wow! Look at this: it's a new programming language! Gosh, it looks like Perl, smells like perl, feels like perl...

    Only without the years of development, the thousands of freely available modules [cpan.org], the extreme flexibility, the massive cross-platform portability (you can configure perl for your toaster), integration with Apache [apache.org], Database support, tens of thousands of existing experts and freely available sample scripts, a huge set of some of the world's best programming language documentation [oreilly.com], and (let's not forget) its own poetry [itknowledge.com] (what other language can claim that?), having the core built by one of the coolest people on earth [wall.org] (read and laugh! [perl.com]).

    Maybe Pike is amusing, but next to a language like Perl, is it really needed? And can you really claim that Pike has "character" when you can't even write poetry? (Yes, I am a Perl bigot.)

    BTW, Hello world in perl? perl -e 'print "hello, world\n";' on the command line will do the trick. Ha!

    David E. Weekly [weekly.org]


  • Not just fish [wisc.edu] or sticks [hat.com].
    There are brilliant people [bell-labs.com] too,
    from which this name comes.

  • It's reminiscent of LPC, the language found in the popular line of mud known as LP. I would not be surprised if it was based on LPC.
  • I just double checked and Lysator is, in fact, where Roxen and Pike originated from, according to this page, [lysator.liu.se] though its exact words in regards to Roxen are "developed mostly by Lysator members."

  • by webrunner ( 108849 ) on Saturday June 03, 2000 @12:13PM (#1027683) Homepage Journal
    this is a bad haiku
    about pike because it doesnt follow the haiku syntax
    at all.

    ----
    Oh my god, Bear is driving! How can this be?
  • Thinking of Christopher? He's only make-believe.

  • Not just fish [wisc.edu] or sticks [hat.com].
    There are brilliant people [bell-labs.com]
    from which this name comes.

    it would help if i actually knew how to talk...


  • yeah, yeah :P i pronounced brilliant wrong, so sue me.
  • Thanks! -S

    http://students.washington.edu/steve0/ [washington.edu]
    steve0@u.washington.edu
  • Good spotting. :) Pike was developed by the Lysator member Fredrik Hubinette who were and is
    a whizard on LPC programming. If I remeber it right its first name was micro-LPC.
  • Maybe Pike is amusing, but next to a language like Perl, is it really needed?

    Yes. Even if Perl wasn't a horribly designed language (to the extent that it was designed at all) with so many inherent flaws that it's amazing it gets used at all, much less commands the popular acclaim it gets. BASIC and COBOL are better-designed languages than Perl.

    But Perl's enormous set of weak points aside, a diversity of tools is always a good thing. Not only do different languages and design methodologies have differing strengths suited to different problems, but a wider variety of tools better suits the variety of personalities among developers.

    God forbid we ever end up in a world in which platform/language/methodology partisans have locked up all progress because their sacred cow is "good enough" or because of a misguided belief in portability. It only sounds good until the faddish wave of popularity you're riding has passed; other people's monochromatic fantasies are rarely as appealing.

    If I was in charge, everyone would use ANSI C under some variety of Unix, and eschew all interpreted languages, object-orientation, and GUIs. Be as glad that I am not in charge as I am that you are not.

    Moral: If it makes sense in biological evolution, it probably does in software as well. Diversity is a good thing.
  • Wailing horrid pain
    Torture, agony, and grief
    Files scream, deleted
  • I remember Pike
    He had a light bulb only
    To flash yes or no
  • Last line's 6 syllables.
    --


    "One World, one Web, one Program" - Microsoft promotional ad

  • wtf is the deal with all these Haikus? I don't know about anyone else, but I'm already sick of them. It seems every article has at least 4 or 5 haikus moderated up as funny? Anyway, just had to get that off my chest.
    -Mike Bell
  • Different that CLIPS?

    I looked at the links and also checked through Google, but from what I can see it's very similar to CLIPS, moreso than PERL.

  • thanks, I guess I have fans?

    Kirk
  • The whole thing sounds fishy to me

  • Well, It does not look like perl, it does not smell like perl, and it does most definately not feel like perl.

    Actually, it's about as different from perl as a scripting language can possible be.

    And pike has quite good documentation, actually. See the tutorial [roxen.com] as an example.

    And hello world in pike: pike -e 'write("hello, world\n");' which is actually exactly the same size as your perl example...

    Btw, hello world in a window in pike:

    pike -e 'GTK.setup_gtk();
    GTK.Window( GTK.WindowToplevel )
    ->add( GTK.Label( "Hello world\n") )
    ->show_all();
    GTK.main();'

    And hello world written with a TTF font in a window:

    pike -e 'GTK.setup_gtk();
    GTK.Window( GTK.WindowToplevel )->
    add( GTK.Pixmap( GDK.Pixmap( Image.TTF( "foo.ttf" )()
    ->write("Hello World" ) ) ) )
    ->show_all();
    GTK.main();'

  • Wakko cannot count.
    Used his two hands and two thumbs.
    Not enough fingers.
  • UNIX is NOT user friendly if you don't do the things that UNIX doesn't like. Windows is not friendly if you don't do the things that Windows doesn't like. If rm -rf * is your style, the UNIX is your game. If right-click->Delete is your style, then BeOS is your bag. Windows is only your bag if you need to run a program. If you're running a server, good luck if you try to do it in windows. If your running a desktop, god help you if you try to run it on UNIX. I am quite experianced with Linux, but it still amazes me how much crap I have to put up with to do simple desktop things like install a new 3D card driver. (I'm not kidding by the way, it is ridiculously easy in Windows. More so in BeOS where the system automatically installs drivers.) Of course I've dabbled in networking, and am amazed at how easy UNIX makes it.
  • How easy is it to introduce a new language that will catch up with the masses?

    I wish it was harder. So many languages today claim to be "easier to learn than C", but that appears to be their only advantage. Once one learns to program, what good is such a language?

  • by 575 ( 195442 ) on Saturday June 03, 2000 @01:20PM (#1027706) Journal
    There once was an impatient poster
    He cried out "That haiku's not kosher!"
    The rest of us pounced
    His poor ego was trounced
    Maybe next time he'll look a bit closer
  • by weisserw ( 121896 ) on Saturday June 03, 2000 @01:24PM (#1027708)
    From "On Lisp" by Paul Graham:

    "Not so long ago, if you asked what Lisp was for, many people would have answered 'for artificial intelligence.' In fact, the association between Lisp and AI is just an accident of history. Lisp was invented by John McCarthy, who also invented the term 'artificial intelligence.' His students and colleagues wrote their programs in Lisp, and so it began to be spoken of as an AI language. This line was taken up and repeated so often during the brief AI boom in the 1980's that it became almost an institution."

    The truth is that Lisp (and its dialects) is an extraordinarily versatile and powerful language. It is suitable for just about anything, including operating system design (people have and are still writing great operating systems in lisp) and application programming (emacs anyone?), especially involving embedded scripting languages. The features which make Lisp unique (first class functions, lexical closures, powerful macros, etc. etc.) also make it able to adapt to practically any problem in computer science and solve it both elegantly and efficiently.

    Perhaps more than any other language, Lisp has taken a bad rap as of late, usually by people who haven't put any effort into learning it, or worse yet, people who have never tried it at all. I challenge those of you who took Lisp for granted as some sort of "AI language" to actually try it for yourself. At first you may find it awkward to adapt to Lisp's style of programming, but eventually you'll come to realize that the reason you felt awkward was because what you were doing before was not a very good method of programming or problem solving in general.

    -W.W.
  • Where are closures?

    If you wonder why I mention them, then you have never tried functional programming techniques.

    Regards,
    Ben
  • Step 1. Flip on ESPN2.

    Step 2. Watch NASCAR race.

    Step 3. Notice how moronic announcer pronounces "tire" or "oil".

    Step 4. Note to self how words that people using a more common English dialect pronounce with two syllables can in some dialects be pronounced as one.

    Step 5. Apply to Haiku in question.
  • by tilly ( 7530 ) on Saturday June 03, 2000 @01:59PM (#1027717)
    Trifles make perfection, and perfection is no trifle. -- Michelangelo

    Lambda expressions ain't closures.

    Tom Christiansen recently made the very interesting point that any programmer who has not been exposed to all of the imperative, objective, functional, and logical styles has one or more conceptual blind spots. In his words, "It is like knowing how to boil but not to fry. Programming is not something you master in 5 easy steps."

    Perl smoothly supports building real system in any and all combinations of those programming styles. This is no small feat, even if it wasted on most of the monkeys currently giving Perl a bad name by pumping out glorified print statements...

    Cheers,
    Ben
  • Actually, pike does use bytecode, the actual source-code is not interpreted as it is run.

    The major difference between java and pike is that pike does not have a formalized byte-code syntax (at least not yet).

    This makes saving bytecompiled files on disk hard, you have to compare the pike version used to dumped the file with the version you are running, if they are different, you have to dump them again.

    So it is not currently possible to distribute pike programs without source-code (unless you also distribute the pike version that should be used to run them)

    The pike compiler also does quite a lot of optimizations, both on the syntax tree generated by the bison (LR) parser, and a peephole optimizer that works on the generated bytecode.

    So, what I wanted to say really is that pike is interpreted in exactly the same way that java is. interpreted.

  • by Cedric Adjih ( 7170 ) on Saturday June 03, 2000 @02:01PM (#1027719)
    I've just downloaded and played a bit with the language. Basically, if I understood properly:
    • It is in fact quite close to Java.
    • It has garbage collection (or is it reference counting ? I created some circular dependencies and it didn't seem to collect).
    • It has high level types: string, array, mapping, multiset. It has simple syntax for defining constants with those objects, and basic operation on them (like lists, dictionnaries, hashes in Perl or Python).
    • It has OO, looks less hackish than Perl, but just doesn't look as clean as Java. Is class-shared data possible ?
    • The variables have to be declared. It is not statically typed though, and it has a "mixed" type which is a placeholder for any type (something like Delphi's "Variant").
    • It tries hard to be like C. Exactly the same declaration syntax, operators, control flow structures. Worrying point: it also has the preprocessor.
    • It is probably less dynamic than Perl or Python (I couldn't set the method of one object to be another, at runtime).

    Basically it is closer to Java than to scripting languages because of the declarations. It might be simpler to use than Java if, for instance, you used the "mixed" type (can hold any object) everywhere, because you don't need casts ; it still looks heavier than Tcl, Perl or Python.

  • Time to plug Objective CaML (ocaml): possibly the top performing
    functional programming languages, with one of the worlds most talented
    compiler teams, a really nice way of combining functional programming
    and object orientation, an elegant language kernel, and superb
    supporting libraries and tools.
  • by perhe ( 196273 ) on Saturday June 03, 2000 @02:20PM (#1027724) Homepage
    Pike has both GC and refcounting. The gc is run now and then to remove circular structures (when there is enough garbage to collect, basically, using heurestics) or when you call gc() explicitly.

    Class shared data is not possible as such, but you can write, as an example:

    class Shared
    {
    int a;
    int b;
    float c;
    }

    Shared shared = Shared();

    class DaClass
    {
    void use_shared()
    {
    write( "a is "+shared->a+"\n");
    }
    }

    You can access the parent scope in classes (and functions (and funtions in functions etc)

    It is closer to java than C when it comes to declarations and such, IMHO. It also has quite a lot of similarities to lisp. Not the syntax (even if map( array, lambda( int elem ) { return elem+1; } ) does look rather lispish) but the internals and some of the programming structures are closer to lisp than C.



  • Does Lisp have referential transparency, or does it allow side effects and sequenced statements? Does it have an advanced type system, which supports type checked algebraic types (advanced generic typing)? Does it have universal lazy evaluation? Does it automatically curry functions?

    Lisp is old hat, my friend. If you are going to preach to us about expressive programming languages, pick something more up-to-date. At least you have ventured beyond the "C is everything" mentality... too bad you got stuck in the 1970/1980s, with Lisp. Lisp has great historical value, but other than that, it has been out classed by Haskell, www.haskell.org

    Cute little Object Oriented scripting languages, like Pike, are cool and all, but other than their aesthetic value, they add very little to advanced programming languages. It is yet another Object Oriented PL ...and no, we do NOT need another BASIC. Thanks ;-)
  • by robla ( 4860 ) on Saturday June 03, 2000 @02:43PM (#1027733) Homepage Journal
    Our entire website is powered by Roxen (and thus Pike). Having been indoctrinated in Perl and Python, I'll have to admit that when I first became a web developer here and took on learning Yet Another Language I was less than amused.

    However, I have to say that I'm impressed with the eye toward performance in Pike (most of the Roxen webserver itself is written in Pike), and the responsiveness of the maintainers when it comes to supporting the product.

  • I don't know what "referential transparency" means. Yes, Lisp allows side effects and sequences. Yes, there are advanced type systems of that kind available -- Lisp is an extremely extensible language.

    I'm not exactly sure what the point of universal lazy evaluation is, but you can do it in Lisp if you want to. Likewise, there's no particular reason why you can't curry functions automatically, but I'm not sure why you'd want to. Functions in lisp don't need to be curried because they can take more than one argument.

    I agree with your comments on Pike...languages which don't compile themselves are so lame (*cough*Perl*cough*).

    Haskell is a pretty cool language, but I wouldn't say it has "outclassed" Lisp. There aren't too many advocates of functional programming left nowadays...lets not belittle each other with petty in-fighting.

    -W.W.
  • That, or you could get an editor that is smart enough to match braces.

    If two braces match at different indentation levels, therein lies your bug (probably).
  • To mention a few things:
    • C-like syntax. Not a very important point, but when it comes to learning the language it's much easier than say Perl if you come from a C/C++ background. It's basically a highly evolved LPC (of LPMUD fame).
    • A very powerful Image package. Can load tons of formats natively including Photoshop (psd) and Gimp (xcf). Used by Roxen to do all kinds of graphics generation on-the-fly.
    • Powerful datatypes - mappings, multisets, shared strings. Nothing unique, but Pike's are very scalable. Also string handling is rather powerful.
    • Integrated bignum support. Pike 7 can handle arbritrary size integers without any special effort from the programmers point of view.
    • Very good and easy to use socket handling. Not strange since the main app written in Pike is a webserver.
    • Good object orientation, easy-to-use abstracted database handling, very nice GTK bindings and lots of more things I have forgotten about etc.

    Now to some drawbacks - we all know that everything isn't all good.

    • Shared strings, and datatypes in general, does have a memory overhead. Usually not noticable but if you deal with LOTS of short strings for example, you'll notice it. Nothing really unique to Pike though, but it's worth mentioning.
    • Not very wide spread usage and historically not very well documented. There are no Pike books, but there is a good tutorial now (check out http://docs.roxen.com).
    • Slower than C - can't be avoided. Slower and faster than Java (depending on what you do), sometimes slower than perl. Unfortunately I have forgotten the URL to the site that had benchmarks.
    • Less mature than some other languages. Syntax still changes, although backwards compatibility usually isn't major problem.
    • More things I'm sure. I just can't think of anything right now.

    I hope this is helpful.

  • Maybe Pike is amusing, but next to a language like Perl, is it really needed?

    If we can accept the fact that Perl is not perfect, and take the time to understand what it is that people don't like about Perl, and do like about other languages, then everyone -- especially the Perl developer community -- will be much better off. Just thoughtlessly claiming that Perl is the best language there is or ever will be is totally counterproductive (though a great way to waste a Saturday).

    - Scott

    ------
    Scott Stevenson
  • "...but it [Python] considers indentation as syntax..."

    Oh, GET OVER IT ALREADY!

    My god. So it uses indents. So fscking what?

    [rant on]
    Unless you're the type of useless programmer who should be taken out back and shot for writing a mishmash of mal-indented code that is so visually inconsistent that no one wants to maintain your shit, you're already using whitespace that already is syntax -- visual syntax for your brain to keep track of your structures.

    I suggest that anyone so tightassed that they can't cope with whitespace as syntax is someone who no one would want on a project team, because the collision of formating styles will cause conflict.
    [rant off]

    My god. What some people will whinge on about!

    --
  • by jetson123 ( 13128 ) on Saturday June 03, 2000 @03:56PM (#1027756)
    Pike, Python, Perl, Tcl, JavaScript, Ruby, etc. are all very similar: dynamically typed, byte code interpreted, procedural/OO languages.

    In addition, there is a plethora of interesting, powerful interpreters for languages that go beyond traditional scripting: EiC (ANSI C interpreter), CINT (C++ interpreter), Hugs/Haskell, CAML-Light, Scheme, Icon, CLisp/CommonLisp, Squeak/Smalltalk-80, etc.

    Next time you feel the urge to invent a new scripting language, think about doing something genuinely new, rather than coming up with a language that is merely an incompatible, incremental improvement of something existing.

    If you can't formulate some new idea that your language implements that isn't easily added to Python or Perl, I'd say, don't bother and work on one of the existing languages instead. Many of the existing languages need more libraries and better foreign function interfaces, and several of the existing languages would benefit from new implementations in C++ and/or Java, etc.

  • That, or you can get an editor that is smart enough to indent. Or convert braces to spaces.

    I mean, really, of all the things to not like about Python (lack of static typing, even as an option, which makes errors in variable assignments an all too easy mistake, for example), whitespace is the silliest of all possible protests against the language.


    --
  • You complain about the fact that Python uses indentation for syntax. From this, I conclude that you are not a Python programmer, since I have NEVER heard someone who had actually written more than 50 lines of Python complain about the indentation.

    It's not a bug, it's a feature.

    --

  • Well, I know I'm in the tiny minority, but I use ML every day.

    The universe does not need more C-like OO scripting languages! OO is far from being the Mecca of language concepts. There are vast worlds of unexplored programming paradigms that lead to much more expressive, beautiful, and useful programming languages. There's nothing fundamentally more difficult about these languages and paradigms (though there are fundamental reasons why they're better, sometimes), just a reluctance for the programming masses to try something new. Or perhaps Sun's clever marketing of Java. Or whatever.

    It saddens me to find us caught up using out-dated ideas and getting excited over syntactic sugar, marketing buzzwords, and a "getting things done" (think: RAD=perl=VB) mentality. Hackers have a duty to advance the state of the art by embracing new technology, because the suits don't care. Do the world a favor and learn/develop a new *different* programming language today!
  • But along came Kirk
    Took over the captain's chair
    Now...have...bad...acting...
  • Or, it could be that people who find the indentation policy objectionable won't stay around long enough to write at least 50 lines of Python.

    I personally take pains to indent my code in a consistent manner, but for me, consistent is anything but simplistic. For instance, I might just put a very short block (such as an if statement with a short 'then' clause) all on one line for economy of space. Also, I have very particular ways of wrapping long lines, and of aligning similar elements across many lines. It's all very consistent and clean. It's also possibly somewhat unique to me. At the very least, I need only pay attention to my rules and the rules of whatever team I'm on, and not the language author's.

    In other words, I've become very accustomed to the idea that whitespace belongs to the programmer and not the programming language. I'm not ready to relinquish my control over whitespace now that I've moved away from languages (such as BASIC, FORTRAN, etc.) that wanted to control it for themselves.

    Note: I have looked over Python's whitespace rules, and I find them mostly reasonable. Still, I object on principle.

    --Joe
    --
  • I was not belittling you. I belittled the your love for Lisp. There are many like you, who get introduced to Lisp, as THE functional programming language... I wish more schools taught modern languages, as opposed to outdated languages (*cough* Prolog *cough*).

    Automatic currying of functions reduces the amount of parens needed, when using functions of one argument or N arguements. Lisp has a parens fetish that gets a little messy now and then. Its not to not have to use them as much, as Haskell allows.

    "Referential transparency" does not exist when there are side effects. Referential transparency allows transparent threading of your application. Think about have your app automatically run on 4 CPUs, without any code rewriting. Referential transparency also allows more simplistic proof of the properties of your code.

    Please hook me up with some good resources on advanced Lisp type systems. Last time I checked, standard Lisp had no type system. A horrid weakness.

    Universal lazy evaluation means that your data structures and functions are evaluated in a lazy manner. If you do not understand what I mean by that, then there is no way you can truely experience the beauty of modern functional programming. I know that Lisp may have lazy lists, but I know that overall, it has strict evaluation over its functions/data structures. Here is an example:

    f x y = x + 10


    Lazy evaluation:
    ] f (sqroot 2349 + 7/346) (sqroot 343568 + 7/346)
    ~ (sqroot 2349 + 7/346) + 10
    ~ (48.4867...) + 10
    ~ "After this point, the remainding expression is returned. If it needs to be evaluated furthur, because a function needs a more reduced form, then it is automatically reduced. However, it will only be reduced furthur, it is needed."

    Strict evaluation (like Lisp, but using Haskell syntax):
    ] f (sqroot 2349 + 7/346) (sqroot 343568 + 7/346)
    ~ f (48.4867...) (586.1669...)
    ~ (48.4867...) + 10
    ~ 58.4867...
    Notice how strict evaluation does more work than is needed? Sure, my example is trivial and silly, but there are cases, where it is not as trivial. Lets say I wanted to define functions over a boolean data type:

    And True y = y
    And False y = False


    Lazy example evaluation:
    ] And (Not False) (And (Not True) (And True False))
    ~ And True (And (Not True) (And True False))
    ~ (And (Not True) (And True False))


    Strict (ala Lisp):
    ] And (Not False) (And (Not True) (And True False))
    ~ And (Not False) (And False (And True False))
    ~ And (Not False) (And False False)
    ~ And (Not False) False
    ~ And True False
    ~ False

    Note how strict evaluation continuously evaluates the second argument of And, even when it is not needed (the first arguement was False). If real life applications, Lazy evaluation allows for greater modularity in application design. Here is a paper, for you to read, if you care to furthur your knowledge of functional programming and the great benefits of lazy eval: Why FP Matters [chalmers.se]

    I am sorry, but you have to learn why Lisp has been outclassed to understand. Its hard to just show people with a few examples. The paper I linked should be a good start. Many of the parts of Lisp that have been outclassed, cannot just be added on to Lisp. They are fundamental changes that would have to take place, to modernize Lisp. It would no longer be Lisp at all.

    Also, read this entire book (its good, trust me): Good FP Book [ukc.ac.uk]

    I argue with you because you show potential. I won't even bother to discuss FP with most of the other people on this board. Many of them truely thing that Perl is a really good language. Its not even worth trying to argue with someone that burried.
  • by Anonymous Coward

    as from my past years experience with Java & Pike (or even LPC), I feel that Pike though not as clean as Java, it has its advantages of being flexible and handy:

    1. Pike has multiple-inheritance. Java becomes really frustrating & painfully to write when I am dealing large scale OO project because of its single-inheritance nature. The interface thing is really troublesome, how many times do you have to copy&paste functions just because they are not in your parent class?
    2. Pike allows functions to be passed around. This is definitely a win towards Jav anonymous class implementation. Why do you have to declare YET ANOTHER CLASS when you just want to have a simple callback? Being able to pass functions around is definitely a win of flexibility.
    3. Pike has in-built syntax for dynamic data types. Arrays are inherantly dynamic sized, and able to hold values of different data types in the same array. Java insists creating a Vector class in which only objects can be stored. Pike also allows operator overloading, so an array or mapping (hashtable) concatenation is as simple as A + B. I write Pike programs often 1/2 of the length of a Java program to achieve the same thing.
    4. Pike is oh-so-easy to learn for C or C++ programmers than any of Java, Perl, Tcl and Python. My early experience was with LPC when I was learning my way to code LPmud, and I picked it up almost in 2 hours or such. I wished LPC could be a general purpose language at that time simply because I found it the easiest language to code. This was when Java was still in its 1.0 beta stage. I learned Java later and did large project with it, but never felt it has any advantage over LPC except it is more wildly supported. Then I came to know Pike. As a successor of LPC, Pike did an exellent job of being a general purpose language with a very powerful set of modules ranging from Database, SMTP to GTK.

    Pike certainly has its disadvantage of being less well known, and less supported compared to the SUN & IBM boosted Java, but Pike has a much better license though. Pike's byte-code interpretor is solid but still pales when compared with those new JIT compilers for Java. It still has a long way to go in order to become a main stream language, or will it ever?

    What the heck, as long as it fits my need and serves its purpose greatly, I am satisfied.

  • SecurityFocus' webserver is Roxen. A bunch of our webforms are combinations of RXML, pike and a few other things. I also had never heard of Pike or Roxen until I started here, and Elias forced me to learn it.

    Anyway, my point is that I had to try to learn Pike by reading said documentation. It's really not very good. It's well organized, but it's incomplete, and lacks good examples. In many cases, I had to make inferences about how something worked by trying it and watching the errors.

    The docs especially fall down when it come to how Pike works (differently) when called from Roxen via the tag. For example, I think it took me about 5 hours of searching the docs, mailing list archives, and other code already on our site to figure out how to get variables between the RXML scope and the scope.

    Not that it's all bad, of course. There are some real nice features in RXML/Pike when it comes to forms processing, database hooks, etc.. variables submitted via forms appear in RXML code like first-class variables.
  • A good Haiku liked
    By Moderators who
    Mark it off-topic
  • by jacobm ( 68967 ) on Saturday June 03, 2000 @08:10PM (#1027782) Homepage
    Sorry, you just triggered my pet-peeve-o-meter. Nothing personal.

    The phrase 'X is the most of all possible Y' is, err, the most annoying of all possible figures of speech. :) How can you possibly say that "whitespace is the silliest of all possible protests against [Python]"? Sure, it's a pretty silly protest, but the silliest possible? That's pretty severe, don't you think? In fact, there are much sillier complaints about Python, I'm sure. In fact, I think I'll take your post as a challenge to think of sillier arguments, and I accept. Here's a list:

    Top Ten Sillier Things than Whitespace to Protest About Python

    10. Using a language called 'Python' might give people a cavalier attitude towards snakes.
    9. Python might not be Y2K compliant.
    8. Object-oriented languages suxXxor. You have to use dots all over the place.
    7. The Python interpreter doesn't automatically call the C preprocessor- you have to do it yourself.
    6. Python is Turing-complete. I hate that!
    5. MSVC has no idea how to compile it- can this possibly be a good language?
    4. Clearly it was a language designed by perverts. 'Hey baby, wanna program my Python?' Sickos.
    3. How could a guy named Guido possibly come up with a good language?
    2. The way the code looks reminds me too much of CLR. Bad memories, man.
    1. By taking a perfectly good language and naming it 'Python,' that's one less language that might become popular that could be called 'Ninja.'

    So whitespace is, at the very most, the eleventh-silliest possible complaint against Python. There may be others- could it be possible that the set of complaints about Python has no silliest element? Further research into that topic is necessary, I think. (As is research into how this post relates in any way to what I think about Pike.)
    --
    -jacob
  • I am interested. I will have to read that paper you linked to when I boot into my GNU/Linux partition (with a postscript viewer).

    "I argue with you because you show potential. I won't even bother to discuss FP with most of the other people on this board. Many of them truely thing that Perl is a really good language. Its not even worth trying to argue with someone that burried."

    I can understand your point of view, amongst much of the language zealotry. But I hope you can still share your thoughts. What intrigued me was the following:

    ""Referential transparency" does not exist when there are side effects. Referential transparency allows transparent threading of your application. Think about have your app automatically run on 4 CPUs, without any code rewriting. Referential transparency also allows more simplistic proof of the properties of your code."

    Are there any papers you can reference about this?
  • How will you know until you investigate?

    Why should he even bother investigating unless someone can explain what it has that other languages don't ?

    Python offers alot of OO features but has a limitation I can't deal with:

    Looks like you haven't tried very hard.

    it considers indentation as syntax. Pike might make a better language for OO scripting than Python given its syntax.

    If it really doesn't have anything over python except a different style of syntax, I don't think I'll even bother. "Like Python but with different syntax" doesn't cut it, especially when pythons syntax works just fine for those that actually use it.

  • Or, it could be that people who find the indentation policy objectionable won't stay around long enough to write at least 50 lines of Python.

    IOW, they were too inflexible and narrow minded to give it a fair go.

    In other words, I've become very accustomed to the idea that whitespace belongs to the programmer and not the programming language.

    In other words, you've got this preconceived notion that there's "one true way" ( ie braces ) to do syntax. Well that's not really true. Python's syntax might not be the worlds best, but it's certainly not bad enough to justify running away and screaming in horror ! I find it amazing that people who are willing to put up with the syntax used in languages like C and perl are so frightened of python.

  • Just thoughtlessly claiming that Perl is the best language there is or ever will be is totally counterproductive

    He didn't claim "perl was the best". But one certainly wonders why move to pike when there's perl and python. What can one do in pike that one can't do in perl or python ?

  • The major problems that happen with multi-threading are largely due to the potential for unexpected interactions. If it is easy to show that there are no undocumented side-effects of a given piece of code, then it is far easier for an optimizer to move around when and where it is executed.

    If there are potential side-effects then it can't do that unless it can prove that the side-effects in point A don't have any interaction (intended or unintended) with side-effects in point B.

    Cheers,
    Ben
  • I don't remember where I read it, but someone once described AI as "everything we haven't yet gotten a computer to do". Theorem proving isn't AI anymore, because a computer can do it. Similarly, pattern recognition, chess, and natural language queries aren't really considered part of AI anymore.

    Sort of sad for the AI people, though, since any progress they make is immediately removed from their domain of research.
  • But one certainly wonders why move to pike when there's perl and python. What can one do in pike that one can't do in perl or python ?

    Thanks for proving my point. :)

    I think we too quickly dismiss looking into Perl alternatives because people seem to feel that Perl is "good enough."

    - Scott

    ------
    Scott Stevenson
  • I'll check out the tutorial, thanks.

    It's good to know that I'd get such a quick answer from the list, but pride dictates that I not go asking how to assign values to variables on a mailing list. :)

    But the point I was trying to make was that a simple example would have done wonders for me.
  • I often find myself asking people on the street about programming multithreading. I must *really* be dumb because the stupidity of my question causes blank stares.

    Probably because I am an American.

    :)
  • some examples of other unexplored paradigms:

    intentional programming: see microsoft research and do a search on google (please open your mind, it's just bill gates pouring money into legitimate research). If they pull this of it will be one of the most interesting things to happen in computer programming since the invention of the compiler.

    Self: a little outdated now but there are still some interesting ideas in it (many of them were used to develop Java). You can find it somewhere on sun's website.

    Subject oriented programming: There's some very interesting research going on in this area. IBM is the place to look for SOP.

    Aspect oriented programming: Also very interesting. Check Xerox' research site and be sure to give their compiler a try.

    Anybody serious about exploring new paradigms should take a look at the above. There are several related research projects going on but these are the most important ones. All of them are driven by the realization that OO is just not good enough for modeling the entire world.

    I checked out the Pike website briefly. I can't discover any exciting language features in it. It is yet another OO scripting language. Maybe it will find its niche like so many other languages do but there's nothing revolutionary to be found there. I'm not a language designer but what would interest me is a scripting language that supports one of the paradigms above. Especially AOP would seem very useful in a scripting language.
  • by kinkie ( 15482 ) on Sunday June 04, 2000 @01:11AM (#1027815) Homepage
    Pike is close to java in that they are both follow C syntax somewhat, extending it to OO concepts.

    It is unlike java in that while Java is strongly typed and you have to use typecast, Pike is as strongly-typed as you wish. You can use the mixed type to completely defeat any typechecking, or you can use classes and call them by name to be as strongly-typed as you wish.
    Also notice that pike's concept of "class compatibility" is somewhat different from all other strongly typed OO languages, as it doesn't call into play inheritance. If two classes have similar signatures (names and types of public methods and variables), they are compatible.

    Another novel approach Pike has is to function and operator overloading.
    With C++ (and Java, if I remember correctly), overloading is defined by having different functions take different numbers and types of arguments: i.e.
    void foo (int arg);
    void foo (char* arg);
    They are distinguishable at compile-time because the function signature is extended to its arguments' types, usually via name mangling.

    Pike insteads allows arguments to be of different types. The above example would translate to:
    void foo (int|string arg).
    The programmer can then use runtime type information to discriminate.

    Pike has both refcounting and garbage collection. It is quite uncommon to see the gc in action, as it will kick in when some percentage (I think half) of the object references are deemed garbage (it uses some adaptive algorithm to determine when to run). Or when explicitly invoked.

    About static typing, see above. It can be as strict (or as lax) as the programmer wishes. It is refreshing to have some "mixed tmp" variable in a function and use it for loops etc.

    About control flow structures, it has some more than C (i.e. foreach()).
    The preprocessor if used wisely can be a nice weapon. For instance, you can detect the interpreter's version and use threads when possible. Of course, this also means that it allows people to write messy code. But they'd do it anyways...

    It can be as dynamic as you wish. For instance, setting a method of another object can be done using a "function"-type variable:

    class foo {
    private int foo_bar() {
    werror "foo";
    }
    function bar=_bar;
    }
    class gazonk {
    private int gazonk_bar() {
    werror "gazonk";
    }
    object foo_object=foo();
    void create() { /* constructor */
    foo_object->bar=gazonk_bar;
    }
    }

    I could have also used anonymous functions (lambda) here.
    i.e.
    function foo_bar=lambda() {werror "foo";}

    A nice thing about the language is that it doesn't try to hide details from the user. It is known what is handled by reference (every composite type, classes, objects, functions) and what is by value (basic types). It allows runtime inspection (via the indices, and typeof operators), remote objects, etc.

    Since functions are primary objects, the whole runtime library follows a very consistent callbacks-based approach. This comes very handy when doing asynchronous I/O (one of Pike's strong points) or GTK programming.

    About its "product placement" in terms of heavy-ness. It has some at-large programming helpers (more than TCL), and its syntax is less shell-ish than TCL's. Perl is IMO simpler for very simple tasks, but heavier for more complex ones (especially when need to go further than the string-array-hash types, and references come into play. Pike is much easier in this respect).
    Python, I don't know really.I've never used it. I suspect that Pike and Python play roughly in the same league, neither clearly besting the other. I find Pike very convenient in I/O-related task, X programming (although here TCL/TK is better), and some simple text-manipulation tasks, requiring little text manipulation and a bit of variables-juggling.

    About the runtime environment, Pike offers a two-pass compiler (no forward declarations), a mixed static+dynamic names binding model (intra-object references are static, inter-object they are dynamic), and a nice (but not comparable to CPAN) runtime library, including some nice DB-connectivity options.
  • Roxen was initially (circa 1993) by Per Hedbor as Spider at Lysator. It was later renamed as Spinner, and then Roxen for trademark-related reasons. There should be some historic background info at http://docs.roxen.com/ [roxen.com]
  • MicroLPC was a rewrite-from-scratch of LPC for licensing issues (LPC didn't allow for commercial purposes) and performance reasons. Pike is MicroLPC renamed, plus tons of improvements.
  • And, by the way, Roxen is the name of a fair-sized lake at Linköping. If you wanted to know...

  • I think we too quickly dismiss looking into Perl alternatives because people seem to feel that Perl is "good enough."

    Huh ? I do look into and even use perl alternatives as indicated in my post. For example, python because IMO it has better OO. However, I don't use an alternative unless it does something better than the tools that I'm already using. I haven't really seen the pike boosters make a compelling case for pike. OTOH, the perl and python crowds certainly make good cases for those languages.

  • Touche'. :-) I wish I could give you a moderation point for funny, even if I had to steal one from my own posting.

    --
  • AFAIK, there is a vi macro set that does do automagic indentation.

    I could be completely wrong, having never used it. But I can't imagine there's much point to having it if it doesn't do that.


    --
  • Self: a little outdated now but there are still some interesting ideas in it (many of them were used to develop Java). You can find it somewhere on sun's website.
    This page [cetus-links.org] seems to have a lot of links, and self.sunlabs.com [sunlabs.com] is the official word.

    SELF wasn't really a big new paradigm, though. It worked on a few interesting ideas: dynamic compilation (which became Java's JIT), prototype-based OO, and a new widget system (Morphic, which lives on in Squeak [squeak.org]).

    I think prototypes are an interesting alternative to classes for OO programming, and it's something that hasn't been very seriously pursued since then. It's a purification of OO in some ways, as too is SELF's insistence that all access to instance variables be through method calls.

    Alan Kay, who coined "object oriented", said before that he really named it incorrectly, because he felt message passing was a more interesting and powerful concept. I think SELF moved more in that direction.
    --

  • Does Lisp have referential transparency? Yes, of course, if you abstain from using side effects.

    Does Lisp allow side effects and sequenced statements? Yes, of course, if you are willing to give up referential transparency.

    Does Lisp have strict typing? No, it doesn't. On the other hand, Haskell does not have dynamic typing or does it?

    Does it have universal lazy evaluation? No, of course not. If you need lazy evaluation, you can use it. If you don't, don't.

    Does it automatically curry functions? No, it doesn't. If you need it, do it yourself. Currying is also not easy when you have advanced lambda list features like keyword and optional arguments.

    Plus, Lisp has a feature I haven't seen in any other language: The defmacro facility. It practically allows one to invent a new language for the problem at hand. This is something that no Lisp-bashers seem to even acknowledge. I wonder why...

    Lisp is not a language that forces you to do something in one an only one way. If you want to program imperatively, do it. If you want functional programming, you can do that also. Use lazy evaluation if you need it, not because you have to.

    bye
    schani
  • > While the critical number of lines to write is
    > probably greater than 50 (maybe several
    > hundred), it is obvious you haven't reached it,
    > so in this respect, you know less than us who
    > did.

    Ok I take issue with this statment.

    I have never Programmed in Python. I want to try it out, even though I am initially repulsed by the whitespace thing (I am used to C style languages, so I am uncomfortable with this...I admit that this is my personal bias and nothing more)...

    however...You seem to be implying that anyone who uses python long enough will find out that they love it, and they love this feature of it. I don't think that this is true.

    Python Syntax WILL be a problem for some people, just as C syntax is a problem for some people. There is no "One True Way" that will please everyone.

  • "...but it [Python] considers indentation as syntax..."

    Oh, GET OVER IT ALREADY!


    No. And I am tired of your god damned superior
    attitude. I just pushed a PHP project off my "project stack", and have a perl project prioritized now. Just below this is a syntax translator for python that removes the indent requirement by using a syntax similar to MOO (or algol, or shell, depending on what you imprinted on. It still doesn't require braces or semicolons, but is free of this weird and frankly offensive cultural jihad of yours against the "unclean" syntax, meaning just about every other language in existence (except your illustrious company of early FORTRAN and RPG).

    It will generate compatible .pyc code, and I will translate the standard python library to it. I entirely aim to put an end to this nonsense once and for all.

    ... soon as I stop making it leak a stray colon into the compiler. I'm one lexical token away from knocking this idiocy down and claiming python as MY language too.
  • > IOW, they were too inflexible and narrow minded to give it a fair go.

    What do you consider a fair go? Until they agree with you? I am not unenlightened, I have tried the indent way. I reject the philosophy of whitespace as block scope. Honestly, you sound like the door to door preacher that tells me about God's gift of eternal life. I reject them too. Not out of ignorance or fear, out of knowledge.

    Rejection sucks, don't it?
  • If you define "stable" as 'not crashing', then Linux is very unstable because 'applications keep crashing on me'...

    General rule of thumb: when language conventions are defined, stick with them.

    In any case, the name 'functional' comes from the fact that the language is built around the evaluation of functions (in the maths sense, i.e.
    f : -> n |-> 1/sqrt{n}
    defining "functional" as useful basically means that you have to find a new, more convoluted name such as "function-evaluational langauge".
    John
  • An example in comparative sizes between Java and Pike: my thesis paper involved writing a net management system in Java.
    I prototyped the application in Pike.
    The prototype was 8k pike lines, the final app was 60k Java lines, and IT DID THE EXACT SAME THINGS.

    Also, due to its prototype nature, I modeled the pike program to do things the same way I'd do them in Java, thus the actual numbers if I had followed the correct programming style for Pike would be even more extreme
  • ?Perl smoothly supports building real system in any and all combinations of those programming styles

    Are these things _possible_ in perl? Yes. Does perl _support_ them in any meaningful way? No. Not any more than assembler does.
  • If it supports impure features then it is an impure functional prgramming language.

    A functional programming language is a programming language that
    supports a purely functional programming style. Ocaml is widely used
    as a langugae to teach people functional programming: see the book
    `The Functional Approach to Programming by Cousinot and Mauny.
  • Fooled me!

    First of all when I say "basic programming notion" I mean in general. Not for one language or another, but rather a notion that will come up in many languages.

    It doesn't happen in C. It does in JavaScript. It doesn't in Java. It does in Smalltalk. It doesn't in Python. It does in Perl. It doesn't in VB. It does in Lisp.

    Perl is specifically designed to allow "baby-talk". This is considered a feature. So you can program in Perl without knowing what a closure is. But if you don't know what a closure is, you won't know what lexical scope is. If you don't understand the difference between lexical and dynamic scope then you won't understand what the different between my and local is. If you don't understand that difference then you won't understand why Perl gurus keep on telling people to use my instead of local, and why use strict encourages people very strongly to do that. And if you don't understand that, then you will suffer needless pain from time to time.

    As for what /. is, yes it is a forum with many people of different backgrounds. Like it or not, sometimes someone will have a point to make and that point will make no sense to people who do not understand a lot of concepts like "closure", "lexical scope", and "functional programming". There are lots of people who understand all that, and lots who do not. So I specifically said that my comment was one that would only make sense to people who had been exposed to functional programming.

    Regards,
    Ben
  • Not true. Haskell encapsulates side effects in monads, allowing the
    sequencing of side effects to be described in purely functional code.
  • THat's a logical argument, but not a very compelling one. You'd be hard pressed to find many people who've written more than say 1000 lines of python and *still* have a major problem with its syntax.

  • It was a client-server app, which made heavy use of applets, RMI, runtime object inspection (Beans-like), JNI and JavaCC parsers (I only counted the grammar lines, not the generated parser's).

    Also, I'd figure that about one fourth to one third of the total size are comments, documentation and similar stuff. Still, the important fact is the actual code ratio, rather than the overall size.

Long computations which yield zero are probably all for naught.

Working...