Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Haskell98 - Where it used ? (example of use)

72 views
Skip to first unread message

Cyril Klimakoff

unread,
Jun 20, 2001, 9:09:29 AM6/20/01
to
Hello peoples.
I see anything never perspecitve for this language.

This is write ?


Alexander V. Voinov

unread,
Jun 20, 2001, 12:25:37 PM6/20/01
to
Hi Cyrill,

Cyril Klimakoff wrote:

There is a message two lines above yours where a 'real world'
application of Haskell is discussed.

Regards

Alexander


David Scarlett

unread,
Jun 21, 2001, 1:57:35 AM6/21/01
to
"Alexander V. Voinov" <a...@quasar.ipa.nw.ru> wrote in message
news:3B30CE81...@quasar.ipa.nw.ru...

There is? I don't see it......

Which thread?


--
David Scarlett
dsca...@optushome.com.au
http://www.listen.to/artifice/
http://members.optushome.com.au/dscarlett/

"If you have a thing for parentheses, then LISP is the programming language
for you!"
-My Computing Fundamentals lecturer


Vitaly Lugovsky

unread,
Jun 21, 2001, 10:18:33 AM6/21/01
to
Cyril Klimakoff <cy...@org.lviv.net> wrote:
CK> Hello peoples.
CK> I see anything never perspecitve for this language.

Microsoft Research loves it. Isn't it a good perspective? ;)

--

V.S.Lugovsky aka Mauhuur (http://ontil.ihep.su/~vsl) (UIN=45482254)

Alexander V. Voinov

unread,
Jun 21, 2001, 12:59:33 PM6/21/01
to
Hi David

David Scarlett wrote:

> > There is a message two lines above yours where a 'real world'
> > application of Haskell is discussed.
> >
>
> There is? I don't see it......
>
> Which thread?

The thread about MS-Access, Excel. Little evidence can be drawn from the thread
that the problem deadly needs Haskell rather than VB, but the very necessity to
link to MS-Office may be regarded as a sign of 'realworldness'.

Alexander


Cyril Klimakoff

unread,
Jun 22, 2001, 2:53:39 AM6/22/01
to
"Vitaly Lugovsky" <war...@skeptik.net> wrote in message
news:9gsvnp$s6p$1...@inn.ihep.su...
Hello All.
Sorry for my poor english.
I'm understand that Microsoft Corporation loves Haskell.
But Please send me (if you know) one example of task where using Haskell
give us really good solving of problem.
Thanks.


Jerzy Karczmarczuk

unread,
Jun 22, 2001, 6:38:38 AM6/22/01
to
Cyril Klimakoff writes:

> ... Please send me (if you know) one example of task where using Haskell


> give us really good solving of problem.
> Thanks.

First, please, tell us HOW MANY PAPERS about Haskell have you read.

Have you written a single line of code in Haskell?

Will you be able to understand the examples which we could cite?

===

You see, people here are extremely willing to help, to enlarge the number
of people who appreciate the functional programming, but there is no point
in opening silly, useless discussions with persons who are a priori
negative. You are not the first one. Not the last one. Do you want to
quarrel or to learn something?

Look up the Haskell repositories, search personal pages of people involved
in this business, look up this library:

http://hypatia.dcs.qmw.ac.uk/SEL-HPC/

BEFORE asking provocative questions, alright?

Or, perhaps, if you wish so, tell us what kind of problems would you like
to see being solved in Haskell. What is your background?

Jerzy Karczmarczuk
University of Caen, Normandy, France.

George Russell

unread,
Jun 22, 2001, 9:31:42 AM6/22/01
to
Jerzy Karczmarczuk wrote:
>
> Cyril Klimakoff writes:
>
> > ... Please send me (if you know) one example of task where using Haskell
> > give us really good solving of problem.
> > Thanks.
>
> First, please, tell us HOW MANY PAPERS about Haskell have you read.
>
> Have you written a single line of code in Haskell?
>
> Will you be able to understand the examples which we could cite?
I think this comment is unfair. There are literally thousands of programming
languages out there, and it's perfectly reasonable to ask for some kind of
evidence of effectiveness before learning one.

However there are two things which make the question as originally put
difficult to answer:
(1) Haskell is as a general-purpose programming language. Thus
there are _many_ possible impressive applications. Topics of recent
research have included, among others, concurrency, inter-language
working and expressing financial derivatives. If Cyril Klimakoff
would give some kind of indication of what sort of application
would impress him, we can probably find some papers which have been
written about such an application in Haskell, or at least some
functional language.
(2) Haskell is however mostly only used by the computer science research
community. Thus there are not going to be full-scale commercial
applications in Haskell. Would that there were. The fact that
Microsoft is paying people to do Haskell research may or may not
be a good sign . . .
One thing Cyril Klimakoff might try doing, if he has access to an
academic library, is to skim through the last few years of the
Journal of Functional Programming. There he will find quite a
few big and small applications of Haskell, and other functional
languages. If Cyril Klimakoff has never seen a functional language
before, he may find these papers tricky to understand in depth,
but he should at least get a general flavour.

Cyril Klimakoff

unread,
Jun 22, 2001, 9:55:36 AM6/22/01
to
> Thus there are not going to be full-scale commercial
> applications in Haskell.
Thanks for this lines.

James Hague

unread,
Jun 22, 2001, 10:12:17 AM6/22/01
to
George Russell wrote:
>
> However there are two things which make the question as originally put
> difficult to answer:
> (1) Haskell is as a general-purpose programming language. Thus
> there are _many_ possible impressive applications.

Most programming languages are general purpose in theory, but frequently
have niches in which they are especially well-suited. Visual Basic is
popular not because of the language, but because of the GUI building tools
and easy database access; it is used for writing front-ends for databases as
a result. REBOL is perfect for anything that involves network access, such
as sending email or fetching web pages. Erlang is custom built for
applications that involve asynchronous, concurrent proceses, like web
servers. Forth is perfect for embedded systems where there's no room for a
traditional OS.

Languages without niches, like Scheme and Haskell, may be beautiful, but
they are harder to justify using for real applications. Not that there is
anything wrong with Haskell, mind you, but the prettiness of the core
language is rarely a high priority.

(A good example of mostly functional language with a niche is J, which gets
used for heavy-duty financial calculations.)

James


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----

Siegfried Gonzi

unread,
Jun 23, 2001, 8:22:34 AM6/23/01
to

"George Russell" <g...@tzi.de> schrieb im Newsbeitrag
news:3B3348BE...@tzi.de...

> > Will you be able to understand the examples which we could cite?
> I think this comment is unfair. There are literally thousands of
programming
> languages out there, and it's perfectly reasonable to ask for some kind of
> evidence of effectiveness before learning one.

Such a comment shouldn't be of great surprise. It is not uncommon that in
the functional programming community people are not interested to show real
world solutions. Some there love the functional programming language like a
young girl who loves the prince.

Who really takes such a girl for serious?


S. Gonzi


Vitaly Lugovsky

unread,
Jun 24, 2001, 9:46:45 AM6/24/01
to
Cyril Klimakoff <cy...@org.lviv.net> wrote:

CK> Hello All.
CK> Sorry for my poor english.
CK> I'm understand that Microsoft Corporation loves Haskell.
CK> But Please send me (if you know) one example of task where using Haskell
CK> give us really good solving of problem.
CK> Thanks.

It's good in any research and development area where you need a functional
language (especially when you need a strictly typed language). It's a
fast prototyping (where you don't need a good performance but language
features are urgent), it's all of computer algebra (symbolic math), it's
AI tasks.

Vitaly Lugovsky

unread,
Jun 24, 2001, 9:52:07 AM6/24/01
to
Cyril Klimakoff <cy...@org.lviv.net> wrote:

[...]

P.S. If you need a main purpose semi-functional language, you'll better
take a look at Objective Caml.

P.P.S. If you can read russian, check out a draft of this unfinished
article: http://ontil.ihep.su/~vsl/funprog.ps

Vitaly Lugovsky

unread,
Jun 24, 2001, 9:57:36 AM6/24/01
to
James Hague <james...@volition-inc.com> wrote:

JH> Most programming languages are general purpose in theory, but frequently
JH> have niches in which they are especially well-suited.

No. It's just because of that functional programmers are much better
educated people then commoners. So, their skills are used in unusual,
non-common areas where common solutions are unacceptable. It does not mean
that functional programming is not well situated for a general programming
(Web-design, GUIs, database applications, games, etc.)

JH> Languages without niches, like Scheme and Haskell,

Scheme already have a good niche as an embedded scripting language (take a
look at GIMP for example). Haskell works well for computer science
researchers - it's a good niche too.

Siegfried Gonzi

unread,
Jun 24, 2001, 10:27:39 AM6/24/01
to

"Vitaly Lugovsky" <war...@skeptik.net> schrieb im Newsbeitrag
news:9h4ra7$o1o$4...@inn.ihep.su...
> Cyril Klimakoff <cy...@org.lviv.net> wrote:

> P.S. If you need a main purpose semi-functional language, you'll better
> take a look at Objective Caml.

Clean is also a very impressive one and not only in speed (execution and
compile time):

http://www.cs.kun.nl/~clean/

The Clean package is free and would cost maybe a thousand dollar and more
if Clean has been developed by a "private" company.

Clean is available for Macintosh and Linux/Unix (but there are discussion
whether the Unix/Linux version should go open source or not)

It is a fact that the best free software comes from the guys at the
universities.There are seldom pearls from a hobby-programmer.


S. Gonzi


Jerzy Karczmarczuk

unread,
Jun 25, 2001, 4:47:59 AM6/25/01
to
George Russell didn't like what I addressed to Cyril Klimakoff :

> > First, please, tell us HOW MANY PAPERS about Haskell have you read.
> >
> > Have you written a single line of code in Haskell?
> >
> > Will you be able to understand the examples which we could cite?

> I think this comment is unfair. There are literally thousands of programming
> languages out there, and it's perfectly reasonable to ask for some kind of
> evidence of effectiveness before learning one.

That's alright, I didn't want really to be unnecessarily brutal.

But if somebody doesn't say anything about himself, about his needs, nor
about his experience, only asks two times in a row
"give me <<really good>> examples", what can we do for him? GR suggests JFP
I mentioned the hypatia SEL-HPC archive (if their lousy server works; too often
my humble person gets refused, I am considered to be a Web crawler. I suspect
that my wife has sometimes a similar vision of me...)

What else?

We might add Doaitse Swierstra parser combinator library. I might shamelessly
plug-in the reference to my lazy powers series or the automatic differentiation
stuff in Haskell. Cite papers of SPJ about functional approach to commercial
transactions. Mention not only JFP, but also HOSC - as far as journals are
concerned, but also all proceedings of ICFP; also: proceedings of the FPLE
conference. And dozen others.

We don't know whether Cyril works in this domain, or if he is just a client
of the Academic Network in Lvov, and what access has he to academic libraries.

He seems to be positively interested in two most dubious (with my full respect)
lines of GR:

> > Thus there are not going to be full-scale commercial
> > applications in Haskell.

> Thanks for this lines.

which are probably true, but I wouldn't bet my head, because nowadays even
in a commercial world people build not only huge, fully fledged applications,
but also small agents, scripts, integration packages, communication packages.
Are you absolutely sure that nothing of what has been written in Erlang can
be written in Haskell?

I believe that Conal Elliot Fran/PAN etc. *might* evolve into a serious,
commercial strength graphic and animation package, because the tools *are*
there already. BTW., it is a pity that the 3D modelling in Haskell, a project
developed by/with/near Colin Runciman, seems to have died.


OK, I regret accusing Cyrill of being provocative. Now I know that it was not
his aim (although there are provocative people on this forum, one of them
*had* to react, and post a useless comment about girls and princes)


Anyway, I am not sure about:



> "it's perfectly reasonable to ask for some kind of

> evidence of effectiveness [of a language] before learning one.

because if this rule dominated in other contexts, not only would we never
invent the theory of relativity, but most probably there wouldn't be
a single democratic country on Earth.

Jerzy Karczmarczuk
Caen, France

KBH

unread,
Jun 25, 2001, 4:49:52 AM6/25/01
to
Here are some sleepers that do not have any special algebraic features but
that are fast, accurate, and simple:

PB Basic 32 bit Win compilers for console mode or for DLLs. Fast and
accurate.

PB Basic for DOS. Current full feature or (older) shareware.

Delphi 5 Standard has a console mode and will also create DLLs. About $100.

Borland C++ Win compiler. Free.

Forte Fortran and C++ for Unix ?

Markus E Leypold

unread,
Jun 25, 2001, 5:02:34 AM6/25/01
to
"Cyril Klimakoff" <cy...@org.lviv.net> writes:

Ah. I think this tells a lot about the purpose behind that
posting. Apart from the fakt, that nnobody can look into the future
...

Regards -- M E L


Markus E Leypold

unread,
Jun 25, 2001, 5:05:40 AM6/25/01
to
"Siegfried Gonzi" <siegfri...@kfunigraz.ac.at> writes:


On the other side: What's about the attitude of: 'hey, you, functional
programmers! what you're doing has no future. am I right?'.

Siegfried Gonzi

unread,
Jun 25, 2001, 7:23:59 AM6/25/01
to
"Markus E Leypold" <ley...@informatik.uni-tuebingen.de> schrieb im
Newsbeitrag

> On the other side: What's about the attitude of: 'hey, you, functional
> programmers! what you're doing has no future. am I right?'.

[I look forward the day when someone comes and say: Let us give the nobel
price the guy who program exclusively functional. It doesn't matter what
results he will produce important only is that he programs
functional].

What I really believe is that C++ and Java will have no future. I mean that
how I say it.

What I haven't unterstand (since I know about functional programming) so far
is the fact that some are so upset when someone else says something
discriminating about functional programming.

It remembers me on a chicken-farm: The fox comes in states something
critical about functional programming and all the chicken get upset.


S. Gonzi


Ulf Wiger

unread,
Jun 25, 2001, 8:10:20 AM6/25/01
to
>>>>> "-" == Cyril Klimakoff <cy...@org.lviv.net> writes:

>> Thus there are not going to be full-scale commercial
>> applications in Haskell.

-> Thanks for this lines.

Well, there might not be full-scale commercial applications,
depending on what you read into the phrase.

Check out http://www.galconn.com/
From what I can tell, it's a company that puts Haskell to good
use, making money in the process. To me, this is a commercial
application, and assuming they don't get paid in Monopoly money,
it's also full scale. Given what they do, it's not obvious that
there are more suitable tools than Haskell out there.

/Uffe
--
Ulf Wiger tfn: +46 8 719 81 95
Senior System Architect mob: +46 70 519 81 95
Strategic Product & System Management ATM Multiservice Networks
Data Backbone & Optical Services Division Ericsson Telecom AB

Jerzy Karczmarczuk

unread,
Jun 25, 2001, 8:24:07 AM6/25/01
to
Siegfried Gonzi:


> What I haven't unterstand (since I know about functional programming) so far
> is the fact that some are so upset when someone else says something
> discriminating about functional programming.
>
> It remembers me on a chicken-farm: The fox comes in states something
> critical about functional programming and all the chicken get upset.
>
> S. Gonzi

Let us clarify a few points.

1. The "fox" S. Gonzi confessed two years ago (Clean list)
(http://www.cs.kun.nl/pipermail/clean-list/1999/000981.html)
that he is a newcomer to the FP world. He began by complaining
why the "standard" (lousy, with exponential complexity) Fibonacci
algorithm is so slow, and asked:

> And now for myself I am thrown wheter I should make the next step and
> learn Clean or I should go back to Fortran and Basic (and IDL).

I still remember it, because I didn't forget the good laugh I had when
in a further posting S. Gonzi complained that Maple evaluates this lousy
Fibonacci "in real time" using the naive algorithm.
Our "fox" didn't know that Maple has an automatic memoization mechanism...

x. Hmmmm. "fox"? Or shall I cite : "Ich bin zahlender Tierschuetzer..."
(see a not so elegant argument here, in German:
http://www.newsgate.at/at/at.anzeigen.diskussion/msg00005.html
which suggests that Monsieur Gonzi ENJOYS senseless quarrels.)


2. Almost everybody criticizes Functional programming. Some people hate
the constraints of strong typing as they exist now. Other protest against
the laziness (or at least against not-so-perfect strictness analysers).
Yet others are abhorred by all this monadic stuff which makes it hard
to throw an easy conceptual bridge between, say, Haskell, and imperative
programming.

Usually those people TRIED TO DO SOMETHING THEMSELVES. I still wait
to see something authored by SG.

3. "It remembers" me a chicken farm. A rabbit comes in, disguised as a fox.
He says "All you, chicken are useless, and difficult to digest. And you
have no sex-appeal, so no reason to be so upset, when I tell you The
Truth. Perhaps I should go back and visit my friends toads."
The chicken laugh, some of them get annoyed, hearing this for the
5th time. Unfortunately the rabbit doesn't want to understand that,
and the story continues. In two years he will pretend to be a tiger.

4. Serious people on this forum usually ignore silly, unjustified criticisms.
But I am not too serious. And I know, that we have here not only some
beginners who pretend to know something, not only about FPL, but also
about the psychology of people working in this domain --
-- but also some beginners who want to acquire some knowledge. They
shouldn't be discouraged by the first mentioned category, and I will
fight against those Spielverderbers. I will store every ridiculous
statement ever pronounced, and throw it back when those fellows will
try to acquire some professional notoriety.

Jerzy Karczmarczuk
Caen, France

Markus Mottl

unread,
Jun 25, 2001, 8:29:34 AM6/25/01
to
Siegfried Gonzi <siegfri...@kfunigraz.ac.at> wrote:
> What I haven't unterstand (since I know about functional programming) so far
> is the fact that some are so upset when someone else says something
> discriminating about functional programming.

> It remembers me on a chicken-farm: The fox comes in states something
> critical about functional programming and all the chicken get upset.

^^^+^^^^
|

There is a difference between "critical" and "justified". It's rather
doubtful practice to enter a newsgroup and make claims that are neither
based on theoretical knowledge nor on practical experience. If people
informed themselves before making their thoughts public, nobody would
feel upset. It's only a matter of looking around in the web if you want
to find examples of "large", also commercial applications written in
functional languages. E.g. take a look at this page:

http://www.ocaml.org/users_programs-eng.html

Regards,
Markus Mottl

--
Markus Mottl, mo...@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl

Iain McNaughton

unread,
Jun 25, 2001, 7:20:13 AM6/25/01
to
>>
>> Cyril Klimakoff writes:
>>
>> > ... Please send me (if you know) one example of task where using Haskell
>> > give us really good solving of problem.
>> > Thanks.
>>

Dear Cyril,

I can't speak for the general Haskell community, but I can tell you that
we use Haskell to write tools for time series analysis. Why ? Because we
can simply "write down" the formulae we need, and that's *already* a
Haskell script. Also, Haskell's list structure suits us very well.

Two previous attempts at building a time series analysis toolbox for our
business resulted in abject failure, and a *lot* of wasted time and
resources. Writing in Haskell, we were able to have a prototype working
in a matter of days.

Overall, Haskell seems to work well for us. We've been able to develop
what we need breath-takingly fast, and in a way that matches the way we
do business. If I had to bet on the "next big thing", it would be either
Haskell or Clean; functional programming works !

All the best,

Iain McNaughton.

--
Iain McNaughton

Martin Wierich

unread,
Jun 25, 2001, 9:51:05 AM6/25/01
to
Vitaly Lugovsky wrote:
> No. It's just because of that functional programmers are much better
> educated people then commoners.

I just can't stand statements like this one.

-- Martin

James Hague

unread,
Jun 25, 2001, 9:53:39 AM6/25/01
to
Vitaly Lugovsky wrote:
>
> JH> Most programming languages are general purpose in theory, but
frequently
> JH> have niches in which they are especially well-suited.
>
> No. It's just because of that functional programmers are much better
> educated people then commoners. So, their skills are used in unusual,
> non-common areas where common solutions are unacceptable. It does not mean
> that functional programming is not well situated for a general programming
> (Web-design, GUIs, database applications, games, etc.)

In a way it does, though. Common applications depend more on particulars
than the language. One of the things that makes Perl so useful is that
regular expressions are built into the language in a fundamental way.
Delphi is also a great tool because the GUI building aspect is very well
thought out. While Haskell can do everything that Perl and Delphi can, it
isn't as easy to use for those applications. It has nothing to do with the
underlying language model.

I've noticed that "better educated" often means "less willing to do the ugly
grunge work that makes 90% of all programs useful," so one needs to be
careful. My favorite example is the Crash Bandicoot series of games for the
PlayStation. The developers graduated from MIT and had a penchant for Lisp.
They wrote their own Lisp system to use for scripting the game. But at the
same time they wrote the rest of the game in C and assembly. They didn't
try to force-fit Lisp to that area.

Siegfried Gonzi

unread,
Jun 25, 2001, 10:01:24 AM6/25/01
to
"Jerzy Karczmarczuk" <kar...@info.unicaen.fr> schrieb im Newsbeitrag
news:3B372D67...@info.unicaen.fr...

> Let us clarify a few points.

You know what I think about young girls?

I will put you in my killfile ("Schwachsinn kann ich in der Zeitung auch
lesen").

S. Gonzi


George Caswell

unread,
Jun 25, 2001, 11:26:04 PM6/25/01
to
On Fri, 22 Jun 2001, Cyril Klimakoff wrote:

> "Vitaly Lugovsky" <war...@skeptik.net> wrote in message
> news:9gsvnp$s6p$1...@inn.ihep.su...
> > Cyril Klimakoff <cy...@org.lviv.net> wrote:
> > CK> Hello peoples.
> > CK> I see anything never perspecitve for this language.
> >
> > Microsoft Research loves it. Isn't it a good perspective? ;)
> >

> Hello All.
> Sorry for my poor english.
> I'm understand that Microsoft Corporation loves Haskell.
> But Please send me (if you know) one example of task where using Haskell
> give us really good solving of problem.

I really like the examples on parsers and infinite streams like the
Fibonnacci sequence. I think lazy eval and streams are a great tool for
representing problems like that, stuff that's conceptually infinite or that
should be evaluated only as it's needed. Also a language like C or C++ is
really not equipped for working with functions as objects or partial
application of functions.

I think what I said right there about C/C++ is like saying a tank doesn't
make a very good fighter jet. Different tools for different needs. Just like
nobody in their right mind would write a parser for any kind of complicated
language in C without a very, very good reason.

---GEC
Projects page: http://tetsujin.sourceforge.net/
(M-x depeche-mode)
"Porque mañana a lo mejor hay un entierro"

Steve Wray

unread,
Jun 25, 2001, 11:45:15 PM6/25/01
to
Just as soon as I work out how to run a unix command from haskell
(eg using system)
and take the stdout of that command into my haskell progran (as a string)
I will be free of Perl and will use haskell for system work.

Perl doesn't even have a list membership function... crazy huh?

To do simple things in Perl requires a LOT of superfluous syntax and
hazy semantics.

In Haskell one could write very simple shell scripts using map's and filters
(eg).

How about mapping a unix command down a list of command-line arguments
(with the expectation that this command will be run with each command-line
in turn)?

map (system "du") [" -h"," -sh"]
for example?
:)

George Caswell

unread,
Jun 26, 2001, 1:55:43 AM6/26/01
to
On Tue, 26 Jun 2001, Steve Wray wrote:

> Just as soon as I work out how to run a unix command from haskell
> (eg using system)
> and take the stdout of that command into my haskell progran (as a string)
> I will be free of Perl and will use haskell for system work.

> In Haskell one could write very simple shell scripts using map's and filters


> (eg).
>
> How about mapping a unix command down a list of command-line arguments
> (with the expectation that this command will be run with each command-line
> in turn)?
>
> map (system "du") [" -h"," -sh"]
> for example?

Not a clue... There's the System module, which lets you run a command and
get its error return value... but it doesn't give you the program's output...
Might have to patch the interpreter system to implement an fopen() type
function... or something...

I'm not sure if the Haskell evaluation rules would necessitate monad-ifying
the command execution to keep the side-effects in check.

Markus Mottl

unread,
Jun 26, 2001, 5:18:52 AM6/26/01
to
Steve Wray <ste...@wetafx.co.nz> wrote:
> Just as soon as I work out how to run a unix command from haskell
> (eg using system)
> and take the stdout of that command into my haskell progran (as a string)
> I will be free of Perl and will use haskell for system work.

Or if you can't wait any longer, you might want to try OCaml in the
meanwhile, which comes with a fully-fletched Unix-library (correctly
emulated on non-Unix platforms).

> How about mapping a unix command down a list of command-line arguments
> (with the expectation that this command will be run with each command-line
> in turn)?

> map (system "du") [" -h"," -sh"]
> for example?
> :)

Or try this working example with OCaml (only needs to be linked with
the Unix-library; one can very easily create stand-alone interpreters
that already contain it):

---------------------------------------------------------------------------
open Unix

let print_ic ic =
try while true do print_endline (input_line ic) done
with End_of_file -> ()

let _ =
let du_args = ["-h"; "-sh"] in
let dus = List.map ((^) "du ") du_args in
let du_ics = List.map open_process_in dus in
List.iter print_ic du_ics;
List.iter (fun ic -> ignore (close_process_in ic)) du_ics
---------------------------------------------------------------------------

George Russell

unread,
Jun 26, 2001, 6:04:19 AM6/26/01
to
Steve Wray wrote:
>
> Just as soon as I work out how to run a unix command from haskell
> (eg using system)
> and take the stdout of that command into my haskell progran (as a string)
> I will be free of Perl and will use haskell for system work.
It's possible in Glasgow Haskell, but not very nice. You need to use the
Posix modules. Some code where it's done looks like this:

(readStdIn,writeStdIn) <- createPipe
(readStdOut,writeStdOut) <- createPipe
mprocessID <- Posix.forkProcess
case mprocessID of
Just processId ->
do -- parent process
let destroyAct = signalProcess sigKILL processId
threadWaitRead(fdToInt readStdOut)
result <- fdRead readStdOut 1
if (result /= ("#",1))
then
error "RunWish bug 1"
else
do
newWish writeStdIn readStdOut destroyAct

Nothing ->
do
dupTo readStdIn stdInput
dupTo writeStdOut stdOutput
nbytes <- fdWrite writeStdOut "#"
if(nbytes/=1)
then
error "RunWish bug 2"
else
done
Posix.executeFile wishPath False [] Nothing
error "executeFile for wish failed"
wishPath is the path of the "wish" program which is being run. Basically you have to
do what the Unix shell does, namely fork the process, fiddle aroudn with pipes to reconnect
stdout and stdin in the child process, and exec the command. I forget why you write the
hash character along the stdOut channel before getting going (wonderful comment, eh?),
but if you leave that bit out it doesn't work . . .

Pixel

unread,
Jun 26, 2001, 7:56:18 AM6/26/01
to
Steve Wray <ste...@wetafx.co.nz> writes:

> Just as soon as I work out how to run a unix command from haskell
> (eg using system)
> and take the stdout of that command into my haskell progran (as a string)
> I will be free of Perl and will use haskell for system work.
>
> Perl doesn't even have a list membership function... crazy huh?
>
> To do simple things in Perl requires a LOT of superfluous syntax and
> hazy semantics.
>
> In Haskell one could write very simple shell scripts using map's and filters
> (eg).

perl doesn't have "member" (but it has hashes or ``if (grep { ... } @l) { ... }'')
but it has a lot of simple stuff that make it useful an command-line:
- no difference between ints, floats and strings:
perl -ne '$i += $_; END { print "$i\n" }'
perl -ane '$i += $F[1]; $n++; END { printf "%0.2f\n", $i / $n }'
- real string handling
perl -pi -e 's/foo/bar/g' file
try testing if a string ends with a given suffix in haskell
- IMO, shells are mostly imperative stuff where monads are going to be tedious
to use.

Using haskell for system tasks is a dream. I think it's the worse use of
haskell ;p


cu Pixel (who don't like perl being criticize the wrong way :)

PS: and be careful, perl is one of the more functional oriented scripting
language...


--
Posted from office.mandrakesoft.com [195.68.114.34]
via Mailgate.ORG Server - http://www.Mailgate.ORG

Yoann Padioleau

unread,
Jun 26, 2001, 11:26:23 AM6/26/01
to
Steve Wray <ste...@wetafx.co.nz> writes:

> Just as soon as I work out how to run a unix command from haskell
> (eg using system)
> and take the stdout of that command into my haskell progran (as a string)
> I will be free of Perl and will use haskell for system work.
>
> Perl doesn't even have a list membership function... crazy huh?

you can write it. people invent functions to do that kind of things :))
sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 }


>
> To do simple things in Perl requires a LOT of superfluous syntax and
> hazy semantics.

yes, sometimes it is true, but you have the same kind of problem in haskell.
if you want a global variable (in perl we write $i = 1; ... $i = 2; ...
which is quite simple) in haskell you are forced to use monad that make the things
complicated.


>
> In Haskell one could write very simple shell scripts using map's and filters
> (eg).
>
> How about mapping a unix command down a list of command-line arguments
> (with the expectation that this command will be run with each command-line
> in turn)?
>
> map (system "du") [" -h"," -sh"]
> for example?
> :)

you can do that in perl too. do you really know perl ??
map { `du $_` } ("-h", "-sh")
but what you have written is not valid haskell. do you really know haskell ??

--
Yoann Padioleau, INSA de Rennes, France, http://www.irisa.fr/prive/padiolea
Opinions expressed here are only mine. Je n'écris qu'à titre personnel.
**____ Get Free. Be Smart. Simply use Linux and Free Software. ____**

James Hague

unread,
Jun 26, 2001, 12:01:38 PM6/26/01
to
Steve Wray wrote:
>
> To do simple things in Perl requires a LOT of superfluous syntax and
> hazy semantics.

That completely depends on what you want to do. If you want to scan through
a file using regular expressions, the Perl solution is about as simple as
they come. This searches through standard input looking for the string
"Haskell":

while(<>) {
print if /Haskell/;
}

You can remove the first and third lines if you run the script with the "-n"
switch. I think too much time is wasted bashing Perl. Certainly it lets
many common tasks be done quickly and portably, even if it doesn't fit a
computer scientist's definition of elegant.

Vitaly Lugovsky

unread,
Jun 26, 2001, 1:36:12 PM6/26/01
to
Martin Wierich <mar...@cs.kun.nl> wrote:

>> No. It's just because of that functional programmers are much better
>> educated people then commoners.

MW> I just can't stand statements like this one.

Why? Functional programming is always a part of any university course.
So, functional programmer = educated programmer. All others are only schumks
who have read "Microsoft Visual Basic for dummies" and thinks they're c00l
hackirz.

Vitaly Lugovsky

unread,
Jun 26, 2001, 1:58:07 PM6/26/01
to
James Hague <james...@volition-inc.com> wrote:

>> No. It's just because of that functional programmers are much better
>> educated people then commoners. So, their skills are used in unusual,
>> non-common areas where common solutions are unacceptable. It does not mean
>> that functional programming is not well situated for a general programming
>> (Web-design, GUIs, database applications, games, etc.)

JH> In a way it does, though. Common applications depend more on particulars
JH> than the language. One of the things that makes Perl so useful is that
JH> regular expressions are built into the language in a fundamental way.

As for me, this feature of Perl never was not so urgent - I used Perl
only 'cause of CPAN - and nothing more. This language itself is a pile of
trash.

JH> Delphi is also a great tool because the GUI building aspect is very well
JH> thought out.

Really? How can you call something without layout manager a "GUI"?!?
No. It's not a GUI builder. But not-so-good-educated-people-reading-PCMag-
and-so-on believes that it's a GUI builder.

JH> While Haskell can do everything that Perl and Delphi can, it
JH> isn't as easy to use for those applications. It has nothing to do with the
JH> underlying language model.

Why? It really can do it all in a much better way. But no one wants it do
to so - it's not so interesting to put a Haskell on a Perl place - Haskell
hacker prefer to work on something like functional images, compilers, and
all that bleeding-edge science.

JH> I've noticed that "better educated" often means "less willing to do the ugly
JH> grunge work that makes 90% of all programs useful,"

It's a doom of any education. Good scientist never wants to do engeneering
jobs, so there are no engeneers who knows underlying science well.

JH> so one needs to be
JH> careful. My favorite example is the Crash Bandicoot series of games for the
JH> PlayStation. The developers graduated from MIT and had a penchant for Lisp.
JH> They wrote their own Lisp system to use for scripting the game. But at the
JH> same time they wrote the rest of the game in C and assembly. They didn't
JH> try to force-fit Lisp to that area.

Sure - games is a C/asm domain, and nothing can kick 'em off. But
educated programmer knows well which language is better for a particular
task - and c00l hackirz newer knows it.

Vitaly Lugovsky

unread,
Jun 26, 2001, 2:12:27 PM6/26/01
to
KBH <K...@notmail.com> wrote:

K> PB Basic 32 bit Win compilers for console mode or for DLLs. Fast and
K> accurate.

What do you want to say with all this?

Yoann Padioleau

unread,
Jun 26, 2001, 1:30:51 PM6/26/01
to
Vitaly Lugovsky <war...@skeptik.net> writes:

> James Hague <james...@volition-inc.com> wrote:
>
> >> No. It's just because of that functional programmers are much better
> >> educated people then commoners. So, their skills are used in unusual,
> >> non-common areas where common solutions are unacceptable. It does not mean
> >> that functional programming is not well situated for a general programming
> >> (Web-design, GUIs, database applications, games, etc.)
>
> JH> In a way it does, though. Common applications depend more on particulars
> JH> than the language. One of the things that makes Perl so useful is that
> JH> regular expressions are built into the language in a fundamental way.

now there is a regexp library for nearly every functionnal langage (ocaml, haskell, ...) that
fill the gap.

Garry Hodgson

unread,
Jun 26, 2001, 3:06:03 PM6/26/01
to
Vitaly Lugovsky wrote:
>
> Martin Wierich <mar...@cs.kun.nl> wrote:
>
> >> No. It's just because of that functional programmers are much better
> >> educated people then commoners.
>
> MW> I just can't stand statements like this one.
>
> Why? Functional programming is always a part of any university course.
> So, functional programmer = educated programmer. All others are only schumks
> who have read "Microsoft Visual Basic for dummies" and thinks they're c00l
> hackirz.

grow up.

--
Garry Hodgson sometimes we ride on your horses
Senior Hacker sometimes we walk alone
Software Innovation Services sometimes the songs that we hear
AT&T Labs are just songs of our own
ga...@sage.att.com

Markus Mottl

unread,
Jun 26, 2001, 4:48:50 PM6/26/01
to
James Hague <james...@volition-inc.com> wrote:
> That completely depends on what you want to do. If you want to scan through
> a file using regular expressions, the Perl solution is about as simple as
> they come. This searches through standard input looking for the string
> "Haskell":

> while(<>) {
> print if /Haskell/;
> }

Such things can _easily_ be replicated with nice syntax using
combinators. Want an example? E.g.:

Define this in a library:

open Pcre
let if_matches pat action line = if pmatch ~pat line then action line

Then you can write things like:

foreach_line (if_matches "Haskell" print_endline)

If you replace "Haskell" by Sys.argv.(1), then you have a fully working
poor man's "grep"...

> You can remove the first and third lines if you run the script with the
> "-n" switch. I think too much time is wasted bashing Perl.

Nah, never! :-)

> Certainly it lets many common tasks be done quickly and portably,
> even if it doesn't fit a computer scientist's definition of elegant.

It's very doubtful to me that "doing many common tasks quickly and
portably" is only possible with Perl...

James Hague

unread,
Jun 26, 2001, 5:03:43 PM6/26/01
to
X-archive-no: yes

Markus Mottl wrote:
>
> It's very doubtful to me that "doing many common tasks quickly and
> portably" is only possible with Perl...

You're reading my statement in too defensive a way, Markus. I didn't say
anything about other languages, only that some things are easy in Perl.
That was in response to Steve Wray's comment that "To do simple things in
Perl requires a LOT of superfluous syntax," which seems to be based more on
a general dislike for Perl than anything else.

Markus Mottl

unread,
Jun 26, 2001, 5:49:21 PM6/26/01
to
James Hague <james...@volition-inc.com> wrote:
> You're reading my statement in too defensive a way, Markus. I didn't
> say anything about other languages, only that some things are easy
> in Perl.

Some things are always easy in any language.

I wouldn't say that Perl cannot be useful, but that it is hardly
technically superior over modern languages for anything but very trivial
tasks. And often not even for those. Defending Perl for it allowing
"cool" trivial programs has no merit...

> That was in response to Steve Wray's comment that "To do simple things
> in Perl requires a LOT of superfluous syntax," which seems to be based
> more on a general dislike for Perl than anything else.

Implement a "simple" binary tree + a few associated algorithms in Perl
without looking into any manual, and then tell me again that it doesn't
require superfluous (not to say "awkward") syntax for simple tasks.

Myown Trueself

unread,
Jun 26, 2001, 7:20:16 PM6/26/01
to
[snip]

> > How about mapping a unix command down a list of command-line arguments
> > (with the expectation that this command will be run with each
command-line
> > in turn)?
> >
> > map (system "du") [" -h"," -sh"]
> > for example?
> > :)
> you can do that in perl too. do you really know perl ??

Not at all, it seems a bit... dense. I'm trying to avoid it.

> map { `du $_` } ("-h", "-sh")
> but what you have written is not valid haskell. do you really know haskell
??

Its pseudocode
It would actually need some fudging with ++ and I couldn't
be bothered.

Tom Moertel

unread,
Jun 26, 2001, 8:45:27 PM6/26/01
to

Markus Mottl wrote:
>
> Implement a "simple" binary tree + a few associated algorithms in Perl
> without looking into any manual, and then tell me again that it doesn't
> require superfluous (not to say "awkward") syntax for simple tasks.

Here's a Perl/Haskell comparison that I recently made using the theme of
"cheating hangman," a variation on the classic game hangman. I wrote
one version in Perl and another in Haskell. The high-level logic is the
same in both implementations, but each uses the idioms of its respective
language.

http://www.ellium.com/~thor/hangman/cheating-hangman.pl Perl
http://www.ellium.com/~thor/hangman/cheating-hangman.lhs Haskell
http://www.ellium.com/~thor/hangman/cheating-hangman.pdf Typeset lhs

I'm a longtime Perl hacker, but I must confess to liking the Haskell
version better. It's cleaner, and the program's logic is easier to
follow. For example, compare the Perl version of the "cscore" function
with the Haskell version:

Perl

sub cscore {
my ($guesses, $words) = @_;
my $score = 0;
$score += keys %{{ /(([^$guesses ]))/g }} for @$words;
return $score;
}

Haskell

cscore :: Guesses -> Words -> Int
cscore gs = sum . map (length.group.sort.filter(`notElem`gs))

You have to be familiar with Perl esoterica to decipher the former,
where I suspect that most Haskell programmers could reason about what
the second version is doing. Nevertheless, I didn't feel that anything
in the Perl implementation was excessively contorted or difficult to
follow (provided you are familiar with Perlish idioms).

Cheers,
Tom

KBH

unread,
Jun 26, 2001, 11:46:08 PM6/26/01
to
The discussion became very language general. My emphasis was availability of
fast compilers for computations (without concern for any type of GUI
programming).

How is your response only concered with one paragraph of my post ?

Markus Mottl

unread,
Jun 27, 2001, 6:35:35 AM6/27/01
to
Tom Moertel <tom-...@moertel.com> wrote:
> I'm a longtime Perl hacker, but I must confess to liking the Haskell
> version better. It's cleaner, and the program's logic is easier to
> follow. For example, compare the Perl version of the "cscore" function
> with the Haskell version:
[snip]

> cscore gs = sum . map (length.group.sort.filter(`notElem`gs))

Or even shorter:

cscore gs = sum.map(\w->length$group$sort$w\\gs)

> You have to be familiar with Perl esoterica to decipher the former,
> where I suspect that most Haskell programmers could reason about what
> the second version is doing. Nevertheless, I didn't feel that anything
> in the Perl implementation was excessively contorted or difficult to
> follow (provided you are familiar with Perlish idioms).

Even though one can write tremendously short code in Haskell, I still
prefer _readable_ code and especially the latter is very difficult
to achieve in Perl if you also want brevity. I'd actually write your
example using a list comprehension (and more white space, of course)
to improve readability:

cscore gs ws = sum [ length $ group $ sort $ w \\ gs | w <- ws ]

This solution is still smaller than your's module whitespace (only
requires one char more than the shortest solution module whitespace), but
greatly improves understanding: it explicitly shows all required arguments
(no currying), does not require a higher-order function (map) and no
function composition ("$", function application, is easier to follow).

Once again, the question is not whether one can write terse code, but
whether one can write _readable_ terse code.

Vitaly Lugovsky

unread,
Jun 27, 2001, 7:56:51 AM6/27/01
to
KBH <K...@notmail.com> wrote:
K> The discussion became very language general. My emphasis was availability of
K> fast compilers for computations (without concern for any type of GUI
K> programming).

You mean numerical computations? Use Fortran. It's the best forever.

Jerzy Karczmarczuk

unread,
Jun 27, 2001, 7:13:59 AM6/27/01
to
The discussion began with some statement about university people being more
educated than "commoners". It continues...

Vitaly Lugovsky commenting James Hague:

> JH> I've noticed that "better educated" often means "less willing to do the ugly
> JH> grunge work that makes 90% of all programs useful,"
>
> It's a doom of any education. Good scientist never wants to do engeneering
> jobs, so there are no engeneers who knows underlying science well.


Sure, this newsgroup as any other is not free of people who love strong
statements
just to make noise.

This one has a particular view of the word "education". I would dismiss it, but
seeing that V.S. L. home page is hosted by the Institute for High Energy
Physics,
and reading that according to him "Good scientist never wants to do engineering
jobs", I begin to wonder... Almost all Nobel prizes in particle physics are
based
on hard engineering job, even in particle theory (look the amount of technical
computations in papers of 't Hooft and Veltman). And I am not even mentioning
experimental physics (Nobel for streamer chambers, for the equipment permitting
to
discover the cosmic background radiation, for the computerized tomography, etc.)

I am afraid that teachers of Vitaly Lugovsky failed very badly...

Perhaps V.S. L. wants just to be funny? Fun and FUNctional programming should
go together. So let's enjoy his postings. And his personal ads, for example
something picked from his home page, about his (apparently non-existing; the
link goes to an empty page) project:

> Chaos Collection project. It is in a pre-alpha stage, but soon it'll be a good
> swarm of Genetic and Evolution modelling software, which will show that
> christians and other creationists are all morons and must be punished to death.

Seems that the most funny "science" ever invented, called Marxism is still
alive.
Good! But please, not *all* engineers should be shot. Not yet (unless, of
course,
they are christian).

Jerzy Karczmarczuk
Caen, France

PS. A cute ehm, philosophical quotation seems appropriate here. Mark Twain:

"If a vegetarian eats vegetables,
what does a humanitarian eat?"

Koen Claessen

unread,
Jun 27, 2001, 9:48:43 AM6/27/01
to Markus Mottl
Tom Moertel <tom-...@moertel.com> wrote:

| cscore gs = sum . map (length.group.sort.filter(`notElem`gs))

Markus Mottl replied:

| cscore gs ws = sum [ length $ group $ sort $ w \\ gs | w <- ws ]

I do not know if you realize this, but these functions are
not equivalent. ((\\) only removes one occurrence of every
element.)

The following code snippet demonstrates that:

>>>
import List
import QuickCheck

cscoreTom gs = sum . map (length.group.sort.filter(`notElem`gs))
cscoreMarkus gs ws = sum [ length $ group $ sort $ w \\ gs | w <- ws ]

prop_Cscores :: [Int] -> [[Int]] -> Bool
prop_Cscores gs ws =
cscoreTom gs ws == cscoreMarkus gs ws
<<<

Running in Hugs:

>>>
Main> quickCheck prop_Cscores
Falsifiable, after 4 tests:
[-5,-4,-3,-2]
[[],[4,-4,-5,1,-4],[]]
<<<

Of course, this situation might not actually matter for the
application, but I have no idea what "cheating hangman" is.

/Koen.

Markus Mottl

unread,
Jun 27, 2001, 9:59:23 AM6/27/01
to
Koen Claessen <ko...@cs.chalmers.se> wrote:
> I do not know if you realize this, but these functions are not
> equivalent. ((\\) only removes one occurrence of every element.)

Damn, right, I should program Haskell more often. I thought that it also
worked on multisets. Should have read the package insert...

In any case, the list comprehension version can be easily corrected and
still looks nicer (= more readable) than the original one.

Regards,
Markus

Stefan Axelsson

unread,
Jun 27, 2001, 10:49:33 AM6/27/01
to
In article <3b39e4c0$1...@corp.newsgroups.com>,
James Hague <james...@volition-inc.com> wrote:

>Obviously Perl has *some* merit, or else no one would be using it.

Are we now resorting to the ''ten million flies can't be wrong'' argument
here on c.l.f? That's stooping a bit low, isn't it? ;-) ;-)

(Some cheap shots are too got to resist, sorry.)

Stefan,
--
Stefan Axelsson (For mail address see: http://www.ce.chalmers.se/staff/sax)

Tom Moertel

unread,
Jun 27, 2001, 11:16:00 AM6/27/01
to

Markus Mottl wrote:
>
> In any case, the list comprehension version can be easily corrected and
> still looks nicer (= more readable) than the original one.

Whether map or list comprehension is more readable is a subjective
call. In this case, I used map because I felt that it *was* the more
readable of the two. It communicates my intention precisely, where a
list comprehension would have placed the burden of determining my
intention on the reader:

cscore gs = sum . map (length . group . sort . filter (`notElem`gs))

cscore gs ws = sum [ length $ group $ sort $ filter (`notElem`gs) w
| w <- ws ]

In the latter implementation, the reader must examine the comprehension
to determine that the intended behavior is to generate an output element
for each and every element in ws, in turn, and not some subtle
variation. Fortunately, the standard defines a function that provides
exactly this behavior: map. When map's behavior is called for, I think
it is best to use map. It communicates my intention concisely and
precisely.

I'm not alone in this feeling. If you look at the Haskell Report and
the Standard Prelude, where I think it is reasonable to assume that
clarity was a primary goal, you'll see that list comprehensions are
almost never used to provide map's behavior. Map is used for mapping;
list comprehensions are reserved for more complex behavior.

I'm pointing this out to show that the "looks nicer (= more readable)"
viewpoint is largely subjective. Different folks have different
viewpoints. One size does not fit all. ;-)

Cheers,
Tom

James Hague

unread,
Jun 27, 2001, 11:46:08 AM6/27/01
to
Stefan Axelsson wrote:
>
> Are we now resorting to the ''ten million flies can't be wrong'' argument
> here on c.l.f? That's stooping a bit low, isn't it? ;-) ;-)
>
> (Some cheap shots are too got to resist, sorry.)

Well, I asked for it :)

My view is this: I have a computer science degree. I program
professionally in C and C++, but I also have a good knowledge of a variety
of functional languages. For some projects, I would choose Erlang or OCaml
or J over C, without hesitation. But I still find that Perl is a good
language for some things. I want to jump on the "Perl is ugly!" bandwagon
sometimes, but it isn't worth ignoring its usefulness. I don't see the
point in holding a grudge against it. There's too much angst in various
language communities as it is.

George Russell

unread,
Jun 27, 2001, 12:12:22 PM6/27/01
to
Tom Moertel wrote:
[snip]

> Whether map or list comprehension is more readable is a subjective
> call. In this case, I used map because I felt that it *was* the more
> readable of the two. It communicates my intention precisely, where a
> list comprehension would have placed the burden of determining my
> intention on the reader:
>
> cscore gs = sum . map (length . group . sort . filter (`notElem`gs))
>
> cscore gs ws = sum [ length $ group $ sort $ filter (`notElem`gs) w
> | w <- ws ]
[snip]
A plague on both your houses! Why is it we castigate C programmers who
try to cram the entire program into one line, but then do the same in
Haskell? OK, maybe in theory it's easier to figure out, because everything
is pure, but you still need to rack your brain to work out what's going on.
I for one cannot remember what "group" does, so that at least needs to be
cleared up.

I think we ought to try to keep to one comprehensible idea per line. Remember
it's very hard for the human brain to comprehend more than about 6 objects at
a time. The sentence "Oysters oysters oysters split split split." may be
grammatical, but it is still hard to understand.

It really is high time we revived the Obfuscated Haskell Contest. Indeed,
Glasgow Haskell/Hugs extensions such as CPP preprocessing, multiparameter
overlapping type classes, and existential/forall types look to me like
great aids to the obfuscator. Anyone interested?

Stephen J. Bevan

unread,
Jun 27, 2001, 1:48:02 PM6/27/01
to
George Russell <g...@tzi.de> writes:
> > cscore gs = sum . map (length . group . sort . filter (`notElem`gs))
> >
> > cscore gs ws = sum [ length $ group $ sort $ filter (`notElem`gs) w
> > | w <- ws ]
> [snip]
> A plague on both your houses! Why is it we castigate C programmers who
> try to cram the entire program into one line, but then do the same in
> Haskell? OK, maybe in theory it's easier to figure out, because everything
> is pure, but you still need to rack your brain to work out what's going on.
> I for one cannot remember what "group" does, so that at least needs to be
> cleared up.
>
> I think we ought to try to keep to one comprehensible idea per line.

Do you have a suggested rendition of the above that you consider more
comprehensible than either?

Joachim Durchholz

unread,
Jun 27, 2001, 3:04:55 PM6/27/01
to
Vitaly Lugovsky <war...@skeptik.net> wrote:
> Martin Wierich <mar...@cs.kun.nl> wrote:
>
> >> No. It's just because of that functional programmers are much
> >> better educated people then commoners.
>
> MW> I just can't stand statements like this one.
>
> Why? Functional programming is always a part of any university
> course. So, functional programmer = educated programmer.

The assumption you're making is that education is important for the
quality of a programmer. I think the two are correlated but not too
strongly, and if that's true it's too harsh to dismiss all self-taught
programmers as incompetent VB geeks. (Actually it's an insult to all
self-taught competent programmers, and I know that these exist as some
of them happen to be my friends. So please watch your language.)

Regards,
Joachim
--
This is not an official statement from my employer.


Koen Claessen

unread,
Jun 27, 2001, 3:17:11 PM6/27/01
to George Russell
George Russell wrote:

| I think we ought to try to keep to one comprehensible
| idea per line. Remember it's very hard for the human
| brain to comprehend more than about 6 objects at
| a time.

I agree with this up to a certain extend. One should not be
unnecessarily short.

One reason why people (students) find Haskell difficult and
frustrating, is that they can stare at a program of about
half a page for a long time, and still have difficulties
understanding it.

They say: A C program of similar length would have been much
more understandable.

They forget that a C program implementing the same thing
might not even fit on one page, thereby loosing the
overview.

In other words: one should learn to read programs in a
slower pace.

| The sentence "Oysters oysters oysters split split
| split." may be grammatical, but it is still hard to
| understand.

Indeed, I find that hard to understand. :-) I am curious,
what does the sentence mean?

/Koen.

--
Koen Claessen http://www.cs.chalmers.se/~koen
phone:+46-31-772 5424 mailto:ko...@cs.chalmers.se
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden

Jerzy Karczmarczuk

unread,
Jun 28, 2001, 6:23:14 AM6/28/01
to
Stefan Axelsson comments James Hague:

>
> >Obviously Perl has *some* merit, or else no one would be using it.
>
> Are we now resorting to the ''ten million flies can't be wrong'' argument
> here on c.l.f? That's stooping a bit low, isn't it? ;-) ;-)
>
> (Some cheap shots are too got to resist, sorry.)

But this is right, and no need to blink so hard, your right eye might
suffer...

From the evolutionary point of view all those flies, rattlesnakes,
viúvas negras and other nasty beasts cannot be entirely wrong. Nice
and promising Dodo birds and other pterodactylographers were.

Among virtues of a programming language one has to count the ease to
transmit it to new generations, and here we have not only the intrinsic
beauty of the language and of its implementors, but also the existence
of usable libraries/modules. Here Perl started very well. Haskell evolves
slowly.

Ugliness is a matter of appreciation. Not all girls are movie starlets,
and they find somehow their loves. This is normal and good.

And, with your permission - as a Haskell sectarian - I have a suggestion.

Reverse the trend whose culmination was the article of Paul Hudak in
Comp. Reviews, and the creation of the Haskell community.

CREATE NEW LANGUAGES! Give Haskell a few nasty competitors! Put the
evolution into work. I still remember the glorious days when Mark Jones
before becoming the Sheriff of Nottingham played Robin Hood. Gofer was
for a long time always one step ahead of GHC, and this contributed to
the evolution of the latter.

This is one of the reasons I always defended Clean on this forum.

Jerzy Karczmarczuk
Caen, France

Vitaly Lugovsky

unread,
Jun 28, 2001, 7:11:24 AM6/28/01
to
Joachim Durchholz <joac...@gmx.de> wrote:

>> MW> I just can't stand statements like this one.
>>
>> Why? Functional programming is always a part of any university
>> course. So, functional programmer = educated programmer.

JD> The assumption you're making is that education is important for the
JD> quality of a programmer. I think the two are correlated but not too
JD> strongly, and if that's true it's too harsh to dismiss all self-taught
JD> programmers as incompetent VB geeks.

Sure, not only computer science education is valuable for a programmer.
He have to be strong enough in a field he works in - e.g. engeneering
if he is doing some computations, economics, even a psychology if a
programmer builds GUIs. But computer science education is essential. VB
geeks are not "programmers" - they're "coders". They can code something that
programmer tells them to do - but they're unable to produce something new,
to use non-common solutions, even to choose an optimal solution from the
common ones. But if they're knows their practical field well - they'll do
the job much better then computer scientists.

JD> (Actually it's an insult to all
JD> self-taught competent programmers, and I know that these exist as some
JD> of them happen to be my friends. So please watch your language.)

Hm. I am not a CS-educated person myself, so don't be upset.
And I just was impressed how CS specialists solve problems in a minutes
for that I spent a lot of time.

Vitaly Lugovsky

unread,
Jun 28, 2001, 7:20:28 AM6/28/01
to
Jerzy Karczmarczuk <kar...@info.unicaen.fr> wrote:

JK> This one has a particular view of the word "education". I would dismiss it, but
JK> seeing that V.S. L. home page is hosted by the Institute for High Energy
JK> Physics,
JK> and reading that according to him "Good scientist never wants to do engineering
JK> jobs", I begin to wonder... Almost all Nobel prizes in particle physics are
JK> based
JK> on hard engineering job, even in particle theory (look the amount of technical
JK> computations in papers of 't Hooft and Veltman).

You just did not understood me right. Scientist never wants to do
engeneering job - but HE HAVE TO. Just because of engeneers can't do it
right.

JK> And I am not even mentioning
JK> experimental physics (Nobel for streamer chambers, for the equipment permitting
JK> to
JK> discover the cosmic background radiation, for the computerized tomography, etc.)

Please make difference between experimental physics and engeneering.
Engeneering that I mean is a routine. Almost any experiment is something
creative.

JK> I am afraid that teachers of Vitaly Lugovsky failed very badly...

JK> Perhaps V.S. L. wants just to be funny? Fun and FUNctional programming should
JK> go together. So let's enjoy his postings. And his personal ads, for example
JK> something picked from his home page, about his (apparently non-existing; the
JK> link goes to an empty page) project:

It exist. But it's not ready to be published before I print experimental
results.

>> Chaos Collection project. It is in a pre-alpha stage, but soon it'll be a good
>> swarm of Genetic and Evolution modelling software, which will show that
>> christians and other creationists are all morons and must be punished to death.

JK> Seems that the most funny "science" ever invented, called Marxism is still
JK> alive.
JK> Good! But please, not *all* engineers should be shot. Not yet (unless, of
JK> course,
JK> they are christian).

I have a right to hate christians. And christians have a right to hate me.
We call it "FREEDOM". So, please, don't mention marxism any more.

JK> PS. A cute ehm, philosophical quotation seems appropriate here. Mark Twain:

JK> "If a vegetarian eats vegetables,
JK> what does a humanitarian eat?"

So, why not to cite anti-christian quotes from Mark Twain? ;)

Biep @ http://www.biep.org/

unread,
Jun 28, 2001, 10:55:07 AM6/28/01
to
"Vitaly Lugovsky" <war...@skeptik.net> wrote in message
news:9hf3ts$43g$2...@inn.ihep.su...

> I have a right to hate christians. And christians have a right to hate
me.
> We call it "FREEDOM". So, please, don't mention marxism any more.

(1) He has a right to mention Marxism.
It is called "FREEDOM".
But then, you have a right to ask him to stop doing so..

(2) Christians don't have a right to hate anybody.
They may be forgiven if they do anyway,
but that is a very different thing.

[Disclaimer: I mean "hate" in the sense in which he used it, not in the
sense of "not preferring", in which sense a Christian should hate his
parents, and even himself.]
--
Biep
Reply via http://www.biep.org

Nils Goesche

unread,
Jun 28, 2001, 11:38:11 AM6/28/01
to
Vitaly Lugovsky <war...@skeptik.net> writes:

> Jerzy Karczmarczuk <kar...@info.unicaen.fr> wrote:
>
> JK> And I am not even mentioning
> JK> experimental physics (Nobel for streamer chambers, for the equipment permitting
> JK> to
> JK> discover the cosmic background radiation, for the computerized tomography, etc.)
>
> Please make difference between experimental physics and
> engeneering. Engeneering that I mean is a routine. Almost any
> experiment is something creative.

Errm, could it be that you never worked with any engineer? Have you
_ever_ tried to build some embedded device of any kind? That is cheap
but offers features that no other competetor does? You have to do
lots of research both to invent some new technology and make it work.

If you think that is just ``routine'' work then you are either an
idiot or totally clueless about what makes engineering.

Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x42B32FC9

Peter Hancock

unread,
Jun 28, 2001, 1:12:03 PM6/28/01
to
"An engineer is someone who can do for a dime what any fool
can do for a dollar". (Butler Lampson, I think.)

Vitaly Lugovsky

unread,
Jun 28, 2001, 3:04:15 PM6/28/01
to
Nils Goesche <car...@cartan.de> wrote:

>> JK> And I am not even mentioning
>> JK> experimental physics (Nobel for streamer chambers, for the equipment permitting
>> JK> to
>> JK> discover the cosmic background radiation, for the computerized tomography, etc.)
>>
>> Please make difference between experimental physics and
>> engeneering. Engeneering that I mean is a routine. Almost any
>> experiment is something creative.

NG> Errm, could it be that you never worked with any engineer?

No. I am working as an engeneer. With experienced scientists. I know
what they thiks about me.

NG> Have you
NG> _ever_ tried to build some embedded device of any kind?
NG> That is cheap
NG> but offers features that no other competetor does? You have to do
NG> lots of research both to invent some new technology and make it work.

NG> If you think that is just ``routine'' work then you are either an
NG> idiot or totally clueless about what makes engineering.

Routine is anything that does not bring a complete new FUNDAMENTAL
knowlege. All that I do will never bring that kind of knowlege - and it
sucks. But someone have to do it - and only couple of lucky heroes will
bring something really new. And from my, routine point of view, in computer
science (which is not fundamental, but something near it) only research
in functional/logic/quantum computing areas can produce a new knowlege -
and this areas are closed for us, self-educated Fortran/VB/C++ geeks.

Steve Wray

unread,
Jun 28, 2001, 5:07:20 PM6/28/01
to

Ummmm I think that the best way to express my bafflement at the perl one
is to describe it as "obfuscated"

Indeed... (dodging flames) most perl I've seen to date is obfuscated!
8)


>
> Cheers,
> Tom

Albert Y. C. Lai

unread,
Jun 28, 2001, 6:05:59 PM6/28/01
to
Vitaly Lugovsky <war...@skeptik.net> writes:

> I have a right to hate christians. And christians have a right to hate me.

You may be right about hatred, but death threat is a criminal offense.

> We call it "FREEDOM". So, please, don't mention marxism any more.

Jerzy has the right to mention Marxism and relate it to your beliefs.
We call it "FREEDOM". Isn't freedom great? Enjoy.

Albert Y. C. Lai

unread,
Jun 28, 2001, 7:28:30 PM6/28/01
to
George Russell <g...@tzi.de> writes:

> I think we ought to try to keep to one comprehensible idea per line.

Sure thing.

cscore gs ws = sum [
length $
group $
sort $
filter (`notElem`gs) w
| w <- ws ]

There. One comprehensible idea per line, one concept at a time.


> I for one cannot remember what "group" does, so that at least needs to be
> cleared up.

I for one have never seen a certain word you used --- castigate --- so
that at least needs to be cleared up, too. Please be self-consistent
when you complain about infrequently used vocabulary.


> OK, maybe in theory it's easier to figure out, because everything
> is pure, but you still need to rack your brain to work out what's going on.

Rack your brain to work out what's going on:

a[1] = p;
a[2] = q;
n = 2;
while (n != 1) {
if (a[n-1] == 0) {
a[n-1] = a[n] + 1;
n = n - 1;
}
else if (a[n] == 0) {
a[n-1] = a[n-1] - 1;
a[n] = 1;
}
else {
a[n+1] = a[n] - 1;
a[n] = a[n-1];
a[n-1] = a[n-1] - 1;
n = n + 1;
}
}
r = a[1];

only to find out it's an old friend all along:

r = let f(0, y) = y+1
f(x, 0) = f(x-1, 1)
f(x, y) = f(x-1, f(x, y-1))
in f(p, q)


> Why is it we castigate C programmers who
> try to cram the entire program into one line, but then do the same in
> Haskell?

[...]


> It really is high time we revived the Obfuscated Haskell Contest.

I think you have confused succint programs with obfuscated programs.
Succint programs could be clear and achieve a lot. Obfuscated
programs could be lengthy and still do nothing. I believe that a
major technique of obfuscation is precisely writing pages after pages
of code that simplifies to the null statement.

I for one do not disdain one-line programs in any language per se. I
only disdain obfuscation.


References:

The loop-and-array implementation of the Ackermann function is taken
from [1]. As many as three papers [1,2,3] were written and published
to prove that it terminates and delivers the expected output. In
other words, as many as three proof methods/techniques were invented
to reason about it, each one employing more sophisticated mathematics
than before; in fact, [3] goes all the way to transfinite ordinals.

[1] Zohar Manna and Richard Waldinger. Is "sometime" sometimes better
than "always"? Communications of the ACM 21(2):159--172, 1978.

[2] David Gries. Is sometime ever better than alway? ACM Transactions
on Programming Languages and Systems, 1(2):258--265, 1979.

[3] H. J. Boom. A weaker precondition for loops. ACM Transactions on
Programming Languages and Systems, 4(4):668--677, 1982.

Garry Hodgson

unread,
Jun 29, 2001, 10:18:23 AM6/29/01
to
Peter Hancock wrote:
>
> "An engineer is someone who can do for a dime what any fool
> can do for a dollar". (Butler Lampson, I think.)

a software guy can do it for ten dollars, a year late,
but it'll be *really* cool...

--
Garry Hodgson sometimes we ride on your horses
Senior Hacker sometimes we walk alone
Software Innovation Services sometimes the songs that we hear
AT&T Labs are just songs of our own
ga...@sage.att.com

Mark Seaborn

unread,
Jun 29, 2001, 12:28:12 PM6/29/01
to
Tom Moertel <tom-...@moertel.com> writes:

> sub cscore {
> my ($guesses, $words) = @_;
> my $score = 0;
> $score += keys %{{ /(([^$guesses ]))/g }} for @$words;
> return $score;
> }

> You have to be familiar with Perl esoterica to decipher the former,


> where I suspect that most Haskell programmers could reason about what
> the second version is doing.

Very true. As someone who did a fair amount of Perl programming a few
years ago and knew the language quite well (though admittedly I didn't
read much of other people's code), I can't fully understand that code
fragment. I'd have to look up what %{{ ... }} means, and work out why
you're using double brackets inside the regexp. Maybe these are
recent additions to the language.

Perl's too big, but I don't think constant Perl-bashing is
worthwhile. Incidentally it is Perl in which I started to use some
functional idioms, like treating data structures as immutable, and
using `map'.

--
Mark Seaborn
- msea...@bigfoot.com - http://www.srcf.ucam.org/~mrs35/ -

``Cambridge? Didn't that used to be a polytechnic?''

Steve Wray

unread,
Jun 29, 2001, 6:50:36 PM6/29/01
to
[snip]

>
> Perl's too big, but I don't think constant Perl-bashing is
> worthwhile. Incidentally it is Perl in which I started to use some
> functional idioms, like treating data structures as immutable, and
> using `map'.

I think perl introduces some good ideas...
I like the way that one can string together
command-line shell sentences with sentences from
the perl language and freely take output from system
executables into the perl program to manipulate them
etc.
Its great.
If only the syntax were clearer!
Thats why I'm inspired to try to get to do these
cool things in haskell -- I couldn't think of a language
with a clearer more crisp syntax.
Lazyness is a big bonus too...
Also, I have yet to achieve it, but I have a feeling that list comprehensions
are going to be very useful in processing stdoutput,
especially when I get the regexp stuff working in haskell!
:)

Albert Y. C. Lai

unread,
Jun 29, 2001, 5:50:17 PM6/29/01
to
Garry Hodgson <ga...@sage.att.com> writes:

> Peter Hancock wrote:
> >
> > "An engineer is someone who can do for a dime what any fool
> > can do for a dollar". (Butler Lampson, I think.)
>
> a software guy can do it for ten dollars, a year late,
> but it'll be *really* cool...

So I was curious and I tried Google with the search phrase
"an engineer is someone who can do for a dime". The first two hits
I got was a keynote by Andrew Tanenbaum:

http://www.cs.vu.nl/~ast/talks/cse-97/cse-97.pdf

or http://www.cs.vu.nl/~ast/talks/cse-pp/ for html and images

Slide 23 "engineering" has the quote (but no attributed to anyone).
Slide 27 "another example of not thinking 'systems'" is a humorous
example of what Garry Hodgson wrote.

0 new messages