![]() Some expressions are omittable only when the arguments have certain types. In this case the application is marked with APPN_FLAG_OMITTABLE instead of relaying on the flags of the primitive. The optimizer can't use this flag to move the expression inside a lamba or across a potential continuation capture, unlike other omittable expressions. They can be moved only in more restricted conditions. For example, in this program #lang racket/base (define n 10000) (define m 10000) (time (define xs (build-list n (lambda (x) 0))) (length xs) (define ws (list->vector xs)) ; <-- omittable (for ([i (in-range m)]) (vector-ref ws 0))) ; <-- ws is used once If the optimizer moves the expression in the definition of ws inside the recursive lambda that is created by the for, then the code is equivalent to: #lang racket/base (define n 10000) (define m 10000) (time (define xs (build-list n (lambda (x) 0))) (length xs) (for ([i (in-range m)]) (vector-ref (list->vector xs) 0))) ; <-- moved here And the new code is O(n*m) instead of O(n+m). This example is a minimized version of the function kde from the plot package, where n=m and the bug changed the run time from linear to quadratic. |
||
---|---|---|
pkgs | ||
racket | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.travis.yml | ||
appveyor.yml | ||
INSTALL.txt | ||
Makefile | ||
README.md |
This is the source code for the core of Racket. See "INSTALL.txt" for full information on building Racket.
To build the full Racket distribution from this repository, run make
in the top-level directory. To build the Minimal Racket, run make base
.
The rest of the Racket distribution source code is in other repositories under the Racket GitHub organization.
Contribute to Racket by submitting a pull request, joining the development mailing list, or visiting the IRC channel.
License
Racket Copyright (c) 2010-2016 PLT Design Inc.
Racket is distributed under the GNU Lesser General Public License (LGPL). This implies that you may link Racket into proprietary applications, provided you follow the rules stated in the LGPL. You can also modify Racket; if you distribute a modified version, you must distribute it under the terms of the LGPL, which in particular states that you must release the source code for the modified software.
See racket/src/COPYING_LESSER.txt for more information.