Hasbara and Haskell: Difference between pages

(Difference between pages)
Content deleted Content added
Mustafaa (talk | contribs)
undoing undiscussed revert - discussion already ongoing on Talk
 
More complex examples: coherence with previous section
 
Line 1:
[[Image:Haskell Logo.jpg|frame|Haskell logo]]
{{NPOV}}
'''Hasbara''' ('''הסברה''') (or ''hasbarah'') is the [[Hebrew language|Hebrew]] noun for the action of "explaining" in the narrow sense of the word.
 
'''Haskell''' is a standardized [[purely functional|pure]] [[functional_programming|functional]] [[programming language]] with [[non-strict programming language|non-strict semantics]]. Named after the logician [[Haskell Curry]], it was created by a committee formed in [[1987]] for the express purpose of defining such a language. The direct predecessor of Haskell was [[Miranda programming language|Miranda]] from [[1985]].
==Introduction==
The latest semi-official language standard is '''Haskell 98''', intended to specify a minimal, portable version of the language for teaching and as a base for future extensions.
The language continues to evolve rapidly, with [[Hugs]] and [[Glasgow Haskell Compiler|GHC]] (see below) representing the current [[de facto#De facto standards|''de facto'' standard]].
 
Characterizing syntax features in Haskell include [[pattern matching]], [[currying]], [[list comprehension]]s, [[guard (computing)|guard]]s, and definable [[operator (programming)|operator]]s. The language also supports [[recursion|recursive]] functions and [[algebraic data type]]s, as well as [[lazy evaluation]]. Unique concepts include [[Monads_in_functional_programming|monad]]s, and [[type class]]es.
The term has been used by both the [[State of Israel]] and private groups to describe their efforts at explaining official Israeli government [[Policy|policies]] and promoting Israel advocacy to the world at large. It is viewed positively and actively encouraged by almost all [[Judaism|Jewish]], [[Zionism|Zionist]], and [[Israel|Israeli]] organizations and instititutions. Hasbara bears similarities to some programming on the [[Voice of America]], [[Radio Free Europe]] and the [[BBC World Service]].
The combination of such features can make [[function (programming)|functions]] which would be difficult to write in a procedural programming language almost trivial to implement in Haskell.
 
The language is, as of [[as of 2002|2002]], the [[Lazy_evaluation|lazy]] [[functional programming language|functional language]] on which the most research is being performed. Several variants have been developed: parallelizable versions from [[Massachusetts Institute of Technology|MIT]] and [[Glasgow University|Glasgow]], both called Parallel Haskell; more parallel and distributed versions called Distributed Haskell (formerly Goffin) and [[Eden_programming_language|Eden]]; a [[speculative execution|speculatively evaluating]] version called Eager Haskell and several [[object orientation|object oriented]] versions: Haskell++, [[O'Haskell]] and [[Mondrian programming language|Mondrian]].
Critics maintain that Israel's ''hasbara'' efforts are [[propaganda]]. Israel's supporters contend that Israel's efforts are no different from any [[Government|governmental]] or [[Corporation|corporate]] effort to positively [[Advertisement|advertise]] their unique views, functions, and achievements in hopes of winning over the hearts and minds of the undecided, opponents and skeptics. Others state that ''hasbara'' is not propaganda, because "while propaganda strives to highlight the positive aspects of one side of a conflict, hasbara seeks to explain actions, whether or not they are justified." [http://www.israelnn.com/print.php3?what=article&id=4175]
 
Although Haskell has a comparatively small user community, its strengths have been well applied to a few projects. [[Autrijus Tang]]'s [[Pugs]] is an implementation for the forthcoming Perl 6 language with an interpreter and compilers that proved useful already after just a few months of its writing. [[DARCS]] is a revision control system, with several innovative features.
In the words of one such hasbara group, the [[Israel Citizens Information Council]] (ICIC): "The purpose of the ICIC is to assist efforts to explain Israeli life from the vantage point of the average Israeli citizen. Towards that end, the ICIC enlists Israelis from all walks of life to participate in its various projects...One of our major activities is the production of special [[Powerpoint]] presentations which we post on our website. These presentations review specific aspects and issues related to Israel and the [[Middle East]]..." [http://www.hasbara.com/].
 
There is also a Haskell-like language that offers a new method of support for [[GUI]] development called [[Clean programming language|Concurrent Clean]]. Its biggest deviation from Haskell is in the use of [[uniqueness type]]s for input as opposed to [[Monads in functional programming|monads]].
There are a number of active ''hasbara'' websites on the Internet, and some of them devote themselves to world [[Jewish]] affairs, not just those relating to Israeli governmental policy. See external links below.
 
==Israel's HasbaraExamples ==
 
=== Anatomy of a Haskell function ===
Several Israel government ministries and agencies deal with ''hasbara'':
*The ''Israel Ministry of Foreign Affairs'' [http://www.mfa.gov.il/mfa/] deals with issues such as [[Anti-Semitism]] and the [[Holocaust]] [http://www.mfa.gov.il/mfa/anti-semitism%20and%20the%20holocaust/documents%20and%20communiques/]; [[Terrorism]] [http://www.mfa.gov.il/mfa/terrorism-%20obstacle%20to%20peace/selected%20articles/]; [[Jerusalem]] [http://www.mfa.gov.il/mfa/jerusalem%20capital%20of%20israel/] and many more.
*The ''Israel Ministry of Education, Culture, and Sport'', with sections devoted to living with terrorism and its meaning for children [http://www.education.gov.il/children/]; [[Gender]] equality [http://cms.education.gov.il/EducationCMS/Units/Owl/English/Gender/Background/] and more.
*The ''Jewish Agency For Israel'' promotes "Jewish Zionist Education and Identity" [http://www.jafi.org.il/ed/] such as J.U.I.C.E. (Jewish University in Cyberspace)[http://www.jafi.org.il/education/juice/index.html] and "University Programs for Overseas Students" [http://www.universities-colleges.org.il/]
*The ''Ministry for Jerusalem and Diaspora Affairs'' presently headed by [[Natan Sharansky]] former ''[[Refusenik]]'' who states that: ''"No one can convey the thoughts, emotions, and opinions of Israeli society today better than a person living in the country. And no Israeli can relate to the thoughts, emotions, and opinions of citizens in other countries better than the people who once lived in those countries. The Hasbara Program of ICIC combines these two truths into one powerful program. In my position as the representative of the government and people of Israel to the Jewish world, I believe that through initiatives such as the ICIC volunteer hasbara program and this website, we will be able to bridge the "information gap" between Israel and the outside world, and I welcome this addition to the field..."'' [http://www.hasbara.com/v2pages/sharansky_letter.html].
*The ''Israel Prime Minister's Office'' [http://www.pmo.gov.il/PMOEng] releasing [[Press release|press releases]], speeches, "Government Press Office" [http://www.gpo.gov.il/], and the ''Israel [[President]]'s Office'' [http://www.president.gov.il/defaults/default_en.asp].
 
The [[Hello world program|"Hello World"]] of functional languages is the [[factorial]] function. Expressed as pure Haskell:
==Methods==
 
fac :: Integer -> Integer
Some Hasbara documents explain propaganda techniques, claiming to be reporting on methods used by Palestinian activists, yet providing advice on how to use these very tactics in defense of Israel. For example, one organization describes its Hasbara effort at [http://www.wujs.org.il/activist/features/campaigns/propaganda_devices.shtml Seven Basic Propaganda Devices] as explaining ''"how each of these devices is used by Palestinian activists... to manipulate their audience....the article...gives ideas for countering these propaganda techniques, as well as a few more positive suggestions"'', yet advises the Hasbara activist reader on propaganda methods for his/her own use, such as the following:
fac 0 = 1
fac n | n>0 = n * fac (n-1)
 
This describes the factorial as a recursive function, with a single terminating base case. It is similar to the descriptions of factorials found in mathematics textbooks. Much of Haskell code is similar to mathematics in facility and syntax.
:"For the Israel activist, it is important to be aware of the subtly different meanings that well chosen words give. Call 'demonstrations' "riots", many Palestinian political organizations "terror organizations", and so on."[http://www.wujs.org.il/activist/features/campaigns/propaganda_devices.shtml]
 
The first line of the factorial function shown is optional, and describes the ''types'' of this function. It can be read as ''the function fac'' (fac) ''has type'' (::) ''from integer to integer'' (Integer -> Integer). That is, it takes an integer as an argument, and returns another integer.
since, according to the article, "those opposed to Israel use name calling all the time."
 
The second line relies on [[pattern matching]], an important part of Haskell programming. Note that parameters of a function are not in parentheses but separated by spaces. When the function's argument is 0 (zero) it will return the integer 1 (one). For all other cases the third line is tried. This is the [[recursion]], and executes the function again until the base case is reached. A [[guard (computing)|guard]] protects the third line from negative arguments that would run down unterminated.
An abridged version of this (clearly marked as such), with irrelevant sections relating to alleged Palestinian propaganda tactics removed, has been posted on ''indymedia'' websites [http://vancouver.indymedia.org/news/2003/01/28174.php Vancouver Indymedia] [http://resist.ca/story/2004/8/11/225422/804 Resist.ca] [http://www.indymedia.org.uk/en/2004/01/284723.html UK Indymedia] around the world. Supporters of Hasbara have argued that this edited version is unfair, because many paragraphs are combined from separate pages on separate topics.
 
The "Prelude" is a number of small functions analogous to C's standard library. Using the Prelude and writing in the "point free" (insert classic Haskell joke here) style of unspecified arguments, it becomes:
==External links==
 
fac = product . enumFromTo 1
===Hasbara Organizations===
*[http://www.mfa.gov.il/mfa/ Israel Ministry of Foreign Affairs (English)]
*[http://www.hasbara.com/ Hasbara: Israel Citizens Information Council]
*[http://www.hasbara.us/cadre1.htm Hasbara.us Inc. a Non profit & Non Political Organization]
*[http://www.hasbara.org.il/web/index.asp Hasbara All Around the World]
*[http://www.israelactivism.com/ Israelactivism.com]
*[http://www.jafi.org.il/education/hasbara/ Hasbara Israel Advocacy]
*[http://www.hasbara.tk/ Hasbara Australia: Australian friends of the Israel Hasbara Committee]
*[http://www.wujs.org.il/activist/features/campaigns/hasbara.shtml Hasbara: Israel Advocacy from world Union of Jewish Students (WUJS)]
 
The above is close to mathematical definitions such as ''f = g <small>o</small> h'' (see [[function composition]]), and indeed, it's ''not'' an assignment of a value to a variable.
===Articles Critical of Hasbara===
*[http://www.zmag.org/meastwatch/propwar.htm Propaganda and War] by Edward Said
*[http://thebigstory.org/features/history.html From Hasbara to Intifada: How Israel's foreign press corps rewrote history]
*[http://www.coalitionofwomen4peace.org/articles/jeninthepropagandawar.htm Jenin - The Propaganda War]
*[http://www.think-israel.org/shifftan.html Israeli Hasbara: A Nation Working Against Itself]
*[http://www.normanfinkelstein.com/id151.htm Book Review: Crushing the Wheels of Hasbara]
 
=== More complex examples ===
[[Category:Hebrew language]]
 
[[Category:Israel]]
A simple [[RPN]] calculator:
[[Category:Education]]
 
[[Category:Activism]]
calc = foldl f [] . words
where
f (x:y:zs) "+" = y+x:zs
f (x:y:zs) "-" = y-x:zs
f (x:y:zs) "*" = y*x:zs
f (x:y:zs) "/" = y/x:zs
f xs y = (read y :: Float):xs
 
A function which returns a stream of the [[Fibonacci numbers]] in linear time:
 
fibs = 0 : 1 : (zipWith (+) fibs (tail fibs))
 
The same function, presented with GHC's [[parallel list comprehension]] syntax:
 
fibs = 0 : 1 : [ a+b | a <- fibs | b <- tail fibs ]
 
The earlier factorial function, this time using a sequence of functions:
 
fac n = (foldl (.) id [\x -> x*k | k <- [1..n]]) 1
 
A remarkably concise function that returns the list of [[Hamming number]]s in order:
 
hamming = 1 : map (*2) hamming # map (*3) hamming # map (*5) hamming
where xxs@(x:xs) # yys@(y:ys)
| x==y = x : xs#ys
| x<y = x : xs#yys
| x>y = y : xxs#ys
 
== Implementations ==
The following all comply fully, or very nearly, with the Haskell 98 standard, and are distributed under [[open source]] licences. There are currently no commercial Haskell implementations.
* '''''[[Hugs]]''''' ([http://www.haskell.org/hugs/]) is a [[bytecode]] interpreter. It offers fast compilation of programs and reasonable execution speed. It also comes with a simple graphics library. Hugs is good for people learning the basics of Haskell, but is by no means a "toy" implementation. It is the most portable and lightweight of the Haskell implementations.
* '''''[[Glasgow Haskell Compiler|Glasgow Haskell Compiler]]''''' ([http://www.haskell.org/ghc/]). The Glasgow Haskell Compiler compiles to native code on a number of different architectures, and can also compile to C. GHC is probably the most popular Haskell compiler, and there are quite a few useful libraries (e.g. bindings to [[OpenGL]]) that will only work with GHC.
* '''''nhc98''''' ([http://www.cs.york.ac.uk/fp/nhc98/]) is another bytecode compiler, but the bytecode runs significantly faster than with Hugs. Nhc98 focuses on minimising memory usage, and is a particularly good choice for older, slower machines.
* '''''Jhc''''' ([http://repetae.net/john/computer/jhc/]) a haskell compiler emphasising speed and efficiency of generated programs as well as exploration of new program transformations.
* '''''Gofer''''' An educational version of Haskell, Gofer was developed by Mark Jones. It was supplanted by HUGS.
* '''''HBC''''' ([http://www.cs.chalmers.se/~augustss/hbc/hbc.html]) is another native-code Haskell compiler. It hasn't been actively developed for some time, but is still usable.
*'''''Helium''''' ([http://www.cs.uu.nl/helium/]) is a newer dialect of Haskell. The focus is on making it easy to learn. It currently lacks typeclasses, making it incompatible with many Haskell programs.
 
== Extensions ==
*[[O'Haskell]] is an extension of Haskell adding [[object-oriented programming|object-orientation]] and [[concurrent programming]] support.
 
== External links ==
* [http://www.haskell.org The Haskell Home Page]
* [http://www.haskell.org/hawiki/ The Haskell Wiki]
* [http://www.haskell.org/tutorial/ A Gentle Introduction to Haskell 98] ([http://www.haskell.org/tutorial/haskell-98-tutorial.pdf pdf] format)
* [http://haskell.org/papers/NSWC/jfp.ps Haskell vs. Ada vs. C++ vs. Awk vs. ... An Experiment in Software Prototyping Productivity]
* [http://www.willamette.edu/~fruehr/haskell/evolution.html The Evolution of a Haskell Programmer] - a slightly humorous overview of different programming styles available in Haskell
* [http://haskell.readscheme.org An Online Bibliography of Haskell Research]
* [http://www.haskell.org/humor/press.html Haskell Humor]
* [http://www.research.microsoft.com/~simonpj/papers/haskell-retrospective Wearing the hair shirt: a retrospective on Haskell]. Simon Peyton Jones, invited talk at POPL 2003.
 
{{Major programming languages small}}
 
[[Category:Haskell dialects|*]]
[[Category:Programming languages]]
[[Category:Functional languages]]
[[Category:Declarative programming languages]]
 
[[cs:Haskell]]
[[de:Haskell (Programmiersprache)]]
[[es:Haskell]]
[[eo:Haskell]]
[[fr:Haskell]]
[[it:Haskell]]
[[nl:Haskell]]
[[ja:Haskell]]
[[pl:Haskell]]
[[pt:Haskell (linguagem de programação)]]
[[ru:Haskell]]
[[sk:Haskell (programovací jazyk)]]
[[sv:Haskell]]
[[zh:Haskell]]