PLT mz-MzScheme Compiler Manual

How to Design Programs: An Introduction to Programming and Computing

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: PLT mzc : MzScheme Compiler Manual PLT (scheme@plt-scheme.org) 372 Released December 2007 Copyright notice Copyright c 1996-2007 PLT Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Library General Public License, Version 2 published by the Free Software Foundation. A copy of the license is included in the appendix entitled License. Contents 1 About mzc 1 1.1 mzc Is... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.1 Byte-Code Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.2 Native-Code Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 mzc Is Not... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Running mzc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4 Native Code Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 Foreign-Function Interface to C 5 3 Compiling Individual Files with mzc 9 3.1 Compiling with Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.2 Compilation without Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.3 Autodetecting Compiled Files for Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.4 Compiling Multiple Files to a Single Native-Code Library . . . . . . . . . . . . . . . . . . . . . . . 10 4 Compiling Collections with mzc 12 5 Building and Distributing Stand-alone Executables 13 5.1 Stand-Alone Executables from Scheme Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.2 Distributing Stand-Alone Executables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.3 Stand-Alone Executables from Native Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6 Creating Library Distribution Archives 16 7 info.ss File Format 18 License 19 i CONTENTS CONTENTS Index 23 ii 1. About mzc 1.1 mzc Is... The mzc compiler takes MzScheme (or MrEd) source code and produces either platform-independent byte-code com- piled files ( .zo files, which are just-in-time compiled to native code when loaded on x86, x86 64, and PowerPC platforms) or platform-specific native-code libraries ( .so or .dll files) to be loaded into MzScheme (or MrEd). In the latter mode, mzc provides limited support for interfacing directly to C libraries. mzc works on either individual files or on collections. (A collection is a group of files that conform to MzSchemes library collection system; see in PLT MzScheme: Language Manual ). In general, mzc works best with code using the module form....
View Full Document

Page1 / 28

PLT mz-MzScheme Compiler Manual - PLT mzc : MzScheme...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online