+
1
|
skin
|
login
|
edit
{λ way}
::
primal
user:anonymous
{center {show {@ src="data/fathers/greggchristmas.jpg" height="320" width="500" title="What’s that Linus (Thorvalds?) is saying in that panel from 40 years ago, yesterday? Well, he’s talking in shorthand… Gregg shorthand, to be precise. Schulz used shorthand a number of times in the strip, when Woodstock (and occasionally Linus) was acting as secretary. And being one to pay attention to the details, Schulz got it right. The shorthand in the strip is accurate (or so those in the know tell me), sometimes just recounting what’s being dictated, sometimes with little jokes of its own. The one above? It says «{b Merry Christmas to all and to all a good night.}» (http://aaugh.com/wordpress/2008/12/a-shorthand-way-to-a-merry-christmas/"}}} {div {@ style="text-align:center; font-size:3em; color:white; text-shadow:0 0 8px black;"}'{why? {lambda {} way}}} {center {blockquote [ You can see a more technical introduction in [[lambdatalk three]] ]}} {div {@ style="font-size:1.5em;"} _h3 1) first steps _p Hey you, _p 1) You understand that writing {sup (in some text editor)} {center {pre Yes mom, 3+4 is equal to 3+4} } _p will simply display {sup (in some view window)} {center {b Yes mom, 3+4 is equal to 3+4}} _p 2) You understand that {center {pre Yes mom, 3+4 is equal to '{+ 3 4}} } _p "could" be seen as a {b shorthand notation} for {pre Yes mom, 3+4 is equal to ({b please, evaluate the} sum {b of} 3 {b and} 4)} _p where {code sum} is a function (an operator, a command) belonging to some given dictionary, which will display {center {b Yes mom, 3+4 is equal to 7}} _p 3) You understand that {pre '{lambda {:a :b} Yes mom, :a+:b is equal to {+ :a :b} } } _p "could" be seen as a {b shorthand notation} for {pre ({b please, you will replace} :a and :b {b in} "Yes mom, :a+:b is equal to '{+ :a :b}") {b by future given values} } _p adding to the dictionary a reference to a new function, say {code command_ref_123}. This function can be used like any other function in the dictionary {pre '{command_ref_123 3 4}} _p which is replaced by {pre '{{lambda {:a :b} Yes mom, :a+:b is equal to {+ :a :b} } 3 4}} _p then by {center {b Yes mom, 3+4 is equal to '{+ 3 4}}} _p and by {center {b Yes mom, 3+4 is equal to 7}} {hr} _p If you understand this, « {i function abstraction and function application using variable binding and substitution } », you are ready to play with {b lambdatalk}, a small language initially built on a minimal set of {b 3 rules}: {blockquote _ul 1) primitive {b elements} are simply {code words}, _ul 2) {code '{word words}} is an {b application} of a {code word} to one or several {code words} returning {code words} ; this process is done according to some given dictionary which could be initially empty, _ul 3) {code '{lambda {args} body}} is an {b abstraction}, a function, {code "lambda"}, defining a first sequence of words, {code "args"}, which will be replaced in a second sequence of words and applications, {code "body"}, by a third future sequence of words. } _p and you can understand why such an expression {pre '{{lambda {o a} oh happy day!} oOOOo aaAAaa} } _p will display {b oOOOoh haaAAaappy daaAAaay!} _p Amazing isnt'it? Useless? Maybe, let's take a break, enjoying a piece of John Surman: {center {audio {@ controls} {source {@ src="http://marty.alain.free.fr/musique/JohnSurmanTaleOfTheAncient.mp3"}} }} _h3 2) the fathers _p More seriously, built upon these 3 rules, it happens that {b lambdatalk} can be seen as a dialect of the {b [[Lambda Calculus|https://en.wikipedia.org/wiki/Lambda_calculus]]}, « {i a formal system in mathematical logic for {b expressing computability} based on function abstraction and function application using variable binding and substitution. It is a universal model of computation that can be used to simulate any single-taped {b Turing machine} and was first introduced by mathematician {b Alonzo Church} in the 1930s as part of an investigation into the foundations of mathematics.} » {center {img {@ src="data/fathers/Alonzo_Church.jpg" height="200" title="Alonzo Church"}} {img {@ src="data/fathers/Alan_Turing.jpg" height="200" title="Alan Turing"}} } _p It was long before computers, lambda calculus was [[rather terse|?view=lambda_calculus]], exclusively dedicated to theory, without any application in daily life, and furthermore everything had to be done by hand ... _p Twenty years after in the 1950s, influenced by the lambda calculus, [[John McCarthy|https://en.wikipedia.org/wiki/John_McCarthy_(computer_scientist)]] created the language [[Lisp|https://en.wikipedia.org/wiki/Lisp_(programming_language)]] as a practical mathematical notation for computer programs, made of nested {b S-expressions} {code '{first rest}}, and [[Steve Russell|https://en.wikipedia.org/wiki/Steve_Russell_(computer_scientist)]] implemented it as {b list structures} on an IBM 704 computer. Lisp was a difficult system to implement with the compiler techniques and stock hardware of the 1970s, leading to the creation of complex and expensive Lisp machines. {center {img {@ src="data/fathers/John-McCarthy.jpg" height="230" title="John McCarthy"}} {img {@ src="data/fathers/Steve_Russell.jpg" height="230" title="Stephen Russell"}} } _p After having declined somewhat in the 1990s, Lisp has recently experienced a resurgence of interest. Most new activity is focused around implementations of Common Lisp, Clojure, Racket, Scheme, and Emacs Lisp, and includes development of new portable libraries and applications. But none of them can be easily used inline on the web, at least on the client side. _p Less known, [[Stephen Cole Kleene|https://en.wikipedia.org/wiki/Stephen_Cole_Kleene]] was an American mathematician, one of the students of Alonzo Church, along with Alan Turing. Amongs other things he invented in 1950 [[Regular Expressions|https://en.wikipedia.org/wiki/Regular_expression]] which are « {i sequences of characters that define a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. "find and replace"-like operations} ». It happens that lambdatalk is based on intensive use of regexps, as we will see later. _p In 1995, [[Ward Cunningham|https://en.wikipedia.org/wiki/Ward_Cunningham]] created the first [[wiki|https://en.wikipedia.org/wiki/Wiki]]. A wiki is a web application which allows collaborative modification, extension, or deletion of its content and structure. In a typical wiki, even in Wikipedia, text is written using a simplified and rather limited markup syntax. Very far from a real programming language. {center {img {@ src="data/fathers/Stephen_Cole_Kleene.jpg" height="330" title="Stephen Cole Kleene"}} {img {@ src="data/fathers/Ward_Cunningham.jpg" height="330" title="Ward Cunningham"}} } _h3 3) ze lambdaway _p The {b lambdaway project} was to build a wiki equiped with a true programming language which could be used collaboratively by an author, a web designer and a coder. The result is a small programming language, {b lambdatalk}, embedded in a tiny interactive development tool, {b lambdatank}, working as a light overlay on top of any modern web browser running Javascript and easy to install on a standard web hosting running PHP. _p Basically, {b lambdatalk} follows the Lisp's notation but not the list based implementation. Its implementation could be compared to a {b Turing machine}, {i a sliding window looping on a long stripe}: the window is built on a single {b Regular Expression} running on the input string, recursively catching and replacing by words nested S-expressions, and returning valid HTML/CSS to the browser's engine ... which does the main work of evaluating and displaying the output in a nice window. _p Of course, in order to bring some humanity, {b lambdatalk} adds a bunch of functionalities to the good old [[lambda calculus|?view=calc2talk]], with a dictionary made of more than 150 core functions and tools to build new ones, leading to a {b programmable programming language} easy to use in daily life for creating and sharing rich documents, like this one. _p You are welcome in the {b lambdaway}, take time to visit pages [[quick]], [[overview]], [[lambdatalk three]], ... _p {i Alain Marty | 2016/08/31} } {center Document under construction.}