S2CC(1)
π S2CC(1) β the Scheme-to-C compiler bestie π
ok so real talk: this is a General Commands Manual page, section 1, and the command is s2cc. that's it. that's the girl. let's get into it π
β¨ NAME β¨
s2cc β Scheme to C compiler π¦
β¨ SYNTAX β¨
s2cc [ option ] ... file ...
β¨ DESCRIPTION β¨
okay so the s2cc command β she used to go by scc, glow-up era β invokes a Scheme compiler. and what does she accept? the language defined in the essential portions of the Revised4 Report on the Algorithmic Language Scheme, with minor constraints and some additions. we're keeping it essential, we're keeping it cute.
the compiler produces C source files, which then get compiled using the system's C compiler to produce conventional .o and a.out files. so it's like a little relay race πββοΈπ¨
and the C code produced by this compiler? she's flexible. it may be intermixed with other C code, or code written in other languages. cross-language collab, we love to see it. π₯
β¨ OPTIONS β¨
these options are accepted by s2cc. any other options will be assumed to be options of the system's C compiler, and they'll be passed along to it when it gets invoked. she's forwarding your mail, bestie π
-ccC compiler β compile the Scheme compiler produced C code with C compiler. if this flag is not supplied, then the C compilerccwill be used. (default queen behavior π)-Cβ compile the Scheme programs found in the filessource.scand leave the resulting code insource.cfiles. no further operations are performed. that's it, that's the whole job, periodt.-Idirectory β specifies a directory to be searched by include for source files. ποΈ-fsymbol value β define the compile-time constant symbol to value. this is equivalent to the construct(define-constant symbol value)appearing in the Scheme source. same energy, different font. β¨-iβ combine the source and object files into a Scheme interpreter. the module name for each Scheme source file is automatically determined. module names for previously compiled modules must be specified using the-moption. iykyk π§-mmodule-name β specifies the name of a previously compiled module. note that the Scheme compiler will downshift the alphabetic characters in the module-name. modules are initialized in the order that the-mflags appear. so order matters, bestie, don't be chaotic. π-Obβ optimize code by omitting bounds checks on vectors and strings. π₯-Ogβ optimize code by omitting stack trace-back code.-Onβ optimize code by assuming that all numbers are fixed point. all numbers. no cap.-Otβ optimize code by omitting type error checks.-pgβ produce profiled code for run-time measurement usinggprof(1). the profiled library is used in lieu of the standard Scheme library. π-scgcstatflag β enables garbage collection statistics. if set to1, then garbage collection statistics will be printed. the default is0, that will result in no statistics. (the gc is quiet, she's mysterious πΈ)-schheap β specifies the compiler's initial heap size in megabytes. the default is system dependent. π€·ββοΈ-sclpercent β specifies the percent of the heap allocated after a generational garbage collection that will force a full collection. the default is40.-scmhheap β specifies the compiler's maximum heap size in megabytes. the default is five times the initial size of the heap. math girlies rise π«Ά-LIBDIRdirectory β specifies a directory containing the files:predef.sc,objects.h,libs2c.a, and optionallylibs2c_p.a. the whole squad, assembled. π-logβ logs information internal to the compiler to the C source file produced by the compiler. each type of information is controlled by a flag:-source,-macro,-expand,-closed,-transform,-lambda,-tree,-lap,-peep. the flag-logis equivalent to specifying the flags:-source,-macro,-expand,-closed,-transform,-lambda,-tree. (so-logis the group chat, and the others are the individual DMs π)
β¨ ENVIRONMENT VARIABLES β¨
the items controlled by -sc.. flags can also be controlled by environment variables. and if both the flag and the environment variable are provided, then the flag's value will be used. flag wins, no debate, main character energy. π
SCGCINFOβ controls the reporting of garbage collection statistics to the standard error file. if set to1, then garbage collection statistics will be printed. the default setting is0that will not print the statistics.SCHEAPβ specifies the initial size of the heap in megabytes. the default heap size is system dependent.SCLIMITβ specifies the percent of the heap allocated after a generational garbage collection that will force a full collection. the default is40.SCMAXHEAPβ specifies the maximum size of the heap in megabytes.
β¨ INPUT FILES β¨
following the command options come one or more file names. lineup, girlies π
name.scβ Scheme source. Scheme source files will be compiled into C files with the namename.c.name.cβ C source.name.sβ Assembly language source.name.oβ Object file which may have been generated by any compiler.name.aβ Object file archive which may have been generated by any compiler.
β¨ DIAGNOSTICS β¨
the diagnostic messages produced by the compiler are printed on the standard error file. so when she's yelling, she's yelling over there. π’π
β¨ FILES β¨
/.../schemetoc/...β source and documentation/.../libs2c.aβ library/.../libs2c_p.aβ profiled library (optional)/.../s2ccβ shell script/.../s2ccompβ compiler/.../predef.scβ predefined functions/.../objects.hβ definitions"#include'd"in the C codeSC-TO-C.cβ temporary C source filesource.S2Cβ temporary C source fileSC-TO-C.oβ temporary object file
β¨ LIMITATIONS β¨
okay this part is important so lock in π
when the compiler is able to identify every call to a procedure, it is able to generate it "in-line", and perform tail calls by using "goto". this analysis covers most loops, conditional expressions, and finite state machines. iconic, honestly.
for non-tail recursive calls, the code generated by the compiler uses the standard C mechanisms for procedure call and return. this therefore requires that each top-level Scheme procedure, and any Scheme procedure which has more than one call which is not tail-recursive, be compiled into its own C procedure. calls to such procedures will be tail-recursive if and only if the host C compiler optimizes tail-recursion. so it's giving... it depends on your C compiler, bestie. no promises. π
β¨ SEE ALSO β¨
- Harold Abelson and Gerald Jay Sussman with Julie Sussman, Structure and Interpretation of Computer Programs, The MIT Press. π¦
- William Clinger and Jonathan Rees (Editors), Revised4 Report on the Algorithmic Language Scheme, LISP Pointers, Volume IV, Number 3, July-September 1991. PostScript for this file is included in the software distribution.
- Jerry D. Smith, An Introduction to Scheme, Prentice Hall, Inc. Chapter notes for using this text with Scheme->C are included in the software distribution.
- R. Kent Dybvig, The SCHEME Programming Language, Prentice Hall, Inc.
- Daniel P. Friedman and Matthias Felleisen, The Little LISPer, MIT Press.
- Joel F. Bartlett, Scheme->C a Portable Scheme-to-C Compiler, WRL Research Report 89/1.
- Additional documentation is included in the software distribution.
s2ci(1)
β¨ QUESTIONS, COMMENTS, AND COMPLAINTS β¨
http://alioth.debian.org/projects/scheme2c/
and that's the whole page, bestie π every single flag, every default, every file path, untouched, unbothered, in her original order. slay.
this page is filed under local, section S2CC(1) β so when you're searching the manual, that's where she lives. mwah πβ¨π
π¦ where this page comes from
- ubuntu jammy: scheme2c 2012.10.14-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms