https://github.com/racket/zuo Skip to content Sign up * Product + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} racket / zuo Public * * Notifications * Fork 4 * Star 65 A tiny Racket for scripting View license 65 stars 4 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code Latest commit @mflatt mflatt zuo: repairs ... d25c17b Apr 13, 2022 zuo: repairs Repair tests, problem with `-B`, and a reader problem. d25c17b Git stats * 3 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time lib/zuo initial version Apr 11, 2022 local initial version Apr 11, 2022 tests zuo: repairs Apr 13, 2022 zuo-doc initial version Apr 11, 2022 .gitignore initial version Apr 11, 2022 LICENSE.txt initial version Apr 11, 2022 Makefile.in initial version Apr 11, 2022 README.md update README to link to Racket repo Apr 11, 2022 build.zuo initial version Apr 11, 2022 configure initial version Apr 11, 2022 main.zuo initial version Apr 11, 2022 zuo.c zuo: repairs Apr 13, 2022 zuo.h initial version Apr 11, 2022 View code Zuo: A Tiny Racket for Scripting Some Example Scripts Building and Running Zuo Library Modules and Startup Performance Embedding Zuo in Another Application More Information README.md This is a mirror of the Zuo sources in the racket/src/zuo directory of the Racket repository. Zuo: A Tiny Racket for Scripting You should use Racket to write scripts. But what if you need something much smaller than Racket for some reason -- or what if you're trying to script a build of Racket itself? Zuo is a tiny Racket with primitives for dealing with files and running processes, and it comes with a make-like embedded DSL. Zuo is a Racket variant in the sense that program files start with # lang, and the module path after #lang determines the parsing and expansion of the file content. That's how the make-like DSL is defined, and even the base Zuo language is defined by layers of # langs. One of the early layers implements macros. Some Example Scripts See local/hello.zuo, local/tree.zuo, local/image.zuo, and build.zuo. Building and Running Zuo Compile zuo.c with a C compiler. No additional are files needed, other than system and C library headers. No compiler flags should be needed, although flags like -o zuo or -O2 are a good idea. You can also use configure, make, and make install, where make targets mostly invoke a Zuo script after compiling zuo.c. If you don't use configure but compile to zuo in the current directory, then ./zuo build.zuo and ./zuo build.zuo install (omit the ./ on Windows) will do the same thing as make and make install with a default configuration. The Zuo executable runs only modules. If you run Zuo with no command-line arguments, then it loads main.zuo. Otherwise, the first argument to Zuo is a file to run or a directory containing a main.zuo to run, and additional arguments are delivered to that Zuo program via the runtime-env procedure. Running the command ./zuo build install, for example, runs the build/main.zuo program with the argument install. Whatever initial script is run, if it has a main submodule, that submodule is also run. Library Modules and Startup Performance Except for the built-in zuo/kernel language module, Zuo finds languages and modules through a collection of libraries. By default, Zuo looks for a directory lib relative to the executable as the root of the library-collection tree. You can supply an alternate collection path with the -X command-line flag. You can also create an instance of Zuo with a set of libraries embedded as a heap image. Embedding a heap image has two advantages: * No extra directory of library modules is necessary. * Zuo can start especially quickly, competitive with the fastest command-line programs. The local/image.zuo script generates a .c file that is a copy of zuo.c plus embedded modules. By default, the zuo module and its dependencies are included, but you can specify others with ++lib. In addition, the default collection-root path is disabled in the generated copy, unless you supply --keep-collects to local/image.zuo. When you use configure and make or ./zuo build.zuo, the default build target creates a to-run/zuo that embeds the zuo library, as well as a to-install/zuo that has the right internal path to find other libraries after make install or ./zuo build.zuo install. You can use heap images without embedding. The dump-heap-and-exit Zuo kernel permitive creates a heap image, and a -B or --boot command-line flag for Zuo uses the given boot image on startup. A boot image is machine-independent, whether in a stand-alone file or embedded in .c source. Embedding Zuo in Another Application Zuo can be embedded in a larger application, with or without an embedded boot image. To support embedding, compile zuo.c or the output of local/image.zuo with the ZUO_EMBEDDED preprocessor macro defined (to anything); the zuo.h header will be used in that case, and zuo.h should also be used by the embedding application. Documentation for the embedding API is provided as comments within zuo.h. More Information Install the zuo-doc directory as a package in Racket to render the documentation there. About A tiny Racket for scripting Resources Readme License View license Stars 65 stars Watchers 9 watching Forks 4 forks Releases No releases published Sponsor this project Sponsor Learn more about GitHub Sponsors Packages 0 No packages published Languages * C 64.2% * Racket 35.7% * Makefile 0.1% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.