Moby My take on how Moby Works ... The Moby Scheme Compiler for Smartphones ... 1.2Simulations and Animations: "world.ss" ... How to Design Worlds: Imagi... Shriram Krishnamurthi: Talk... YouTube - Handbells for the... Handbells for the 21st Century InfoQ: Javascript as Compil... Another language that compiles to Javascript is... examples/bell-choir.ss at m... The CONTINUE Server Shriram Krishnamurthi Sy... How to Design Programs: An ... Contents Preface IProcessing ... XML Transformation-by-Example for XML Shriram Kri... SXSLT: Manipulation Language for XML Oleg Kis... Flapjax Demos Catch Up Delicious Dra... Papers Shriram Krishnamurthi: Publ... Chronological List of All Papers These papers...
via http://twitter.com/programmingjoy Javascript as Compiler Target: Clamato, GWT Smalltalk, Python, Scheme http://www.infoq.com/news/2009/09/javascript-compilation-target (require moby/stub/world) (define WIDTH 320) (define HEIGHT 480) (define (render w) (place-image (text "Hello World" 10 "Black") 20 20 (empty-scene WIDTH HEIGHT))) (big-bang WIDTH HEIGHT 10 0) (on-redraw render)
After a few minutes of poking around, I was able to compile this to Java and then run it on the Android Emulator:
(defprocess root (fuzziness)
(defvariable blobs #’union)
(always
(when (eq (read-sensor ’image) ’black)
(subprocess (measure-blob) :gradient fuzziness)
(setf blobs
(list (get-from-sub (measure-blob) blob)))))
(avoid
(read-sensor ’query)
(let ((q (first (read-sensor ’query))))
(cond
((eq q ’blobs)
(actuate ’response (regional blobs)))
((eq q ’area)
(actuate ’response
(fold #’+ (mapcar #’second
(regional blobs)))))))))
(defprocess measure-blob ()
(defvariable uid #’max :atomic :base 0 :init (random 1))
(defvariable area #’sum :reduction :base 0 :init 1)
(defvariable blob :local)
(always
(setf blob (list uid area))))
Code to find a set of fuzzy blobs and their areas in a binary image. Each contiguous black area of the image runs a connected measure-blob pro- cess that names it and calculates its area. The set of blobs is collected by the root process and made accessible to the user on the response actuator...
JSON ... it's the intersection of all modern programming languages. All languages have some sense of data, and structures of data. They all have simple values like number strings, and booleans. They all have some sense of a sequence of values. ... Every language has some sense of a collection of named values; it might be an object, or a record, or a struct, or a hash, or a property list, or something. All languages have these, these are universal ideas.
... But they all have the same idea about what the data looks like, and JSON has the thing that's common to everything. By being at the intersection, it turns out to be the thing that everybody can agree on, so it's really easy to pass data back and forth.
Prior data interchange formats tended to try to be the union of all the languages, and that turns out to be horrendously complex, and very difficult to deal with. JSON, by being so simple, actually became really easy to use.
1. XML and Scheme 1. Tools: SSAX, SXML, SXPath, SXSLT 2. Applications, Examples, Sample Code 3. Papers and Presentations 4. SSAX-SXML Mailing list SSAX-SXML SourceForge Project 5. Miscellanea 6. Papers and Presentations 7. Functional XML parsing framework SAX/DOM and SXML parsers with support for XML Namespaces and validation 8. SXML specification 9. SXPath -- SXML query language, XPath implementation 10. SXML traversals and transformations 11. HSXML: Typed SXML 12. Applications, Examples, Sample Code 13. HTML/XML authoring in Scheme 14. Writing LaTeX/PDF mathematical papers with SXML 15. Joint processing of two immutable SXML documents with update cursors 16. Literate XML/DTD programming 17. SXML as a normalized database 18. Complete examples of practical (context-sensitive) SXML Transformations 19. Complete examples of stream-wise (SAX) and DOM parsing ... 1. Last updated March 4, 2007
For me, the web is URIs, a standard set of verbs and a standardized EVAL function. The verbs are mostly GET and POST and the standardized EVAL function is the concept of a browser that can EVAL HTML and can eval JavaScript. I don't thing we can afford to leave JavaScript out of the top level definition of what the Web is because there is too much at stake.via http://bitworking.org/news/427/js-rest-and-empty-windows
There is a huge difference between a web of algorithms and a web of data. For computing eons, we have known that a combination of algorithms and data structures lead to programs. Less well known (outside computer science) are the problems of trying to build applications using one without the other or trying to fake one using the other.
Lisp, TeX, SGML...all of these evidence the struggle between declarative and imperative methods. Today, the problems are all the same but the buzzwords are different: JavaScript, XSLT, XML...
* http://mshook.appspot.com/z/d4m.htm?/mshook/scheme * The Ten Commandments 1. How to recur on a list of atoms, a number and an S-expression | 23 64 83 2. Cons to build | 37 3. Typical element, cons & recur | 45 4. Change >= 1 arg closer to termination & test | 57 65 84 5. +, X & cons; test 0,1,() | 67 6. When to simplify | 94 7. Subparts: sublists & subexpressions | 103 8. Abstract reps w/ funcs | 107 9. Abstract patterns w/ funcs | 134 10. Funcs to collect > 1 value | 140 * The Five Rules 1. Car 5 2. Cdr 7 3. Cons 9 4. Null? 10 5. Eq? 12 * Dimensions of functions o On lats (lists of atoms - flat), numbers or S-expression (hierarchy) o Test, insert (L/R), replace, remove o Straight/single function, abstracted/generalized * Data types and structures o atom 3 o number o list 3 & 4 o S-expression 3 & 4 o lat (list of atoms) 15 o set 111 o pair 117 & 118 o rel 119 more at http://tinyurl.com/kll3de
This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html recursive.tex
The translation was initiated by John McCarthy on 2006-08-13
(define db (quote (
((content)(tags))
((here is an example of content) (example content))
((an entry is a list containing two lists. The first list is the content. The second list is tags) (explanation tags))
)))
(define get-content (lambda (entry) (car entry)))
(define get-tags (lambda (entry) (cadr entry)))
(define subset? (lambda (keys lat)
(cond ((null? keys) #t)
((memq (car keys) lat) (subset? (cdr keys) lat))
(#t #f))))
(define tag-query (lambda (tags db)
(cond ((null? db) '())
((subset? tags (get-tags (car db))) (cons (car db) (tag-query tags (cdr db))))
(#t (tag-query tags (cdr db))))))
(defun eval. (e a)
(cond
((atom e) (assoc. e a))
((atom (car e))
(cond
((eq (car e) 'quote) (cadr e))
((eq (car e) 'atom) (atom (eval. (cadr e) a)))
((eq (car e) 'eq) (eq (eval. (cadr e) a)
(eval. (caddr e) a)))
((eq (car e) 'car) (car (eval. (cadr e) a)))
((eq (car e) 'cdr) (cdr (eval. (cadr e) a)))
((eq (car e) 'cons) (cons (eval. (cadr e) a)
(eval. (caddr e) a)))
((eq (car e) 'cond) (evcon. (cdr e) a))
('t (eval. (cons (assoc. (car e) a)
(cdr e))
a))))
((eq (caar e) 'label)
(eval. (cons (caddar e) (cdr e))
(cons (list (cadar e) (car e)) a)))
((eq (caar e) 'lambda)
(eval. (caddar e)
(append. (pair. (cadar e) (evlis. (cdr e) a))
a)))))