summaryrefslogtreecommitdiff
path: root/module
AgeCommit message (Collapse)AuthorFilesLines
2012-03-12http web server: allow concurrent write operationswip-threaded-http-serverAndy Wingo1-21/+83
* module/web/server/http.scm (<http-server>, http-open) (read-request!, write-request!, enqueue-write!, http-write): As in the previous commit, add support for concurrent writes. (http-read): Pop off keepalive ports in this, the main loop. (http-close): Shut down writers appropriately.
2012-03-12http web server: allow concurrent read operationsAndy Wingo1-29/+104
* module/web/server/http.scm (<http-server>): Add fields for a reader thread-pool, and some async queues that it operates on. Also, a flag, http-threaded?. (http-open): Add #:threaded? and #:read-workers kwargs. Create a thread pool for reading if threads are available. (read-request!): New function, factored out of http-read. (enqueue-read!, http-read): Instead of reading the client directly, enqueue a read. In the case where threads are not available, this will call read-request! directly. read-request! takes care of adding to the handle-queue. The read polling loop will pop items off the handle-queue. (seconds-from-now, async-queue-for-each): New helpers. (http-write): Shut down the queues and threads, hopefully in a nonblocking fashion.
2012-03-12add ability to wake up the poll() in http.scmAndy Wingo1-4/+31
* module/web/server/http.scm (make-waker, flush-wake-port): New functions, to wake up a poll(). (http-open): Add a wakeup port to the poll set. (http-read): Handle the wakeup port specially.
2012-03-12add ice-9 thread-poolAndy Wingo2-0/+193
* module/ice-9/thread-pool.scm: New file. * module/Makefile.am: Add to build.
2012-03-12add (ice-9 async-queue)Andy Wingo2-0/+165
* module/ice-9/async-queue.scm: New file. * module/Makefile.am: Add it to the make file.
2012-03-12Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-1/+1
2012-03-12Merge branch 'master' of git.sv.gnu.org:/srv/git/guileAndy Wingo1-5/+123
2012-03-12web http: fix Ma -> MarAndy Wingo1-2/+2
* module/web/http.scm (write-date): Fix serialization of Mar. Oops.
2012-03-11fix bad-request-printerAndy Wingo1-1/+1
* module/web/request.scm (bad-request-printer): Fix printer to expect args as a list.
2012-03-11Merge remote-tracking branch 'local-2.0/stable-2.0'Andy Wingo1-2/+14
Conflicts: configure.ac
2012-03-11add bad-request printerAndy Wingo1-1/+12
* module/web/request.scm (bad-request-printer): Add printer for these exceptions.
2012-03-11web server http: 400 Bad Request on bad requestsAndy Wingo1-2/+14
* module/web/server/http.scm (bad-request, http-read): If an exception is raised while reading a response, write out a 400 Bad Request response before closing the port.
2012-03-11add exception printers for bad-header, bad-header-componentAndy Wingo1-1/+16
* module/web/http.scm (bad-header-component): Throw 'bad-header-component instead of 'bad-header. (bad-header-printer, bad-header-component-printer): Add exception printers.
2012-03-08elisp rngBT Templeton1-0/+15
* module/language/elisp/boot.el (random): New function.
2012-03-08elisp i/oBT Templeton1-0/+13
* module/language/elisp/boot.el (send-string-to-terminal) (read-from-minibuffer, prin1-to-string): New functions.
2012-03-08elisp: symbol-name, internBT Templeton1-0/+2
* module/language/elisp/boot.el (symbol-name, intern): New functions.
2012-03-08elisp: when, unlessBT Templeton1-0/+8
* module/language/elisp/boot.el (when, unless): New macros.
2012-03-08elisp sequence functionsBT Templeton1-0/+82
* module/language/elisp/boot.el (nreverse, assoc, assq, rplaca, rplacd) (caar, cadr, cdar, cddr, dolist, stringp, string-equal, string=) (substring, upcase, downcase, string-match, make-vector, mapc, aref) (aset, concat): New functions.
2012-03-08integerp, wholenump return nil for non-numbersBT Templeton1-5/+3
* module/language/elisp/boot.el (integerp, wholenump): Call `integer?' before `exact?' so that these predicates return nil for non-numbers instead of signalling an error.
2012-03-08Merge remote-tracking branch 'local-2.0/stable-2.0'Andy Wingo2-148/+11
Conflicts: configure.ac libguile/finalizers.c libguile/finalizers.h libguile/gc.c libguile/gc.h libguile/inline.c libguile/inline.h libguile/ports.c libguile/smob.c libguile/smob.h module/ice-9/deprecated.scm module/ice-9/r4rs.scm
2012-03-07faster (make-prompt-tag); default-prompt-tag is a parameterAndy Wingo1-2/+12
* module/ice-9/boot-9.scm (default-prompt-tag): Once parameters have booted, redefine as a parameter. (make-prompt-tag): Change from a gensym to a list. Thanks to Mark Weaver for the suggestion. * doc/ref/api-control.texi (Prompt Primitives): Update docs.
2012-03-07call-with-{input,output}-string implemented in schemeAndy Wingo1-0/+14
* module/ice-9/boot-9.scm (call-with-input-string) (call-with-output-string): Implement in Scheme. * libguile/strports.c (scm_call_with_output_string): (scm_call_with_input_string): Dispatch to Scheme.
2012-03-07micro-optimizations to string-trim-both, and to (web http)Andy Wingo1-25/+21
* libguile/srfi-13.c (scm_string_trim, scm_string_trim_right) (scm_string_trim_both): Take the whitespace fast-path if the char_pred is scm_char_set_whitespace. * module/web/http.scm (read-header, split-and-trim, parse-quality-list): (parse-param-component, parse-credentials, "Content-Type"): (read-request-line, read-response-line): Use char-set:whitespace instead of char-whitespace?. It avoids recursing into the VM.
2012-03-06micro-optimization in (web server)Andy Wingo1-2/+4
* module/web/server.scm (extend-response): Micro-optimize to not mutate data, and to copy as little as possible.
2012-03-06shuffle r4rs procedures into boot-9Andy Wingo1-126/+119
* module/ice-9/boot-9.scm: Refine a comment about low-level port functions. Move call-with-foo-port, with-input-from-foo, etc later in the file, and define using `parameterize' instead of `dynamic-wind'. Somewhat cleaner, and avoids thunk? checks for "swaports" in the old implementation.
2012-03-06load parameters earlier in boot-9Andy Wingo1-92/+90
* module/ice-9/boot-9.scm: Move parameters earlier in the boot process. The new with-output-to-port code will use it.
2012-03-06slight tweak to file-exists?, file-is-directory?Andy Wingo1-3/+3
* module/ice-9/boot-9.scm (file-exists?, file-is-directory?): For the fallback cases, use open-input-file instead of open-file with OPEN_READ.
2012-03-06bootstrapping shenanigans in `warn'Andy Wingo1-7/+5
* module/ice-9/boot-9.scm (warn): Don't use with-output-to-port, as we'll move that definition after the psyntax boot.
2012-03-06more clear comments in boot-9.scmAndy Wingo1-11/+10
* module/ice-9/boot-9.scm: Update comment header for language primitives.
2012-03-06remove deprecated close-io-portAndy Wingo1-2/+0
* module/ice-9/boot-9.scm (close-io-port): Remove proc that was deprecated in 2.0.
2012-03-06inline ice-9/r4rs.scm into ice-9/boot-9.scmAndy Wingo3-247/+221
* module/ice-9/boot-9.scm: Inline r4rs.scm, in anticipation of more refactorings. * module/ice-9/r4rs.scm: Remove. * module/Makefile.am: Update.
2012-03-05use #nil as default for elisp rest parametersBT Templeton1-1/+8
* module/langauge/elisp/compile-tree-il.scm (compile-lambda): Bind the rest parameter to `#nil' instead of `()' by default.
2012-03-05deprecate close-io-portAndy Wingo2-3/+6
* module/ice-9/r4rs.scm: * module/ice-9/deprecated.scm (close-io-port): Deprecate.
2012-03-05Merge branch 'bt/elisp'BT Templeton17-1397/+1096
Conflicts: am/guilec libguile/_scm.h libguile/vm-i-scheme.c module/language/elisp/compile-tree-il.scm module/language/elisp/runtime.scm module/language/elisp/runtime/macros.scm module/language/tree-il/compile-glil.scm module/language/tree-il/primitives.scm
2012-03-04Comment out unused definitions of 'do' and 'case' in psyntax.scmMark H Weaver2-137/+7
* module/ice-9/psyntax.scm (do, case): Comment out these definitions, which are never used and immediately replaced by definitions in boot-9.scm. * module/ice-9/psyntax-pp.scm: Regenerate.
2012-03-04Fix syntax wrap comments; remove old unused cruftMark H Weaver1-11/+4
* module/ice-9/psyntax.scm (subst-rename?, rename-old, rename-new, rename-marks, make-rename): Remove these unused syntax rules. Fix description of syntax wraps to match current reality.
2012-03-03Merge branch 'stable-2.0'Mark H Weaver6-25488/+4085
Conflicts: module/ice-9/psyntax-pp.scm module/language/tree-il.scm
2012-03-03Minimize size of embedded syntax objects in psyntax-pp.scmMark H Weaver3-8153/+220
* module/ice-9/compile-psyntax.scm: Minimize syntax object literals embedded in psyntax-pp.scm. * module/ice-9/psyntax.scm: Rename a few variables so that syntax objects embedded in macros have no lexical bindings, so that their minimized syntax objects will have no embedded labels. These labels were the last remaining gensym counters in psyntax-pp.scm. * module/ice-9/psyntax-pp.scm: Regenerate. It is now less than one quarter of its previous size! More importantly, this file no longer contains any gensym counters, which means that in the future, local changes to psyntax.scm will usually result in only local changes to psyntax-pp.scm.
2012-03-03tree-il->scheme improvementsMark H Weaver4-25085/+10102
* module/language/tree-il.scm (tree-il->scheme): New implementation that simply calls 'decompile-tree-il'. * module/language/scheme/decompile-tree-il.scm (choose-output-names, do-decompile): New internal procedures. (decompile-tree-il): New and improved implementation. Print source identifiers where possible, otherwise add minimal numeric suffixes. Previously we printed the gensyms. Avoid 'begin' in contexts that provide an implicit 'begin'. Produce 'cond', 'case', 'and', 'or', 'let*', named let, and internal defines where appropriate. Recognize keyword arguments in 'opts' to disable the production of these derived syntactic forms, and to optionally strip numeric suffixes from variable names. * module/ice-9/compile-psyntax.scm: Disable partial evaluation, letrec fixing, and primitive expansion when producing psyntax-pp.scm, in order to produce output as close to the original source as practical. Disable production of derived syntactic forms as needed during bootstrap. Strip numeric suffixes from variable names. Adjust pretty-printing parameters. * module/ice-9/psyntax-pp.scm: Regenerate. It is now less than half of the original size.
2012-03-03optimize dynamic-wind when we know winders are thunksAndy Wingo1-0/+24
* libguile/vm-i-system.c (wind): * module/language/tree-il/compile-glil.scm (flatten-lambda-case): Instead of making `wind' call `scm_thunk_p' on the winder and unwinder at runtime, make it the responsibility of the compiler to emit code to call thunk? and error, but only if the compiler cannot prove them to be thunks. * libguile/vm-engine.c (vm_engine): Remove a now-unused error block.
2012-03-02pretty-print: allow max-expr-width to be set; recognize more keywordsMark H Weaver1-7/+9
* module/ice-9/pretty-print.scm (pretty-print): Add new keyword argument '#:max-expr-width'. (generic-write): Add new argument 'max-expr-width'. Previously this was internally defined to the constant value 50.
2012-03-02Fix typos in psyntax.scmMark H Weaver2-8435/+8508
* module/ice-9/psyntax.scm (gen-syntax-case): #'pad --> #'pat (define*): #'x --> #'id * module/ice-9/psyntax-pp.scm: Regenerate
2012-03-02Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-9/+9
2012-03-02tweaks to -Wformat's gettext detectionAndy Wingo1-9/+9
* module/language/tree-il/analyze.scm (proc-ref?): Change to use less false-if-exception and more variable-bound?. If a variable is present in the local module but not bound, assume that it is gettext if it has the right name. This is to allow for (define _ gettext). * test-suite/tests/tree-il.test ("warnings"): Update (_ "foo") example.
2012-03-02Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo7-44/+62
There are a some failures currently: FAIL: tree-il.test: warnings: format: non-literal format string with forward declaration ERROR: srfi-18.test: current-exception-handler: current handler returned at top level - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>))) ERROR: srfi-18.test: current-exception-handler: multiple levels of handler nesting - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>))) ERROR: srfi-18.test: current-exception-handler: exception handler installation is thread-safe - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>))) Conflicts: module/language/tree-il/peval.scm module/language/tree-il/primitives.scm test-suite/tests/tree-il.test
2012-03-02peval: inline applications of lambda to rest argsAndy Wingo1-10/+26
* module/language/tree-il/peval.scm (peval): Add optimization to hoist the inner procedure out of e.g. (lambda args (apply (lambda ...) args)) This commit restores the ability to detect escape-only prompts at compile-time. * test-suite/tests/tree-il.test: Update test for prompt with a lambda, and add a specific test for lambda application.
2012-03-02tree-il: fix `canonicalize!' for promptsAndy Wingo1-5/+5
* module/language/tree-il/canonicalize.scm (canonicalize!): Fix a bug in which the sense of `escape-only?' was reversed. We never saw this though, because for other reasons, no prompts were being identified as escape-only.
2012-03-02more general treatment of call-with-promptAndy Wingo1-16/+15
* module/language/tree-il/primitives.scm (*primitive-expand-table*): Don't limit the call-with-prompt to <prompt> transition to lambda expressions. Instead we can lexically bind the handler, and rely on peval to propagate a lambda expression.
2012-03-01pmatch: always wrap with let, even if the expression appears atomicMark H Weaver1-8/+8
* module/system/base/pmatch.scm (pmatch): Always wrap with 'let', even if the expression appears atomic, because in the presence of 'identifier-syntax', we cannot know what an atomic expression will later expand to. Also use '#:export-syntax' instead of '#:export' to export 'pmatch'.
2012-03-01Fix <TAG>vector-length when applied to other uniform vector typesMark H Weaver2-4/+7
* module/srfi/srfi-4.scm, module/srfi/srfi-4/gnu.scm (define-bytevector-type): Fix definition of <TAG>vector-length when applied to uniform vectors of different element sizes. Thanks to Tobias Brandt <tob.brandt@googlemail.com> for reporting this bug. * test-suite/tests/srfi-4.test: Add tests.