lambdaway
::
radotages
5
|
list
|
login
|
load
|
|
{div {@ style="position:fixed; top:80px; left:150px; transform:rotate(-10deg);"} {input {@ id="toggle" style="font-size:2.0em; background:transparent;" type="button" value="english" onclick="toggle(this)"}} } {uncover https://www.francetvinfo.fr/pictures/pNDu0VwPBThZDXf7IFgwTxKaktQ/71x0:1209x640/944x531/filters:format(webp)/2019/04/12/vlcsnap-2015-11-05-11h54m55s157.png 100 350 _fr "J'ai toujours souhaité que mon ordinateur soit aussi facile à utiliser que mon téléphone ; mon souhait s'est réalisé car je n'arrive plus à comprendre comment utiliser mon téléphone." ([[Bjarne Stroustrup|https://fr.wikipedia.org/wiki/Bjarne_Stroustrup]]) _en "I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone." ([[Bjarne Stroustrup|https://fr.wikipedia.org/wiki/Bjarne_Stroustrup]]) } _h1 λw.x x _fr Inlassablement je cherche la substantifique moëlle du langage de programmation, du {b code}, la formule première dont tout le reste découle. Pour l'heure j'en suis à celle-ci « {b λw.x x} », réécrite sous une forme plus opérationnelle, {b '{{lambda {:words} expression} expression}}, une syntaxe qui a le mérite d'être comprise par mon langage maison, {b lambdatalk}, cf [[coding]]. _en I'm tirelessly looking for the essence of the programming language, of {b code}, the first formula from which everything else follows. For the moment I am at this one « {b λw.x x} », rewritten in a more operational form, {b '{{lambda {:words} expression} expression}}, a syntax which has the merit of being understood by my homemade language, {b lambdatalk}, cf [[coding]]. _fr Fondamentalement il ne s'agit que d'un simple processus de remplacement de mots. Par exemple _en Basically it is just a word replacement process. For instance {pre '{{lambda {:a} My name is :a.} Bond} -> {{lambda {:a} My name is :a.} Bond} } _fr ou bien _en or else {pre '{{lambda {:a} My name is :a {{lambda {:b} and my christian name is :b.} James}} Bond} -> {{lambda {:a} My name is :a {{lambda {:b} and my christian name is :b.} James}} Bond} } _fr ou encore _en or else {pre '{{lambda {:a :b} My name is :a and my christian name is :b. } Bond James} -> {{lambda {:a :b} My name is :a and my christian name is :b.} Bond James} } _fr De façon plus utile, voici comment on peut intervertir deux mots _en In a more useful way, here's how we can swap two words {pre '{{lambda {:a :b} :b :a} James Bond} -> {{lambda {:a :b} :b :a} James Bond} } _fr et en donnant un nom à l'expression interne assez illisible, {b '{lambda {:a :b} :b :a}} les choses s'humanisent très nettement _en and by giving a name to the rather unreadable internal expression, {b '{lambda {:a :b} :b :a}} things become very human {pre '{def SWAP {lambda {:a :b} :b :a}} -> {def SWAP {lambda {:a :b} :b :a}} '{SWAP James Bond} -> {SWAP James Bond} '{SWAP Amélie Poulain} -> {SWAP Amélie Poulain} } _fr En cachant sous un nom facile à retenir une expression dont on n'a pas à connaître les détails, on a tout simplement créé une {b abstraction}, on a ajouté la fonction {b SWAP} disponible à la demande, {b applicable} à toute séquence de mots. On dispose ainsi d'un couple {b abstraction / application} opérant sur un couple quelconque de mots. _en By hiding under an easy-to-remember name an expression of which we don't need to know the details, we have simply created an {b abstraction}, we have added the {b SWAP} function available on demand, {b applicable} to any sequence of words. We thus have a couple {b abstraction / application} operating on any couple of words. _fr Et tout s'enchaine ainsi de façon incroyablement simple. Avec comme seuls outils les fonctions et les définitions nous pouvons construire les booléens, les paires, les listes, les arbres, les boucles récursives et itératives, l'arithmétique, les commandes graphiques, tout ce florilège de concepts qui peuplent les langages de programmation, introduits tout simplement, sans aucune zone d'ombre, a minima. En l'espace de deux ou trois pages, (cf [[divine_recursion]]), on peut par exemple exprimer sous la forme primitive, {b λw.x x}, la solution du [[problème des Tours de Hanoï|?view=hanoi]] : _en And so everything follows in an incredibly simple way. With only functions and definitions as tools we can build booleans, pairs, lists, trees, recursive and iterative loops, arithmetic, graphical commands, all these concepts that populate programming languages, introduced quite simply, without any grey area, at a minimum. In the space of a two or three pages, (cf [[divine_recursion]]), one can for instance express in the primitive form, {b λw.x x}, the solution of the [[Towers of Hanoi problem|?view=hanoi]]: _img http://lambdaway.fr/workshop/data/AnimeHanoiNB.gif {pre '{{{lambda {:g} {:g :g}} {lambda {:g :n :from :to :via} {{{lambda {:a :b :c} {:a :b :c}} {{lambda {:c} {:c {lambda {:a :b} {lambda {:a :b} :b}}}} :n} {lambda {:g :n :from :to :via} } {lambda {:g :n :from :to :via} {:g :g {{lambda {:c} {:c {lambda {:a :b} :b}}} :n} :from :via :to} {br} move {{lambda {:c} {:c {lambda {:a :b} :a}}} :n} from tower :from to tower :to {:g :g {{lambda {:c} {:c {lambda {:a :b} :b}}} :n} :via :to :from} }} :g :n :from :to :via}}} {{lambda {:a :b :c} {:c :a :b}} Disk_1 {{lambda {:a :b :c} {:c :a :b}} Disk_2 {{lambda {:a :b :c} {:c :a :b}} Disk_3 {{lambda {:a :b :c} {:c :a :b}} Disk_4 {lambda {:a :b} :b}}}}} A B C} -> {{{lambda {:g} {:g :g}} {lambda {:g :n :from :to :via} {{{lambda {:a :b :c} {:a :b :c}} {{lambda {:c} {:c {lambda {:a :b} {lambda {:a :b} :b}}}} :n} {lambda {:g :n :from :to :via} } {lambda {:g :n :from :to :via} {:g :g {{lambda {:c} {:c {lambda {:a :b} :b}}} :n} :from :via :to} {div} move {{lambda {:c} {:c {lambda {:a :b} :a}}} :n} from tower :from to tower :to {:g :g {{lambda {:c} {:c {lambda {:a :b} :b}}} :n} :via :to :from} }} :g :n :from :to :via}}} {{lambda {:a :b :c} {:c :a :b}} Disk_1 {{lambda {:a :b :c} {:c :a :b}} Disk_2 {{lambda {:a :b :c} {:c :a :b}} Disk_3 {{lambda {:a :b :c} {:c :a :b}} Disk_4 {lambda {:a :b} :b}}}}} A B C} } _fr Déplacements de disques vus comme remplacements de mots. Le Yin et le Yang en pleine action sur un océan de mots. Le TAO de l'information. Le vide créateur. _en Disk movements seen as word replacements. Yin and Yang in action on an ocean of words. The TAO of information. The creative void. _fr Je ne comprends toujours pas la totale indifférence dans laquelle une approche aussi simple se trouve plongée, en particulier dans le monde de l'enseignement des langages de programmation qui apparaît comme un chemin bien tortueux et qui mériterait à mon avis quelques remises en question. _en I still don't understand the total indifference in which such a simple approach is plunged, in particular in the world of teaching programming languages, which appears to be a very tortuous path and which, in my opinion, deserves some reconsideration. _fr C'est un mystère. _en It's a mystery. _p {i alain marty | 2022/02/16} ;; Translated with www.DeepL.com/Translator (free version) {macro _fr ([^\n]+)\n to {p {@ class="fr"}€1}} {macro _en ([^\n]+)\n to {p {@ class="en"}€1}} {style #page_content { background:#eee; } pre { background:#fff; box-shadow:0 0 8px #000; padding:5px; } h1, h2, h3 { text-align:center; margin-left:-20px} .fr { display:block; } .en { display:none; } } {script var toggle = function(obj) { var fr = document.getElementsByClassName("fr"); var en = document.getElementsByClassName("en"); if (obj.value==="english") { for (var i=0; i< fr.length; i++) fr[i].style.display="none"; for (var i=0; i< en.length; i++) en[i].style.display="block"; obj.value = "french"; } else { for (var i=0; i< fr.length; i++) fr[i].style.display="block"; for (var i=0; i< en.length; i++) en[i].style.display="none"; obj.value = "english"; } }; }
lambdaway v.20211111