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?
"
Pike? (Score:1)
-S
http://students.washington.edu/steve0/ [washington.edu]
steve0@u.washington.edu
Pike with Gtk bindings (Score:4)
Yeah, but what does it have to offer? (Score:2)
pike rocks (Score:2)
Haiku (Score:3)
A powerful new system
Named after a fish
Interesting... (Score:2)
Sounds pretty cool to me.
Re:Haiku (Score:1)
You forgot that a pike could
also be a stick
Windows support (Score:2)
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.
Re:Pike? (Score:2)
no like pike - like roxen (Score:1)
Pike -- too low level (Score:2)
Re:Haiku (Score:1)
You, too, can program in Pike
Its not just a stick
Pike (Score:4)
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.
Are you blind? (Score:3)
A good example of Pike in action (Score:4)
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.
Re:Haiku (Score:1)
only have four syllables
in the last line
Re:Haiku (Score:2)
--
It's a fine line between trolling and karma-whoring... and I think I just crossed it.
- Sean
Re:Yeah, but what does it have to offer? (Score:3)
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)
Re:Scriptlanguages are bad (Score:5)
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.
Re:Haiku (Score:1)
Re:Are you blind? (Score:1)
Just Like Perl! (Score:2)
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]
Re:Haiku (Score:1)
Not just fish [wisc.edu] or sticks [hat.com].
There are brilliant people [bell-labs.com] too,
from which this name comes.
Reminiscent of LPC (Score:2)
Re:A good example of Pike in action (Score:1)
Re:Haiku (Score:3)
about pike because it doesnt follow the haiku syntax
at all.
----
Oh my god, Bear is driving! How can this be?
Re:Haiku (Score:1)
Re:Haiku typo (Score:2)
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...
Re:Haiku (Score:1)
yeah, yeah
Re:Pike? (Score:1)
http://students.washington.edu/steve0/ [washington.edu]
steve0@u.washington.edu
Re:Reminiscent of LPC (Score:2)
a whizard on LPC programming. If I remeber it right its first name was micro-LPC.
Re:Just Like Perl! (Score:2)
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.
Re:Haiku (Score:1)
Torture, agony, and grief
Files scream, deleted
Re:Haiku (Score:2)
He had a light bulb only
To flash yes or no
That's not a haiku. (Score:1)
--
"One World, one Web, one Program" - Microsoft promotional ad
Re:Haiku (Score:1)
-Mike Bell
How is this (Score:2)
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.
Re:Pike sucks, Kirk kicks ass (Score:1)
Kirk
Re:Pike? (Score:2)
The whole thing sounds fishy to me
Re:Just Like Perl! (Score:2)
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();'
Re:That's not a haiku. (Score:2)
Used his two hands and two thumbs.
Not enough fingers.
Re:Scriptlanguages are bad (Score:2)
Too many languages? (Score:2)
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?
Re:That's not a haiku. (Score:4)
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
Lisp is *not* only for AI. (Score:3)
"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.
Python does NOT have all of the power of Perl (Score:2)
If you wonder why I mention them, then you have never tried functional programming techniques.
Regards,
Ben
Re:That's not a haiku. (Score:2)
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.
The fortune answers that better than I can... (Score:3)
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
Re:Pike is an interesting alternative... (Score:2)
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.
About Pike. (Score:4)
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.
Re:Python does NOT have all of the power of Perl (Score:2)
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.
Re:About Pike. (Score:3)
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.
Re:Lisp is NOT a functional programming language (Score:2)
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
Roxen use at RealNetworks (Score:3)
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.
Re:Lisp is NOT a functional programming language (Score:2)
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.
Re:Yeah, but what does it have to offer? (Score:2)
If two braces match at different indentation levels, therein lies your bug (probably).
Re:Yeah, but what does it have to offer? (Score:4)
Now to some drawbacks - we all know that everything isn't all good.
I hope this is helpful.
Re:Just Like Perl! (Score:2)
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
Re:Yeah, but what does it have to offer? (Score:2)
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!
--
too many scripting languages (Score:4)
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.
Re:Yeah, but what does it have to offer? (Score:2)
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.
--
Re:Yeah, but what does it have to offer? (Score:2)
It's not a bug, it's a feature.
--
OO is obsolete-- Hackers, use your brains! (Score:2)
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!
Re:Haiku (Score:2)
Took over the captain's chair
Now...have...bad...acting...
Whitespace as a matter of principle (Score:2)
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--
Re:Lisp is NOT a functional programming language (Score:2)
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.
Pike v.s. Java (Score:2)
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:
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.
The documentation is NOT good (Score:2)
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.
Re:Haiku (Score:2)
By Moderators who
Mark it off-topic
Re:Yeah, but what does it have to offer? (Score:3)
The phrase 'X is the most of all possible Y' is, err, the most annoying of all possible figures of speech.
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
Re:Lisp is NOT a functional programming language (Score:2)
"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?
Re:Yeah, but what does it have to offer? (Score:2)
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.
Re:Whitespace as a matter of principle (Score:2)
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.
Re:Just Like Perl! (Score:2)
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 ?
I thought that was common knowledge (Score:2)
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
Re: "ai" (Score:2)
Sort of sad for the AI people, though, since any progress they make is immediately removed from their domain of research.
Re:Just Like Perl! (Score:2)
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
Re:The documentation is NOT good (Score:2)
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.
Of course its common knowledge! (Score:2)
Probably because I am an American.
:)
Re:OO is obsolete-- Hackers, use your brains! (Score:2)
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.
Re:About Pike. (long) (Score:5)
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() {
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.
Re:A good example of Pike in action (Score:2)
Re:Reminiscent of LPC (Score:2)
Re:A good example of Pike in action (Score:2)
And, by the way, Roxen is the name of a fair-sized lake at Linköping. If you wanted to know...
Re:Just Like Perl! (Score:2)
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.
LOL (Re:Yeah, but what does it have to offer? (Score:2)
--
Re:... and then there's vi (Score:2)
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.
--
Re:OO is obsolete-- Hackers, use your brains! (Score:2)
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.
--
Re:Lisp is NOT a functional programming language (Score:2)
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
Re:Whitespace as a matter of principle (Score:2)
> 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.
Re:Yeah, but what does it have to offer? (Score:2)
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
... 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.
Re:Whitespace as a matter of principle (Score:2)
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?
Re:GIMP EMACS SIAG Gnumeric etc etc (Score:2)
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. defining "functional" as useful basically means that you have to find a new, more convoluted name such as "function-evaluational langauge".
John
Re:Pike v.s. Java (Score:2)
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
Re:The fortune answers that better than I can... (Score:2)
Are these things _possible_ in perl? Yes. Does perl _support_ them in any meaningful way? No. Not any more than assembler does.
Re:Python does NOT have all of the power of Perl (Score:2)
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.
It isn't? (Score:2)
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
Regards,
Ben
Re:Python does NOT have all of the power of Perl (Score:2)
sequencing of side effects to be described in purely functional code.
Re:Just Like Perl! (Score:2)
Re:Pike v.s. Java (Score:2)
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.