lambdaway
::
hypercard
6
|
list
|
login
|
load
|
|
_img http://epsilonwiki.free.fr/portail/data/microarchi_1.jpg _p This wiki is taking on a HyperCard feel every day. _p No wonder, [[Ward Cunningham|http://fr.wikipedia.org/wiki/Ward_Cunningham]] the inventor of the wiki concept was a fan of [[HyperCard|http://fr.wikipedia.org/wiki/HyperCard]], designed by [[Bill Atkinson|http://fr.wikipedia.org/wiki/Bill_Atkinson]] and its built-in language HyperTalk, designed by Dan Winkler. Ward Cunningham says that the wiki concept owes a lot to HyperCard, which is not immediately obvious. _p And I ask to myself: {i « when will a coherent language be developed for wikis? »} _h2 memories of a stack, µA() _p A long time ago, in {b May 1989}, as part of a competition on the development of applications on the Mac, I proposed a work done on HyperCard, the "µArchitecture" project. At that time I was working on a Mac+ with a 9" 512x342 screen, 1Mb of RAM, 2 400kb floppy drives, a real beast! In this project I had undertaken to build a CAD software model which took up the essential of my practice, to produce 2D drawings, 3D models and DQE (descriptive/quantitative/estimative). More details soon... _p I was lucky enough to be pre-selected and to spend a week in July in a comfortable hotel in the Camargue ... programming relentlessly day and night on a superb Mac II (with a 20 MB hard disk, the ultimate in luxury), among other "developers", under the watchful eyes of geeks from Apple France. Each one was invited to push his project by taking advantage of a privileged environment, to prepare the development during August and a handing-over of the final project on August 30, 1989. One month of August screwed on a chair in front of the Mac's 9", totally excited, sleeping 4 hours a day, completely crazy, under the sorry eyes of Colette and her friends. _p But despite all my efforts my project was not retained and I was very sad about it! _p HyperCard has been abandoned by Apple a long time ago, the "HyperCard Viewer" doesn't work anymore on the latest systems and the HyperCard stack is no longer readable, even under SuperCard, which is supposed to be compatible with HyperCard; I have tried without success to date. Fortunately, it is often possible to find the text data in the files and this is the case with this stack, if one disregards the unreadable "binary resources" that pollute the file. After a cleaning work that should not be too complex, it should be possible to find the heart of the algorithms developed in HyperTalk, the interface part being probably unusable. _p I have learned from this experience that one should not invest all one's energy in developments whose survival depends on the maintenance of "proprietary tools", no matter how good they are. Conclusion: opensource forever ... even if the physical support of this development is a MAC, a machine that can't be more "proprietary"; there's no harm in not being coherent until the end, right? _p Here are screen shots and scanned pages of the 47 paper document (the file created on AppleWorks is no longer readable, and the images were output on MacPaint and UHU-pasted). I liked this font, which is very 1950s architectural. If I have time I will scan the other 45 pages or, better, I will find an old mac to open the AppleWorks file, extract the text, scan the lost images etc ... but is it worth it? {uncover http://marty.alain.free.fr/microarchitecture/micro_archi_1.jpg 100 600 document's cover} {uncover http://marty.alain.free.fr/microarchitecture/micro_archi_2.jpg 100 590 document's content} {uncover http://marty.alain.free.fr/microarchitecture/micro_archi_12.jpg 100 420 document's extract} {uncover http://epsilonwiki.free.fr/portail/data/microarchi_2.jpg 100 385 first draw plan and elevation, then bind them to generate the 3D volume} {uncover http://epsilonwiki.free.fr/portail/data/microarchi_4.jpg 100 385 perspective view (with a funny fractal tree)} {uncover http://epsilonwiki.free.fr/portail/data/microarchi_3.jpg 100 385 and finally quantities and prices} _h2 comparing javascript, hypertalk and lambdatalk _p Just playing with an array. {pre 1) javascript var A = [1,2,3,4]; A[1] // 2 A[1] = 100; // [1,100,3,4] A[2] = 200; // [1,100,200,4] 2) hypertalk put 1 2 3 4 into A // A = 1 2 3 4 item 1 of A // 2 put 100 into item 1 of A // A = 1 100 3 4 put 200 into item 2 of A // A = 1 100 200 4 3) lambdatalk '{def A {A.new 1 2 3 4}} -> A // define A as an array of 1 2 3 4 '{A} -> [1,2,3,4] // display it '{A.get 1 {A}} -> 2 // get item 1 of A '{A.set! 1 100 {A}} -> [1,100,3,4] // set item 1 to 100 in A '{A.set! 2 200 {A}} -> [1,100,200,4] // set item 2 to 200 in A } _p Compare "{b put 100 into item 1 of A}" and "{b '{A.set! 1 100 {A}}}" read as "{b set item 1 to 100 in A}". In my opinion Javascript is definitely for coders and Lambdatalk is a {b stenographic} way of writing Hypertalk, which was intended for common people. A stenographic way allowing to write in a same syntax {b '{b 1 2 3}}, {b '{+ 1 2 3}} and combine both {b '{b {+ 1 2 3}}}. To mix text, styles and scripts in a unique and consistent syntax. Try to do that with HTML/CSS/Javascript or even Hypertalk... _h2 a 3D program in hypertalk _p The fractal tree shown before is an example of what can be done with the following Hypertalk script. Note that spherical (fish eye) perspectives could be generated, even if it was very slowly. Funny, isnt'it? {pre -- PRIMITIVES -------------------------------------------------- -- LANGAGE_3D ALAIN MARTY ARCHITECTE 30/08/89 ------------------ on debut global typeProjection global f,rayon,u0,v0 global x,y,z,uv global al,be,ga,c11,c12,c13,c21,c22,c23,c31,c32,c33 put "classique" into typeProjection put 750 into f put 350 into rayon put 256 into u0 put 171 into v0 put 0 into x put 0 into y put 0 into z put u0&","&v0 into uv put 0 into al put 0 into be put 0 into ga put 0 into c11 put 1 into c12 put 0 into c13 put -1 into c21 put 0 into c22 put 0 into c23 put 0 into c31 put 0 into c32 put 1 into c33 --hide menuBar effacerEcran set grid to false choose line tool end debut on fin choose browse tool --show menuBar play "cow" put "Ok!" end fin on sauverPosition global x,y,z,uv global c11,c12,c13,c21,c22,c23,c31,c32,c33 global mx,my,mz,muv global mc11,mc12,mc13,mc21,mc22,mc23,mc31,mc32,mc33 put x into mx put y into my put z into mz put uv into muv repeat with i=1 to 3 repeat with j=1 to 3 do "put c"&i&j&" into mc"&i&j end repeat end repeat end sauverPosition on restaurerPosition global x,y,z,uv global c11,c12,c13,c21,c22,c23,c31,c32,c33 global mx,my,mz,muv global mc11,mc12,mc13,mc21,mc22,mc23,mc31,mc32,mc33 put mx into x put my into y put mz into z put muv into uv repeat with i=1 to 3 repeat with j=1 to 3 do "put mc"&i&j&" into c"&i&j end repeat end repeat avancer 0 end restaurerPosition on perspective type global typeProjection if type is "classique" or type is "spherique" then put type into typeProjection end if put "Dessin Perspective"&&typeProjection&&"en cours..." end perspective on observateur a,b,c global xs,ys,zs global al,be,ga put -90 into xs put -90 into ys put -90 into zs put a into al put b into be put c into ga pivoter al,be,ga effacerEcran set pattern to 22 deplacer xs,ys,zs cube 180,180,180 deplacer -xs,-ys,-zs set pattern to 12 end observateur ---------------------------------------------------------------- function projeter x,y,z global f,rayon,u0,v0,uv,typeProjection if typeProjection is "classique" then put x/(1-z/f) into u put y/(1-z/f) into v else if typeProjection is "spherique" then put 250-z into z put abs(x) into abx put abs(y) into aby if x< > 0 and y< >0 then put rayon*z/sqrt((z*z/x/x+1)*(z*z/y/y+1)-1) into coeff put x/abx*coeff/aby into u put y/aby*coeff/abx into v else if x< >0 and y = 0 then put x/abx*rayon/sqrt(z*z/x/x+1) into u put 0 into v else if y< >0 and x = 0 then put y/aby*rayon/sqrt(z*z/y/y+1) into v put 0 into u else put 0 into u put 0 into v end if end if return round(u+u0)&","&round(v+v0) end projeter on avancer d global objet,memFlag,x,y,z,uv global c11,c12,c13 add -d*c11 to x add -d*c12 to y add -d*c13 to z if memFlag=1 then put x&","&y&","&z&","&0&return after objet put uv into memuv put projeter(x,y,z) into uv end avancer on tracer d global objet,memFlag,x,y,z,uv global c11,c12,c13 add -d*c11 to x add -d*c12 to y add -d*c13 to z if memFlag=1 then put x&","&y&","&z&","&1&return after objet put uv into memuv put projeter(x,y,z) into uv drag from memuv to uv with optionKey end tracer on ouvrir global objet,memFlag,x,y,z put 1 into memFlag put x&","&y&","&z&","&0&return into objet set cursor to busy end ouvrir on fermer global memFlag put 0 into memFlag end fermer on dessiner global objet,x,y,z put x-item 1 of line 1 of objet into dx put y-item 2 of line 1 of objet into dy put z-item 3 of line 1 of objet into dz put 0&","&0 into uv1 repeat with i=1 to the number of lines of objet put dx+item 1 of line i of objet into xx put dy+item 2 of line i of objet into yy put dz+item 3 of line i of objet into zz put projeter(xx,yy,zz) into uv2 if item 4 of line i of objet is 1 then drag from uv1 to uv2 with optionKey end if put uv2 into uv1 end repeat end dessiner on tourner a global al,c11,c12,c13,c21,c22,c23,c31,c32,c33 add a to al if a=90 then repeat with i=1 to 3 do "put c2"&i&" into t1"&i do "put -c1"&i&" into t2"&i end repeat else if a=-90 then repeat with i=1 to 3 do "put -c2"&i&" into t1"&i do "put c1"&i&" into t2"&i end repeat else put cos(a*pi/180) into c put sin(a*pi/180) into s repeat with i=1 to 3 do "put c1"&i&"*c+c2"&i&"*s into t1"&i do "put c2"&i&"*c-c1"&i&"*s into t2"&i end repeat end if repeat with i=1 to 3 do "put t1"&i&" into c1"&i do "put t2"&i&" into c2"&i end repeat end tourner on tanguer a global be,c11,c12,c13,c21,c22,c23,c31,c32,c33 add a to be if a=90 then put 0 into c put 1 into s put -c31 into t11 put -c32 into t12 put -c33 into t13 put c11 into t31 put c12 into t32 put c13 into t33 else if a=-90 then put 0 into c put -1 into s put c31 into t11 put c32 into t12 put c33 into t13 put -c11 into t31 put -c12 into t32 put -c13 into t33 else put cos(a*pi/180) into c put sin(a*pi/180) into s put c11*c-c31*s into t11 put c12*c-c32*s into t12 put c13*c-c33*s into t13 put c31*c+c11*s into t31 put c32*c+c12*s into t32 put c33*c+c13*s into t33 end if put t11 into c11 put t12 into c12 put t13 into c13 put t31 into c31 put t32 into c32 put t33 into c33 end tanguer on rouler a global ga,c11,c12,c13,c21,c22,c23,c31,c32,c33 add a to ga if a=90 then put c31 into t21 put c32 into t22 put c33 into t23 put -c21 into t31 put -c22 into t32 put -c23 into t33 else if a=-90 then put -c31 into t21 put -c32 into t22 put -c33 into t23 put c21 into t31 put c22 into t32 put c23 into t33 else put cos(a*pi/180) into c put sin(a*pi/180) into s put c21*c+c31*s into t21 put c22*c+c32*s into t22 put c23*c+c33*s into t23 put c31*c-c21*s into t31 put c32*c-c22*s into t32 put c33*c-c23*s into t33 end if put t21 into c21 put t22 into c22 put t23 into c23 put t31 into c31 put t32 into c32 put t33 into c33 end rouler on deplacer a,b,c if a=0 and b=0 and c=0 then exit deplacer if a< >0 then avancer a tourner 90 if b< >0 then avancer b tanguer 90 if c< >0 then avancer c tanguer -90 tourner -90 end deplacer on pivoter a,b,c if a=0 and b=0 and c=0 then exit pivoter if a< >0 then tourner a if b< >0 then tanguer b if c< >0 then rouler c end pivoter on effacerEcran choose select tool doMenu "select all" doMenu "clear picture" choose line tool drag from 0,0 to 1,1 end effacerEcran on chargerEcran choose select tool drag from 0,0 to 480,336 doMenu "copy picture" choose line tool end chargerEcran on restituerEcran doMenu "paste picture" choose line tool end restituerEcran -- BIBLIOTHEQUE D'OBJETS --------------------------------------- on escalier a,b,c,h,angle,n repeat with i=1 to n cube a,b,c tourner angle deplacer 0,0,h end repeat end escalier on VoleesEscalier largeur,longueur,hauteur repeat 6 ouvrir cube largeur,longueur,hauteur fermer repeat 2 deplacer largeur,0,hauteur/2 dessiner end repeat deplacer largeur,0,hauteur/2 cube longueur,longueur,hauteur tourner -90 deplacer 0,0,hauteur/2 end repeat end VoleesEscalier on arcCercle -- end arcCercle on koch n,l if n=0 then tracer l else koch n-1,l/3 tourner -60 koch n-1,l/3 tourner 120 koch n-1,l/3 tourner -60 koch n-1,l/3 end if end koch on peano n,l if n=0 then tracer l else peano n-1,l/3 tourner -90 repeat 3 peano n-1,l/3 tourner 90 end repeat repeat 3 peano n-1,l/3 tourner -90 end repeat peano n-1,l/3 tourner 90 peano n-1,l/3 end if end peano on arbre longueur,bourgeons,niveau global uv if niveau >0 then set LineSize to niveau tracer longueur --koch 1,longueur choose oval tool drag from item 1 of uv-2,item 2 of uv-2 to item 1 of uv+2,item 2 of uv+2 choose line tool repeat with i=1 to bourgeons put 45 into angle tourner -angle arbre longueur div 2,bourgeons+1,niveau-1 tourner angle rouler 360/bourgeons end repeat avancer -longueur end if end arbre } _h2 a few links _ul [[http://epsilonwiki.free.fr/portail/?view=hypercard|http://epsilonwiki.free.fr/portail/index.php?view=hypercard]]. _ul [[the-ipad-needs-its-hypercard|http://radar.oreilly.com/2010/03/the-ipad-needs-its-hypercard.html]] _ul [[Why Hypercard Had to Die|http://www.loper-os.org/?p=568]] _ul [[squeak|http://squeak.org/]] _ul [[HN/Wildcard|https://news.ycombinator.com/item?id=29284296]] _ul le 7/01/2014 un [[MAC+|http://jamesfriend.com.au/pce-js/pce-js-apps/]] dans le navigateur, de quoi intégrer (peut-être) dans alphawiki ce très ancien travail réalisé sur hypercard en 1990. _ul [[https://hypercardsimulator.com/|https://hypercardsimulator.com/]] {hr} {uncover http://marty.alain.free.fr/architecture/dou_coll/images/esquisse.jpg 500 800 I built [[something similar|http://b2b3.free.fr/am/?view=collioure]] in 2001.}
lambdaway v.20211111