(define cc (make-parameter #f))
(define (input name) `(input ((type "text") (name ,(format "~a" name)))))
(define (submit) `(input ((type "submit"))))
(define (form . body) `(form ((action ,(cc))) ,@body))
(define (a ref . body) `(a ((href ,ref)) ,@body))
(define-syntax page
(syntax-rules ()
[(page x ...) (send/suspend (lambda (k) (cc k) `(html (body ,x ...))))]))
(define (get name req)
(extract-binding/single name (request-bindings req)))
(define (start initial-request)
(define foo (get 'foo (page (form (input 'foo) (submit)))))
(page (a (cc) "click here"))
(page "you said: " foo))
elibarzilay
|
cached 11 days ago
With the PLT web server:
|
|
11 points
by elibarzilay
over 2 years
ago
| link
cached 22 days ago
|
|
cached 12 days ago
Easy to check yourself -- try this:
|
|
cached 2 days ago
"interpreter interpreted from another interpreter" is very far from the way things are. Arc works by translating arc forms to mzscheme, so it's a compiler, not an interpreter. The arc compiler itself is not interpreted, it is compiled by mzscheme -- and since mzscheme byte-compiles everything (and uses a JIT compiler on the result), it is not an interpreter.
The thing is that there are many ways in which arc can be made faster, but packaging things up in a mzscheme executable is not what speeds things up. |
|
cached 1 day ago
For some reason I don't see the other post in the forum, so
I'll repeat it here:
The arc compiler plants many `'nil's to avoid empty bodies. This patch avoids this, and this solves the problem with 372. Get it at http://tmp.barzilay.org/arc-patch |
|
cached 22 days ago
Repeating any single string several times looks bad (and might be bad for other reasons), but should not lead to a performance hit. Consider the fact that each of these occurrences that you see is just a pointer to the single string that was created when the code was read in.
|
|
cached 2 days ago
There is an initial overhead for byte-compiling the code
and jitting it -- but that's not something that you'd be
able to measure for such a small piece of code. Once
that's done, it's the same code -- mzscheme (since a good
while ago) on intel and ppc does not interpret code. Ever.
Even on solaris, where the jit is disabled, it's
"interpreting" byte-compiled code, so it is not an
interpreter in any case.
|
|
cached 22 days ago
You can also evaluate #f and get MzScheme's #f.
But that shouldn't matter, since they all behave in the same way as booleans. (Try to use each one in an `if' and see that it works.) |
|
cached 12 days ago
If you mean a single form, then that won't work, because arc destructures values. For example:
|
|
cached 5 days ago
That was fixed in version 371.
|
