To [] Or Not To []

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: To [] Or Not To []

Olaf Klinke
Well, Joachim,

it certainly can not get easier than that. Thanks a lot!

Olaf
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: To [] Or Not To []

Ben Franksen
In reply to this post by Jerzy Karczmarczuk
Am 11.03.2017 um 01:42 schrieb JK:

> Le 11/03/2017 à 00:28, Olaf Klinke a écrit :
>> Actually, your negative abstract turns out to be for a quite positive
>> article. List are like iterators, that's the essence, and as long as
>> you are iterating, it's fine to use []. The prominence of singly
>> linked lists in Haskell has tought me to write my data processing
>> programs in a streaming style.
> *Yes.* I've been teaching not just "data processing" - after all almost
> everything we program is "data processing", no?... but such concrete
> stuff as physics simulation (diff. eqs.), some other numerics
> (asymptotic expansions, etc.) signal processing (including sound
> generation), and I liked to present several examples in a *dataflow
> style* with plenty of co-recursive contraptions. Haskell lazy lists were
> natural, concise, and easy to manipulate.  We enjoyed it, wrong or not.
>
> Nothing is perfect, not only  mister Nobody; calling ANY approach to
> programming "wrong" is sectarian. A professional coder working on a
> concrete project may say bad words about anything he wishes, but for a
> teacher this is a pedagogical sin, and inefficient programs can be more
> inspiring than some "correct" doctrines.

Jerzy, i have always liked your style and i am very glad you wrote this
response, the attitude of which i find refreshingly unconventional.
(Note i am not free of the sin of, sometimes hastily, condemning what i
find distasteful.)

Cheers
Ben

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: To [] Or Not To []

Brandon Allbery
On Thu, Mar 16, 2017 at 6:22 PM, Ben Franksen <[hidden email]> wrote:
Am 11.03.2017 um 01:42 schrieb JK:
*Yes.* I've been teaching not just "data processing" - after all almost
everything we program is "data processing", no?... but such concrete
stuff as physics simulation (diff. eqs.), some other numerics
(asymptotic expansions, etc.) signal processing (including sound
generation), and I liked to present several examples in a *dataflow
style* with plenty of co-recursive contraptions. Haskell lazy lists were
natural, concise, and easy to manipulate.  We enjoyed it, wrong or not.
Jerzy, i have always liked your style and i am very glad you wrote this response, the attitude of which i find refreshingly unconventional. (Note i am not free of the sin of, sometimes hastily, condemning what i find distasteful.)

I'd just like to add:

- if it gets the job done, it's not wrong.

- it's my opinion that programs are best written for clarity; the *compiler* should be optimizing, not the programmer, whenever possible. Yes, there are exceptions. But how many programs really *need* something like Duff's Device? Save the cleverness for those. This doesn't necessarily justify using an inherently wrong data structure (e.g. alist for a large keyed map), but if the flow is best understood via lists, that counts for more. (Consider that it may be *your* sanity that will be saved a year down the road when you have to revise it.)

--
brandon s allbery kf8nh                               sine nomine associates
[hidden email]                                  [hidden email]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: To [] Or Not To []

Jerzy Karczmarczuk

Sorry, a looong message.

Le 16/03/2017 à 23:38, Brandon Allbery a écrit :

programs are best written for clarity; the *compiler* should be optimizing, not the programmer, whenever possible.

A historical anecdote...
When something called 'cybernetics' ceased to be in the Soviet Union a bourgeois pseudo-science whose aim was to enslave the the Class of Workers, etc., and Russians and their satellites began to manufacture computers, they managed quite fast to master the main idea of interesting algorithms, exquisite data structures and their processing. They COULD have invented some nice programming languages (we are at the end of '50-ties...), but among many other calamities,  their forerunners said that they had some wonderful teams of very competent mathematicians, who, once instructed how to program computers, would do Wonders, in the name of the True Proletarian Science.

It was partly true (mathematicians, Andrey Markov Jr., Andrey Ershov, etc., not necessarily the Proletarian Science...) .
So, when the ideal personage of THE Programmer became in US a cliché in some science-fiction books (e.g., Asimov's), in the world of the True Proletarian Science, very decent humans  wasted a horrible amont of time producing low-level codes, and neglecting completely the domain of compilation... They managed to put Sputnik and Gagarin above our heads, but programming languages did not evolve... [[Although the Snobol language invented by Ralph Griswold, was partly based on the Markov algorithm concept]].

Now, the morale of this story?...
Wait a bit.

Second round.
There is a pedagogical initiative, called the International Olympiad in Informatics.  ( http://www.ioinformatics.org/index.shtml ).
The evolution of this contest, participating countries, etc., is a very interesting story, but here I want just to tell you something different. In Wikipedia you will read that it is an annual competitive programming competition for secondary school students. It is the second largest olympiad, after International Mathematical Olympiad
The contest consists of two days of computer programming and problem-solving of algorithmic nature. To deal with problems involving very large amounts of data, it is necessary to have not only programmers, "but also creative coders, who can dream up what it is that the programmers need to tell the computer to do. The hard part isn't the programming, but the mathematics underneath it.... "

Nice. And now: the TRUTH. The only languages which are permitted are C, C++,  and Java. Sorry, recently also Pascal, the Eastern Europe insisted upon it.
I looked through the proposed tasks. A good percentage of them were puzzles of logical kind.  But no logical languages were allowed. Something which can be coded in 12 lines of CLP, has to be ceeplusjavaised on 8 pages, and the Jury acknowledges the speed and efficiency of such programs... Laugh or weep?...
Functional languages? Anybody heard of them?...

Don't  blame the Soviets, please... Look up the British Informatics Olympiad. The rules I found randomly for the 2000 contest stipulated: "The languages available will be Turbo Pascal and Turbo C/C++." Yes, not just C++, but compulsory Borland dialect.
More?
Let's see the ACM International Collegiate Programming Contest. Rules: "... They must submit solutions as programs in C, C++, Java or Python  (although it is not guaranteed every problem is solvable in Python)." (Most probably the author doesn't know what Python is...)

This is the way we teach our youth to be creative ! In such a way we inspire them to became "creative coders". You may think whatever you wish, but I am convinced that the best part of the responsibility for such a calamitous picture of the CS pedagogy, falls upon those feeble-minded "professionals" who know better what is good, what is the "main stream" which should be promoted, and what is "wrong", which should be severely punished. The totalitarian (or fundamentalist)  doctrines are everywhere. Let's build some more huge screening walls, and forbid the presence of people who think otherwise, and we shall be Great Again.

Jerzy Karczmarczuk
/Caen, France/






Garanti sans virus. www.avast.com

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: To [] Or Not To []

Richard A. O'Keefe
This department has participated in regional and international
programming contests at tertiary levels about as long as it has
been possible to do so.

One of the major problems for the organisers of such events
is ensuring that working environments for all permitted
programming languages are installed (and compatible) on the
machines the contestants will use.

These days with things like Docker it should be straightforward
to set this up once and just push it out to all the machines,
but it was not always so.

With respect to schools, the sad fact of the matter is that
school IT syllabi are often set without the input of any
really clued-up programmers.  The NZ curriculum was revised
not that long ago, and we had some input into it, as a result
of which I *think* Python is used in some classrooms.

I remember one programming contest where I was supposed to
be a local judge, but was ever so glad that nobody needed me,
as I spent the entire period *trying* to write and run
"Hello World" with Visual Age for Java, which I had never
previously seen, and never wish to see again.  Pity any
contestant who hadn't seen it...

So, if we want Haskell (or F#, or whatever) allowed,
 - it has to be taught by enough schools,
 - we have to make it easy for the organisers to install
   the same environment that the pupils will have used.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: To [] Or Not To []

Olaf Klinke
In reply to this post by Johannes Waldmann-2
Just adding to the programming contest anecdotes. Here is what happens if you issue an applied math assignment without specifying the programming language to be used. The first student solves it in bash, to demonstrate how inefficient the solution can be. The second student writes a Turing machine simulator in Maple (I can't recall whether it was the brainf*ck dialect), then programs that Turing machine. The third student writes the solution in postscript and makes the printer solve the differential equation.
All were languages available in the setting. I have no idea whether any of the above submissions were inspected by the tutor, but received a mark.

Olaf
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: To [] Or Not To []

Brandon Allbery
I did that in a relatively boring math course just to try to keep my interest up. (Riemann integration in RM/COBOL, anyone?)

On Sun, Mar 19, 2017 at 5:29 PM, Olaf Klinke <[hidden email]> wrote:
Just adding to the programming contest anecdotes. Here is what happens if you issue an applied math assignment without specifying the programming language to be used. The first student solves it in bash, to demonstrate how inefficient the solution can be. The second student writes a Turing machine simulator in Maple (I can't recall whether it was the brainf*ck dialect), then programs that Turing machine. The third student writes the solution in postscript and makes the printer solve the differential equation.
All were languages available in the setting. I have no idea whether any of the above submissions were inspected by the tutor, but received a mark.

Olaf
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.



--
brandon s allbery kf8nh                               sine nomine associates
[hidden email]                                  [hidden email]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
12