lambdaspeech
::
start
1
[
pages
][
login
][
load
]
{require lambdaspeech::lib_watch} {TITLE} ;; {QUICK} {div {@ style="position:absolute; top:100px; right:50px;"} {clock 200} } {{BLOCK #ffe} _p Following the initial {u [[workshop|http://lambdaway.free.fr/workshop/]]}, '{lambda speech} is a new environment hosting the '{lambda way} project, built on a wiki called '{lambda tank}, devoted to writing, composing and coding on the web, where the markup, styling and scripting are unified in a single language called '{lambda talk}. _p {i « Oh please nooooo! There are hundred of wiki engines and hundred of languages! Why yet another wiki and another language nobody will ever want to use? »} _p Please, let's talk about that. } {{BLOCK #eff} _h2 1) the language _p Let's discover {b '{lambda talk}} in a few words: _ul 1) Expressions are written in a prefix notation using curly braces, '{}, _ul 2) Away from curly braces words are just words {pre {@ style="padding-left:50px; background:#fff;"} Hello World // sequences of words can be written without quotes -> Hello World // as in any text or spreadsheet editor '{u 2 + 3} is equal to '{+ 2 3} // '{u 2 + 3} means "underline 2 + 3" -> {u 2 + 3} is equal to {+ 2 3} // '{+ 2 3} means "add 2 and 3" } _ul 3) Functions are created with {b lambda} and named with {b def} {pre {@ style="padding-left:50px; background:#fff;"} '{def smart_add // define the name {lambda {:a :b} // for a function of 2 arguments {b :a+:b} is {u equal} to {b {+ :a :b}} // the function's body } // end of lambda } // end of def -> {def smart_add {lambda {:a :b} {b :a+:b} is {u equal} to {b {+ :a :b}}}} '{smart_add 2 3} // call the function on 2 values -> {smart_add 2 3} } _p Note how easy it is to mix texts, enrichments, active/live computations and the creation of new functions. Something close to what can be done in any spreadsheet. In a more uniform and coherent syntax. _p Ok, ok, you don't like maths! Do you like watches? Just write {pre {@ style="padding-left:50px; background:#fff;"}°° {require lambdaspeech::lib_watch} {clock 200} °°} _p and, using the same syntax, you get the funny watch at the window's topleft, calling a code written in the page [[lib_watch]] by somebody ... who likes maths. With '{lambda talk} you are not alone in an empty space. Consider '{lambda talk} as this small runnable staircase in the huge vertical library at the top of the page, giving access to an infinity of books coming from the whole world. _p That's all! _p You can get more explanations in this [[quick_intro]], (french), and in this paper {u [[fabric_new]]}, (english). This is a list under construction of what can be found in this wiki: _ul a nice and useless [[advertising page|?view=pub]], _ul pages on [[computing]], [[numbers]], [[fibonacci]], [[switch]], [[gcd]], [[euler]], [[horner]], [[newton]], [[horner_newton]], [[prime]], [[big_numbers]], [[bigint]]s, [[BI]], [[BN]], [[formulas]], [[schwartzschild]], _ul see how to include in a page any code defined in others using [[require]], _ul play with partial calls, [[variadic]] functions and without [[closure]], _ul play with the [[let]] special form and [[macro]]s, _ul play with control structures without any [[if special form|?view=if]], _ul play with pairs, lists & trees at the λ-calculus level, [[PLT]], _ul discover [[array]]s, [[yyy]], [[serie, map & reduce|?view=map]], [[sort]] & [[quicksort]], _ul play with [[turtle]] graphics, the [[decasteljau2]] algorithm, the [[hilbert]] curve, [[wide_picts]], [[svg]], [[SVG_3D|http://lambdaway.free.fr/workshop/index.php?view=SVG_3D]], _ul play with the [[Towers of Hanoi|?view=hanoi]], _ul play with [[note]], [[show]], [[slide_show]], [[jslightbox]], [[menu]], [[iframe]], [[anchor]]s, _ul play with a [[spreadsheet]], _ul call Javascript and CSS code with [[script]]s and [[style]]s, _ul play with [[javascript]] as a dialect of λ-calculus, _ul study another parser in [[lambdacode]], (to be compared with [[lambdacode|http://lambdaway.free.fr/workshop/?view=lambdacode]]), _ul read a story about [[arms]] (french), _ul read a paper about [[invariants]], (french), _ul read a complete book from [[jules_verne]], (french), _ul read some [[reflexions|?view=reflexions_20180817]], (french), _ul view an amazing [[video]], _ul read the [[JS code|?view=speech]] to get asleep, _ul see how to [[restore|?view=localStorage]] a page, _ul {b download} the full [[machine|?view=speech]] to try at home, _ul do what you want in [[sandbox]], _ul tell me something in [[agora]], _ul ... _p More precisely, {b '{lambda talk}} is a pure functional language, a {b dialect of the λ-calculus}{sup (1936)} in a Lisp-like prefixed notation taking benefit of the powerful modern web browsers on which it stands as a light overlay, as a {i « dwarf on the shoulders of giants »}. _p The language comes with 9 special {i constructions} {center [{code {b lambda, def, if, quote|', let, macros, script, style, require}}]} {pre 1: '{lambda {args} body} -> anonymous function 2: '{def name expression} -> add a name to the dictionary 3: '{quote expression} or ''{expression} -> unevaluated expression 4: '{if bool then one else two} -> standard control structure 5: '{let { {arg val} ...} body} -> '{{lambda {args} body} vals} 6: '{script JS expressions} -> add JS scripts to your page 7: '{style CSS expressions} -> edit CSS rules of your page 8: '{macro regexp to speech exp} -> add syntaxic sugar 9: '{require page_1 page_2 ...} -> include external code, ({i still to be improved...}) } _p and an extendable set of built-in JS primitives {prewrap {b STRINGS} equal?, empty?, chars, charAt, substring, length, first, rest, last, nth, replace, serie, map, reduce, {b MATHS} +, *, -, /, %, <, >, <=, >=, =, not, or, and, abs, acos, asin, atan, ceil, cos, exp, floor, pow, log, random, round, sin, sqrt, tan, min, max, PI, E, {b ARRAYS} #.new, #.disp, #.array?, #.null?, #.empty?, #.in?, #.length, #.get, #.first, #.last, #.rest, #.slice, #.concat, #.set!, [#.addlast!|#.push!], ]#.sublast!| #.pop!], [#.addfirst!|#.unshift!], [#.subfirst!|#.shift!], #.reverse!, #.sort!, ##.split, #.join {b PAIRS, LISTS} [pair|cons], pair?, nil?, [left|car|list.first], [right|cdr|list.rest], pair.disp, list.new, list.disp {b HTML/CSS} @, div, span, a, ul, ol, li, dl, dt, dd, table, tr, td, h1, h2, h3, h4, h5, h6, p, b, i, u, center, br, hr, blockquote, sup, sub, del, code, img, pre, prewrap, textarea, audio, video, source, select, option, object, canvas, input, iframe {b SVG} svg, line, rect, circle, ellipse, polygon, polyline, path, text, g, mpath, use, textPath, pattern, image, clipPath, defs, animate, set, animateMotion, animateTransform, title, desc {b MISC} lib, date, hide, turtle, drag, localStorage.[display, getItem, removeItem, clear] } } {{BLOCK #fef} _h2 2) the wiki _p The user interface is reduced to the bare minimum: _ul 1) the [{b wiki name}] - here "lambdaspeech" - to come back to the home page from any other wiki page, _ul 2) the double colon [{b : :}] to open/hide a tool bar, _ul 3) the [{b page name}] - here "start" - to open/hide the editor frame. _p In the {b editor frame} you find a menu bar showing some informations and a wide text field in which you can write any words and expressions displayed and saved locally in real time, provided expressions are well balanced. For instance the expression '{b {i {u Hello World}}} is well balanced and displays {b {i {u Hello World}}}. And, if you are authorized, click on the button [{b save}] to upload the code on the server and so {b publish} the page. _p In the {b tool bar} you find: _ul the number of people connected, _ul a button [{b pages}] to display the list of pages saved on the server and have access to their history, _ul a button [{b login|logout}] for authorized editors, _ul a button [{b load}] to load files - pictures, pdfs, ... - in the data folder. {i This function is currently disabled}, _ul a [{b search field}] to open a page listing wiki pages containing the searched word. _p The view & editor frames can be moved inside the browser's window using the title/menu area as an handle, you can scroll the view and reduce or expand the editor to make editing comfortable, even on a mobile device. _p '{lambda speech} can be loaded as a {b ~25kb} [[zipped archive|?view=speech]]. _p That's all! } _h2 next step _p It's a work in progress. Things to do: _ul write a require function without a manual refresh, _ul improve the interface ... staying in the {i KISS} attitude! _ul add more built-in primitives, build full libraries, (rational & complex numbers, 2D/3D algebra, spreadsheet, ray-tracing, lightboxes, ...) _ul write a documentation, a tutorial, ... _p Your opinion is welcome! {center {i alain marty | marty•alain©free•fr | last update on 2018/09/07}} {hr} {center What doesn't kill you makes you stronger.} ;; img https://www.bowleswyer.co.uk/blog/wp-content/uploads/2014/02/geometry.jpg ;;; the following should be stored in another page "lib_start" {{hide} {def TITLE {img {@ src="http://lambdaway.free.fr/workshop/data/brussels/bibliotheque_virtuelle.jpg" width="100%"}} {div {@ style=" margin-top:-1.5em; font-size: 4.0em; text-align:center; color:#fff; text-shadow:0 0 8px #000;"} '{lambda speech} }} {def QUICK {div {@ style="position:absolute; top:100px; left:50px; font:bold 5em times; text-shadow:0 0 0px black; color:white; opacity:0.7;"} {a {@ href="http://lambdaway.free.fr/"}'{λy}}} {div {@ style="font-size:2.0em; margin:50px; text-align:center;"} If you are too busy and have no time,{br} then this [[advertising page|?view=pub]] is for you,{br} else you are welcome in this {br} '{λy} Summer Workshop 2018 } } {def BLOCK {lambda {:c} div {@ style="background::c; padding:20px 15px;"}}} } {style ;; @import url(https://fonts.googleapis.com/css?family=Quicksand); #content { font-family: Quicksand; font-size:1.5em; background:#eee; } body { background:#888; } #frame { background:#fff; width:100%; margin:0; padding:0; } #textarea { font:normal 1.2em courier; color:#000; background:#ccc; } p { text-indent:20px; text-align:justify; } h1, h2, h3, h4, h5, h6 { text-indent:20px; } b { color:#004; } a:hover { text-decoration:underline; } }
lambdaspeech v.20180812