wwwiki
::
start
+
| 1 |
help
|
pages
|
skin
|
login
|
code
www!k! v.20121031
! CE SITE NECESSITE JAVASCRIPT !
wwwiki :: éditeur
##TOC## ##TIC## {div {@ font:bold 5em georgia; text-align:center; background:#f00; color:white; text-shadow:2px 2px 2px black; line-height:0.9em; margin:10px 0px; } °°({[°°λ•y°°]})°°} {center {date}} {div {@ display:none;} {def w () (@ font:normal 0.8em arial; background:#888; color:#fff; margin-top:20px; padding-left:20px; box-shadow:2px 2px 2px black; -webkit-border-radius:10px; -moz-border-radius:10px; border-radius:10px; ) >>> }} {div {@ float:left; width:35%; border:1px solid; padding:10px; } °°°LEFT COLUMN°°° {div {@ margin-bottom:-22px; margin-left:15px;} {show {@ src:data/amelie_sepia.jpg; height:68px; width:300px;} amélie poulain loves ze lambda way !} } _p {y (λ way)} is a wiki text editor for {b composing and coding} in a {y standard browser} (FireFox, Chrome, Safari and I.Explorer-9) complex mutltimedia pages stored in the WWW cloud : _ul {b composing :} with the {y (λ talk)} syntax built on standard HTML/CSS, _ul {b coding :} with the {y (λ talk)} language, coming with predefined math functions and tools for creating new ones. {hr} _p {y (λ talk)} is based on the so-called [[s-expressions|http://en.wikipedia.org/wiki/S-expression]], coming from the [[λ-calculus|http://en.wikipedia.org/wiki/Lambda_calculus]] and the [[LISP|http://en.wikipedia.org/wiki/Lisp]] world. The basic idea of {b λ-calculus} is that {i « everything is function »}. The basic idea of {b LISP} is that {i « functions and data share the same shape »}. And the basic idea in the {b λ-Way} is that replacing the syntax of [[epsilonwiki|../]] {i « °°_tag{CSS|text}°° »} by {i « °°{first rest}°° »} would raise this good old wiki from a simple web text editor to an acceptable coding environment. {hr} _p This wiki rebuilds the previous one from which it will get selected informations, in a more structured and more complete way. More informations can still be seen in : _ul [[the previous version lambdaway|../lambdaway_one]], _ul [[lambdawiki|../lambdawiki]], the workshop before lambdaway _ul [[epsilonwiki|../]], the 5 years old grand brother. _ul [[mumuwiki|http://marty.alain.free.fr/mumuwiki/]], a micro wiki (about 150 lines PHP + 50 lines JS) {hr} _p You can : _ul test things in the page [[sandbox]] _ul or in the outside [[console|lambdatalk-parser]], _ul post a message in the page [[forum]], _ul or contact me at _ul30 marty•alain@free•fr. _p You're welcome on the {y (λ way)}. _p Alain Marty } °°°RIGHT COLUMN°°° {div {@ float:right; width:58%; border:1px solid; padding:10px;} {div {w} 2013/01/20 08:23} {div {@ font:bold 1.2em courier new; text-align:center; background:#ff8; border:1 px solid black; margin:10px 50px; box-shadow: 0 0 8px black; -webkit-transform:rotate(-2deg); -moz-transform:rotate(-2deg); transform:rotate(-2deg);} This workshop is closed.{br} Following works are to be seen in{br} [[lambdaway_2.0|../lambdaway_2.0/]] } {div {w} 2013/01/15 23:30} _p Start to build [[lambdaway_2.0|../lambdaway_2.0/]]. {div {w} 2013/01/13 21:38} _p Here we are ! The junction between lambdatalk, lambdalisp and the epsilonwiki engine is done in "lambdaway", tuned up and inline. It's time to feed some basic pages with a tutorial and a complete definition of the functionalities. Upon the basic functions for composing rich structured pages, inline and in real time, lambdaway gives three tools for coding : lambdatalk, lambdalisp and javascript. Lambdatalk will be used to make composing easier with a small but useful panel of basic tools (define, map, repeat, ...). Lambdalisp fills the gap to the world of powerful languages as LISP and opens a large window towards complex embedded programs in the wiki pages. And, last but not least, Javascript which is native to the browser, will be used for intensive interactive operations such as mouse design and graphic computing (think to WebGL). _p Soon on the racks of the good stores :) {div {w} 2013/01/11 16:34} _p And now : [[lambdatalk and lambdalisp|lambdatalk_20130111/]]. {div {w} 2013/01/11 09:15} _p To clean the code is not always a sinecure :(:( _p After a few days fighting against a vicious bug in lambdalisp, which randomly crashed the browser, I think that the code is now ready and secure. It can be tested in [[lambdalisp|lambdalisp_20130111/]]. _p Now the road to a mixed lambdatalk/lambdalisp syntax is open. _p See you soon. {div {w} 2013/01/06 22:11} _p Focusing on the Lisp part of lambdatalk : [[lambdalisp|lambdalisp_20130106/]], in order to clean all the obscure parts of the read/eval recursive parser. _p Hey you, passing by in this no man's land, feel free to say a little "Hello" in the page [[forum]]. I should appreciate :) {div {w} 2013/01/05 00:00 and 08:45} _p The new lambdatalk is now extended (but not replaced) by a Lisp engine and can be analyzed in this [[console|lambdatalk_20130104/]]. _p It will be soon integrated into lambdaway. _p It appears clearly that, in its actual state, this tiny Lisp code is limited to numerical works and is not for strings manipulations, compared to Lambdatalk. Grace to its academic implementation, this Lisp knows a lot about lambda functions and so can play with derivatives of a function and smart tings like this. Until now, Lambdatalk, in spite of its name, has no good lambda functions and is unable to play with derivatives of a function and smart tings like this. But it knows a lot about strings manipulations, mainly because of its wiki syntax origin. And it knows enough about functions to be useful in these manipulations and even in some math calculations. So, today, lambdatalk saves its own place, even before the Lisp code. It's fine to see that the academic and the epsilon approaches have each one its place. The first one's engine is built on a complex recursive parser, the second works in a simple and readble one-line loop based on the power of Regular Expressions. Both engines work on similar libraries. It will be interesting to compare the functionalities, the efficiency, the extendability. _p See you soon. {div {w} 2013/01/03 19:15} _p Last but not least : [[lispy|http://norvig.com/lispy.html]] from [[Peter Norvig|http://norvig.com/]] translated in Javascript by [[SreednathNS|http://sreedathns.blogspot.in/]] here in [[github|https://github.com/sreedathns/Lisp-interpreter-in-JavaScript]]. Much to learn ! {div {w} 2013/01/02 08:53} _p Boosted by the sreedathns' Lisp code Lambdatalk goes on : _ul (b bold) and (+ 1 2) are displayed as they are, _ul °°{b bold}°° and [+ 1 2] are evaluated and displayed as {b bold} and {+ 1 2}, _ul ¥¥°°{b bold}°°¥¥ and ££[+ 1 2]££ are not evaluated and displayed as they are. _p More in [[sreedathns|sreedathns/]]. {div {w} 2012/12/31 10:40} _p Some updates in [[sreedathns|sreedathns/]] : starting to integrate the lambdatalk syntax (You may force a page refresh). {div {w} 2012/12/30 16:40} _p Some updates in [[sreedathns|sreedathns/]] : Lisp expressions can be written intermixed in any text. You should have a look ! The next step will be the integration in the lambdatalk syntax. {div {w} 2012/12/27 23:45} _p Until now, this page contains 538 couple of braces and is scanned/evaluated through 35 loops in about 90 milli seconds ( in Firefox running on a 2.5Ghz MacBookPro ). {div {w} 2012/12/27 15:34 and 23:43} _p Note some changes in [[sreedathns|sreedathns/]] : note {b #[ (s-expression) ]#} instead of {b #( s-expression )#}. You may have to force a deep refresh of the page. _p Try this : {pre #[ (define pascal (lambda (n p) (if (or (= n 1) (= p 0)) 1 (/ (* n (pascal (- n 1) (- p 1))) p)))) ]# #[(pascal 0 0)]# #[(pascal 1 0)]#.#[(pascal 1 1)]# #[(pascal 2 0)]#.#[(pascal 2 1)]#.#[(pascal 2 2)]# #[(pascal 3 0)]#.#[(pascal 3 1)]#.#[(pascal 3 2)]#.#[(pascal 3 3)]# #[(pascal 4 0)]#.#[(pascal 4 1)]#.#[(pascal 4 2)]#.#[(pascal 4 3)]#.#[(pascal 4 4)]# #[(pascal 5 0)]#.#[(pascal 5 1)]#.#[(pascal 5 2)]#.#[(pascal 5 3)]#.#[(pascal 5 4)]#.#[(pascal 5 5)]# will display the Pascal's triangle : 1 1.1 1.2.1 1.3.3.1 1.4.6.4.1 1.5.10.10.5.1 } Your advice will be welcome in page [[forum]]. {div {w} 2012/12/26 21:29} _p A Christmas gift for lambdatalk : [[sreedathns|sreedathns/]]. Try this : {pre #[ (define newton (lambda (i x) (if (= i 1) 1 (/ (+ (newton (- i 1) x) (/ x (newton (- i 1) x))) 2 ) ) ) ) ]# (newton 8 2) -> #[ (newton 8 2) ]# = {sqrt 2} } _p and this : {pre #[ (define D (lambda (f) (lambda (x) (/ (- (f (+ x 0.01)) (f x)) 0.01) ) ) ) ]# ((D (D log)) 2) -> #[ ((D (D log)) 2) ]# = d{sup 2}log(x)/dx{sup 2} for x=2 } {div {w} 2012/12/22 21:09} _p One day after {b Apocalypse} the [[lambda]] concept is still a mistery ! {div {w} 2012/12/21 23:57} _p A few minutes before the {b Apocalypse} (apokalypsis means "unveiling" or "revelation"), I am reading something about [[functional programming|http://blog.nihilarchitect.net/archives/289/on-functional-programming/]]. Should I be on the wrong λ-way, or am I close to a revelation about lambda functions ? In my mind, "revelation" will come when their implementation in the code will be strong enough to allow things like this : {pre °° {define derivee with :f as {lambda (:x) {/ {- {:f {+ :x 0.01}} {:f :x}}} 0.01}} and d(log(x))/dx at 2 = {{derivee log} 2} -> 0.5 d^2(log(x))/dx^2 at 2 = {{derivee {derivee log}} 2} -> 0.25 °°} _p Until now it doesn't work and we are 3 minutes before Apocalypse :( {div {w} 2012/12/18 16:46} _p These days, I spent time doing some work in the basement of lambdatalk, in order to strength its functionalities and to improve its coherence. Meanwhile, remembering HyperTalk and its "verbose plain english", I was led to change slightly a few elements of the syntax. For instance, the operator "def" will be written this way : {pre °°{define function_name with arguments_list as function_body}°°} _p Applied to the function factorial, the initial syntax was : {pre °° {def fac (:n) {if {= :n 1} then 1 else {* :n {fac {decr :n}}} } } °°} _p and the new one will be : {pre °° {define fac with :n as {if {= :n 1} then 1 else {* :n {fac {-- :n}}} } } °°} _ul the argument's parenthesis (:n) " are replaced by " with :n as ", _ul "def" is replaced by "define", more readable and coherent with the new arguments syntax, _ul the code of the "define" operator is more clean, the defines are catched, extracted and stored in the "dictionary" before the evaluation loop, and so the braces are everywhere, no more parenthesis around arguments or in the body. _p The 3 dictionaries "html, core_func and user_func" are reduced to 2 "dico and user". Some work is still to be done on the "lambda" functions, and the new parser will be soon accessible inline. Alleluhiah ! {div {w} 2012/12/11 07:00} _p Tomorrow will be the 12/12/2012. At twelve to twelve plus twelve seconds, 1 355 335 932 seconds will have passed after the [[Unix|http://www.unixtimestamp.com/index.php]] time's origine, based on January the first of 1970. According to the Maya's calendar, it will remain 1 356 113 532 - 1 355 335 932 = 777 600 seconds until the last day of the Universe, on December the 21th at 12:12:12. 777 600 seconds are equal to 12 960 minutes or 216 hours (and 9 days of course). 216 is a magic number which seems to hold a central place in the Thora. It is equal to 6x6x6 which reminds 666, not a gentle number. Strange, isnt'it ? {div {w} 2012/12/07 23:59} {center {show {@ src:data/coons_4polys.jpg; height:400px; width:600px;}A Coons patch built on cubic-splines, a diagonal and 4 embedded regular polygons (triangle, square, pentagon and hexagon).}} _p Yesterday, working on a new shape interpolating some cubic-splines, I discovered that [[lambda3D|?view=3D]] worked fine in Firefox and not in Chrome or Safari. Probably something related to the little differences between the JS engines, "Geko" or "WebKit". Because the Chrome's JS engine is often more strict then the Firefox's one, I guessed first that the new code has to be cleaned and I worked a long time in this way. With the help of the Firebug's error messages, I discovered that the length of the JS code had just exceeded the limit of 65535 characters. Cleaning some parts of the code in order to go down this limit resolved the problem. It must be noticed that all the browsers can handle much longer strings. For instance, the page [[julesverne]] contains a string of more than 1.2Mo wich generates no problem at all. Until now, I don't know where is the limit. What I know is that the "Geko" engine of Firefox handles JS strings more then 64ko, and the "Webkit" engine of Chrome and Safari don't. _p So it's time to segment the code in lambda3D ! {div {w} 2012/12/06 08:57} _p Today I just discover [[HOP|http://hop.inria.fr/usr/local/lib/hop/2.3.2/weblets/home/articles/hop-lang/article.html]], «a new higher-order language designed for programming interactive web applications such as web agendas, web galleries, music players, etc.». A lot of things to study ... {div {w} 2012/12/02 15:42} _p It should be fine to get the benefit of the [[MathJax|http://www.mathjax.org]] libraries in lambdaway for a perfect management of MathML and LaTeX in every browsers (Chrome doesn't know MathLM and LaTeX needs some pluggin). But it is a little tricky to embed them, and I am still fighting with conflicts between them and the wiki engine during the loading phase. See you soon. {div {w} 2012/11/26 19:31 updated 21:50} _p See how [[mathML]] is easy with lambdatalk. Isnt'it ? And how without mathML, it is still possible to write in a more easy way rather good Math expressions : [[shell]]. {div {w} 2012/11/25 21:53} _p Today in [[lambda3D|?view=3D]], a Coons surface interpolating cubic-splines. {center {show {@ src:data/coons_spline.jpg; height:400px; width:600px;} A Coons surface interpolating cubic-splines}} {div {w} 2012/11/23 09:17} _p Code for a Binary Search Tree in page [[BST]]. {div {w} 2012/11/22 21:10 updated on 2012/11/24} _p What about playing with math expressions ? With the help of 5 user's functions : {blockquote {def formula () (@ display:inline-block; border:1px solid #ccc; vertical-align:middle; font:italic 1em 'Times New Roman'; ) } {def symb (:text) (span (@ position:relative; top:-0.6em; font-size:2em; margin-left:0.2em;):text) } {def sigma (:inf :sup) (span (@ position:relative; display:inline-block; text-align:center; margin-left:-1.0em;) (span (@ display:block; line-height:1.0em;):sup) (span (@ display:block; line-height:0.7em; font-size:3em; font-style:normal;)Σ) (span (@ display:block; line-height:1em;):inf) ) } {def ratio (:inf :sup) (span (@ display:inline-block; position:relative; top:-1.0em; text-align:center;) (span (@ display:block; border-bottom:1px solid;):sup) (span (@ display:block;):inf) ) } {def aij (:text :i :j) (span (@ position:relative; top:-0.6em; font-size:2em;):text (span (@ position:relative; top:0.4em; left:-0.5em; font-size:0.5em;):i) (span (@ position:relative; top:-1em; left:-0.9em; font-size:0.5em;):j) ) } } _p the following expression : {pre °° {p Some useful {span {formula}{symb F}{symb =}{sigma i=0 n} {ratio i!×(n-i)! n!}{symb ×}{aij F & nbsp; i} } math expression} °°} _p displays this : {p Some useful {span {formula}{symb F}{symb =}{sigma i=0 n}{ratio i!×(n-i)! n!}{symb ×}{aij F i}} math expression.} _p It's not LaTeX but it is not so bad, isnt'it ? It's a work in progress, a lot is to be done before mastering side effects and so on. More to see in the [[latex]] page. {div {w} 2012/11/20 15:10} _p The 1900 lines of JS code of [[lambda3D|?view=3D]] are now divided into five main functions. Each function behaves as a closed modulus with a public interface. The code becomes cleaner, easier to edit and to extend. Things to do : _ul coding a function for embedding a pSurface in a pVolume, _ul and then testing EFFD (Extended Free form Deformation) by embedding pForms in a pVolume, _ul writing a good documentation for lambda3D ... _p See you soon. {div {w} 2012/11/19 19:55} _p [[Coons patches|http://www.mathcurve.com/surfaces/patchcoons/patchcoons.shtml]] visit [[lambda3D|?view=3D]]. {div {w} 2012/11/16 22:05} {center {diapo {@ height:300px; width:700px;} [data/viviani_1.jpg A semi-sphere made of 4 pS33 with their diagonals and a cylinder.] [data/viviani_2.jpg The four diagonals gives a Viviani curve (the intersection of a sphere and a cylinder).] [data/villarceau_1.jpg Diagonal of a pTorus looks like a cicle of Villarceau, intersection with a tangent plane.] [data/villarceau_2.jpg Maybe nothing but an intersections with an orthogonal cylinder of equal main radius.] }} _p As it may be seen in [[wikipedia|http://www.mathcurve.com/courbes3d/viviani/viviani.shtml]], the intersection of a sphere of radius R and a cylinder of radius R/2 and tangent to the sphere is called a Viviani's window. Its parametric equation is : {pre x = R.cos(u).cos(u) y = R.cos(u).sin(u) z = R.sin(u) with u in [0,2π] which is the sphere equation with u = θ = φ, defining a curve running in diagonal on the sphere. } _p In the Pascalian Forms approach ( see [[pForms|http://marty.alain.free.fr/pFwiki/?view=abstract]] or [[straightaway|http://marty.alain.free.fr/recherche/pformes/straightaway.pdf ]] ), it appears that this curve is close (or equal ?) to a "straight line" on the surface of the sphere (and of the cylinder). The hemi-sphere shown is made of four identical patches, which are pSurfaces controlled by 9 points (ie 3 parabolas, named pS33). Their diagonals (in red color) are "straight" segments immersed equivalent to pCurves of the space controlled by 5 points ( 5-1 = (3-1)*(3-1) ). Their concatenation gives the Viviani curve, or something close to. _p In order to produce pipe surfaces (tubes), we have to translate section curves along paths and we need to compute Serret-Frenet frames on a sequence of points of the curve. Computing the Serret-Frenet frame on a point of such a curve is not easy, some differential calculus is to be done. Grace to the nature of pCurves, computing this frame for such a curve is easier and doesn't need differential calculus, nothing but some vectorial algebra (dot product and vectorial product). _p You can play with it in [[lambda3D|?view=3D]]. {div {w} 2012/11/15 09:40} _p With [[lambda3D|?view=3D]] I forget for a while the "S-expression" syntax and play with Javascript. Javascript can be seen as an "assembly language" embedded in the browser seen as a virtual Operating System. When the algorithms will be stabilized, it will be possible to wrap the public functions in a "S-expression" syntax, in order to integrate 3D calls in the wiki page. For instance, as well as {b °°{* 1 2 3}°°} displays {b 6}, this kind of expression {b °°{W3D.draw {@ uv:'u';} {PF.build ship {rec 3 3}}}°°} could display a ship in a canvas window. The question is : is it useful ? {div {w} 2012/11/14 23:51} _p In [[lambda3D|?view=3D]] surfaces become thick, ie {b true volumes}. {center {show {@ src:data/thick_ship.jpg; height:400px; width:600px;}The shell of a ship with a constant thickness, controlled by 30 points and a number.}} {div {w} 2012/11/11 00:26} {center {diapo {@ height:300px; width:700px;} [data/tube_u.jpg A pipe generated by a section translated along a cubic path and some of its TNB axis (display U lines)] [data/tube_v.jpg A pipe generated by a section translated along a cubic path and some of its TNB axis (display V lines)] [data/tube_w.jpg A pipe generated by a section translated along a cubic path and some of its TNB axis (display triangles)] }} _p And now, [[lambda3D|?view=3D]] can generate tubes (pipes) with a section translated along a path. Code : {pre °° W3D.draw( // draw in world 3D PF.tube( // a tube generated by a section along a path PF.build( // path : a cubic controlled by four 4D points [ {x:-150, y:-150, z:-150, w:1}, {x: 150, y:-150, z:-150, w:1}, {x: 150, y:-150, z: 150, w:1}, {x: 150, y: 150, z: 150, w:1} ], 3 // level of recursion on path -> blossom ), PF.build( // section : a circle arc [0°,180°] PF.arc_180 ( 50, // radius -0.4, // default : 0.0 -> 0° 1.4 // default : 1.0 -> 180° ), 4 // level recursion on section -> blossom ) ), uv // display parameter u|v|w ); °°} {div {w} 2012/11/01 19:40} _p Today, [[lambda3D|?view=3D]] does clipping of objects and can display surfaces as triangles. {div {w} 2012/10/31 23:40} _p Sliders have been added to input buttons in [[lambda3D|?view=3D]] in order to play in real-time with rotations, focal distance and scale. It works fine in Chrome and Safari, not in Firefox which doesn't yet know about sliders. {div {w} 2012/10/25 9:37 and 19:53} _p Today, with [[lambda3D|?view=3D]] it is possible to play with TRUE volumes (they are full of points, not only 6 faces and nothing inside), stretch them between two points, get a first diagonal which is a surface, and a second diagonal which is a curve. It is possible to embed curves in surfaces or volumes and do some geometry. Volumes can be used as global deformation boxes for embedded curves, surfaces and volumes. Forms are NRBs (Non Rational Bezier) forms. It's a work in progress direct in the wiki used as a complete development tool ... _p When I am looking to the WEBGL demos, I find them awesome and ... I need it ! But when I consider the javascript frameworks (threeDjs and others), I find them a little bit "obfuscated" and I wonder if I will easily insert in them "my" Pascalian Forms tools. Some work to do with my 600 lines of raw JS, before jumping in those noodle sets. {div {w} 2012/10/20 08:16} _p Few days ago a friend of mine asked me : « Hey man, why do you waste your time in writing your own version of [[3D]] ? Don't you know the DRY attitude : {b Don't repeat yourself !} _p OK, OK, my friend, I know about [[DRY|http://en.wikipedia.org/wiki/Don%27t_repeat_yourself]], and about {b WET} too (Write Everything Twice) and even {b WETTT} (Write Everything Ten Thousand Times). And I know good frames like [[three.js|http://mrdoob.github.com/three.js/]] for everything you want in 3D, or jQuery for everything you want for easily write WEB pages. _p My goal is {b Less is more} and the way to it is a long spiral stairs slowly converging up to a minimal polished algorithmic poem. Understanding things needs to clean information. And I want to understand things. Not only to use clever external tools. Don't you ? {div {w} 2012/10/19 09:24} _p The last [[3D]] code is cleaner then [[yesterday|http://www.youtube.com/watch?v=lwS_YDzxH3M]]'s. Not to speak of tomorrow ... {div {w} 2012/10/14 09:24} _p Today lambdaway is entering the brave [[4D]] world. {div {w} 2012/10/13 09:52} _p An update for the 3D code can be seen in page [[curves]]. {div {w} 2012/10/06 12:15} _p Another Ligthbox effect to consider : [[Slimbox|../slimbox/]]. Will be soon integrated in Lambdaway as a "sophisticated" alternative built on a jQuery library. But some work is to be done with [[Using_jQuery_with_Other_Libraries|http://docs.jquery.com/Using_jQuery_with_Other_Libraries]] ! {div {w} 2012/09/30 11:45} _p New Lightbox effects are now integrated in Lambdawiki : {diapo {@ height:100px; width:300px;} [data/amelie_sepia.jpg amélie] [data/franchouillard.jpg french prototype] [data/1984.jpg from Georges Orwell...] } _p Code can be seen here : [[lightbox.js|meca/lightbox.js]] and [[lightbox.css|skins/lightbox.css]], called by [[JS.js|meca/JS.js]]. _p Last archive can be downloaded : [[archive|archive.zip]] (80 kb). {div {w} 2012/09/24 08:33} _p {span {@ color:red;}NEW !!} : [[Lightbox effects|../lightbox/]]. _p The Lightbox effect from [[Loresh Dhakar|http://lokeshdhakar.com/projects/lightbox2/]] is beautiful and easy to use. It is built on Jquery libraries, with a 175kb JS+CSS code, complex and unreadable. It is not exactly minimalist ! So, I wrote a more "spartiate" lightbox effect on 150 lines of 12kb JS+CSS code. The code is readable for a human being, can be easily edited, and will be soon integrated in epsilonwiki/lambdawiki. It works in Firefox, Safari and Chrome. What do you think of it ? Does it work in M$Internet Explorer ? What should be improved ? Any idea to put some "CSS smooths" effects ? _p See you soon. {div {w} 2012/09/17 11:00} _p Consider this block of text : {div {@ color:red; font-family:courier new; text-align:center; padding:0 40px; border:1px solid; }This sentence contains a word in bold style : {b Fatboy}, another in italic style : {i ThinGirl} and an arithmetic expression : 5! = 120.} _h6 Evolution of the syntax _p In [[mumuwiki|http://marty.alain.free.fr/mumuwiki/]] the syntax was nothing but {y plain HTML/CSS} : {pre {@ white-space:pre-wrap;} < div style="color:red; font-family:courier new; text-align:center; padding:0 50px; border:1px solid;"> This sentence contains a word in bold style : < b>Fatboy< /b>, another in italic style : < i>ThinGirl< /i> and an arithmetic expression : 5! = 120. < /div> } _p In [[epsilonwiki|../]] the syntax is : {y °°_tag{CSS|text}°°} : {pre {@ white-space:pre-wrap;}°° _div{ color:red; font-family:courier new; text-align:center; padding:0 50px; border:1px solid; | This sentence contains a word in bold style : _b{Fatboy}, another in italic style : _i{ThinGirl} and an arithmetic expression : 5! = 120. } °°} _p In [[lambdawiki|../lambdawiki]] the general syntax becomes {y °°{first rest}°°} : {pre {@ white-space:pre-wrap;}°° {div {@ color:red; font-family:courier new; text-align:center; padding:0 50px; border:1px solid; } This sentence contains a word in bold style : {b Fatboy}, another in italic style : {i ThinGirl} and an arithmetic expression : 5! = {fac 5}. } °°} _p In {b lambdaway}, lambdatalk brings more power : {pre {@ white-space:pre-wrap;}°° {def frame (:col) (@ color::col; font-family:courier new; text-align:center; padding:0 50px; border:1px solid; ) } {def content (:n) This sentence contains a word in bold style : (b Fatboy), another in italic style : (i ThinGirl) and an arithmetic expression : :n! = (fact :n). } {div {frame red} {content 5}} -> This ... 120 (red) {div {frame green} {content 6}} -> This ... 720 (green) {div {frame blue} {content 7}} -> This ... 5040 (blue) °°} _p Note : The definition of frame and content could be externalized in other wiki page for a better modularity. _p This is the {y λ way}. _p See you soon. {div {w} 2012/09/16 16:52} {blockquote _p "We act as though comfort and luxury were the chief requirements of life, when all that we need to make us happy is something to be enthusiastic about." Albert Einstein _p "Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great." Mark Twain } _p Thanks, Albert, you are so nice ! And, You, great people, listen to Mark, I need your help to keep enthusisam !! _p @+ {div {w} 2012/09/16 09:27} _p A lot of things to learn from [[Paul Graham|http://www.paulgraham.com/]]... {div {w} 2012/09/10 15:45} _p The shortest definition of {y λ-talk} : inline coding dynamic web page. {div {w} 2012/09/04 12:08} _p The λ-talk console is [[relooked|lambdatalk-parser]], refresh the browser and play with it ! {div {w} 2012/09/03 13:00} _p When I read such a paper [[Y-combinator|http://matt.might.net/articles/implementation-of-recursive-fixed-point-y-combinator-in-javascript-for-memoization/]], I desesperate not to be abble to understand its true meanings. When I read that « {i The end result is that the 100th Fibonacci number is computed instantly, whereas the naive version (or the version using the ordinary Y combinator) would take well beyond the estimated lifetime of the universe.} », I know I must understand it ! See you soon. {div {w} 2012/09/01 08:45} _p Some pages (13) coming from previous wikis have been added and tuned up in this wiki : {b [[substitution]], [[equation]], [[dates]], [[map]], [[animation]], [[clock]], [[pencil]], [[paint]], [[poster]], [[shapes 1|?view=canvas:shapes1]], [[shapes 2|?view=canvas:shapes2]], [[contenteditable]], [[arithmetic]]}. _p Note : {i If the links to these pages aren't visible in the left navigation panel, you may empty the browser's cache for refresh it and have an access to the links.} _p If you find an interest in some of them, please, tell me about in [[forum]]. {div {w} 2012/08/30 17:40} _p The website [[http://altjs.org|http://altjs.org]] is a collection of languages and tools aimed at rebooting JavaScript and making it better. In this collection can be found ports of Lisp allowing coding directly in the browser. It's a lot of good work and examples to learn from. LambdaTalk will never be in this collection, my intention is not to create another dialect of LISP, I don't think I should be able to do that, it's a huge work. I just want to use a tiny part of the Lisp syntax as a guide to build coherent syntax for the lambdawiki's functionalities, nothing but a kind of lambdaway to follow. _p I want to be able to use s-expressions such {b °°{* 1 2 3 4}°° -> {* 1 2 3 4}} ; it's the easiest part. I want to be able to define reusable blocks of such expressions, so to define vars and functions ; it's more difficult. I want to have useful tools, for instance iterative functions such °°{for i in [0,9] do someting}°° or °°{map some-function to a serie of integers}°°, that's not so easy. And with these functionalities, I want to build easily, from the "dummy" level to the "geek" level, rich composed pages for sharing good information. _p And I want to preserve a very simple engine to do that, a few lines of PHP and of Javascript, easy to read and to share with you. With the hope that "you" will give me back a better code to go further :) :) _p See you soon. {div {w} 2012/08/30 17:15} _p Playing with a [[lambdatalk console|lambdatalk-parser/]], unattached to the wiki set. For instance, you can test this : {pre °°{def fac (:n) (if (= :n 1) then 1 else (* :n (fac (decr :n))) ) } {+ 1 {for :i in [1,9] do (inv (fac :i)) 0 }} °°} _p You should get {E}, the Euler's number ? {div {w} 2012/08/23 20:33} _p Playing with Canvas and [[3D]] curves and surfaces. {div {w} 2012/08/22 20:00} _p In Lisp defining a function is done this way : {b (defun name (args) body)}. In Scheme defining a function is done this way : {b (define (name args) body)}. The first choice for LamnbdaTalk : {b °°{def (name :args) body}°°}, has been replaced by this one : {b °°{def name (:args) body}°°}, which makes much more clean the code of two fundamental functions of the parser : {b def} and {b evaluate} : _ul {b def} accepts un unlimited number of nested inline local defs and lambdas, _ul {b evaluate} accepts an unlimited number of local lets and recursive functions. _p Example : {pre °° {def do (:a) (def re (:b) (def mi (:c) (def fa (:d) (def sol (:e) (def la (:f) (def si (:g) :g )(+ :f (si 100)) )(+ :e (la 100)) )(+ :d (sol 100)) )(+ :c (fa 100)) )(+ :b (mi 100)) )(+ :a (re 100)) }°° -> {def do (:a) (def re (:b) (def mi (:c) (def fa (:d) (def sol (:e) (def la (:f) (def si (:g) :g )(+ :f (si 100)) )(+ :e (la 100)) )(+ :d (sol 100)) )(+ :c (fa 100)) )(+ :b (mi 100)) )(+ :a (re 100)) } °°{do 1000}°° -> {do 1000} } {div {w} 2012/08/17 16:00} _p Some bugs fixed, some others no. An archive for testing lambdaway can be downloaded from page [[help]]. Your opinions will be appreciated ! _p Reading a lot of reflexions in books and websites about lambdas, closures, scope, functional versus imperative, ... reinforced the idea that LambdaTalk won't be a "Yet another" lisp dialect, even a micro/nano/pico one, and that it is a good thing ! If LambdaTalk lets script easily readable s-expressions, aggregate them in useful functions grouped in libraries (wiki pages), building a solid, modulable and extensible set of functionalities, it will be the right tool for the considered work : inline coding dynamic web pages. More to come ! {div {w} 2012/08/11 09:40} _p The parser handles now correctly "defs" with inside recursive function : {pre Factorial with an inside tail-recursive function, :acc is an accumulator, number of loops : 3*n+1 1) defining °°{def fac (:n) (def iter (:n :acc) (if (= :n 1) then :acc else (iter (decr :n) (* :acc :n) ) ) ) (iter :n 1) }°° -> {def fac (:n) (def iter (:n :acc) (if (= :n 1) then :acc else (iter (decr :n) (* :acc :n) ) ) ) (iter :n 1) } 2) calling °°{fac 7}°° -> {fac 7} } {div {w} 2012/08/10 15:00} _p The parser handles now correctly "defs" with inside defs and lets : {pre 1) user function with inside let : poly1 = (x+1){sup 3} + (x+1){sup 2} + (x+1) + 1 1.1) defining °°{def poly1 (:x) (let :x1 (+ :x 1)) (let :x21 (* :x1 :x1)) (let :x31 (* :x21 :x1)) (+ :x31 :x21 :x1 1) } °° -> {def poly1 (:x) (let :x1 (+ :x 1)) (let :x21 (* :x1 :x1)) (let :x31 (* :x21 :x1)) (+ :x31 :x21 :x1 1) } 1.2) calling °°{poly1 1}°° -> {b {poly1 1}} (for x=1 : 2{sup 3}+2{sup 2}+2+1=15) 2) user function with inside def : poly2 = (x+1)(x-1) = x{sup 2}-1 2.1) defining °°{def poly2 (:x) (def add1 (:a) (+ :a 1)) (def sub1 (:a) (- :a 1)) (* (add1 :x) (sub1 :x)) }°° -> {def poly2 (:x) (def add1 (:a) (+ :a 1)) (def sub1 (:a) (- :a 1)) (* (add1 :x) (sub1 :x)) } 2.2) calling °°{poly2 10}°° -> {poly2 10} ( (10-1)(10+1) = 10{sup 2}-1 = 99) } _h6 Note : _ul The variables :x32, :x21 and :x1 are locals and disappear at the end of the function. Being created by the "def" operator, the inside functions add1 and add2 are globals and stay alive at the end of the function. But their names are randomized (like lambda functions), so they can be considered inaccessible out of the embedding function. _ul All the function definitions are local to the wiki page and are killed by the browser when leaving the page (a kind of garbage collector). It's possible to define functions in a page (say myLibrary) and to call them in an other page using the pragma : {center # #myLibrary# #} }