source: project/promotional/flyer/flyer.tex @ 20616

Last change on this file since 20616 was 20616, checked in by sjamaan, 10 years ago

Fix silly mistake in FFI example in the flyer. Before printing this we should definitely try out and run every single program to verify we don't have bugs in them ;)

File size: 5.2 KB
Line 
1%%
2%% A flyer for promoting Chicken Scheme!
3%%
4
5%% Add 'notumble' to preview in xdvi or preview in pdf without having to
6%% stand on your head to read page 2
7\documentclass[10pt,a4paper,notumble]{leaflet}
8%\documentclass[10pt,a4paper]{leaflet}
9
10\usepackage{slatex-chicken}
11\usepackage{graphicx}
12\usepackage{color}
13
14\definecolor{maroon}{rgb}{0.5,0,0}
15\definecolor{darkgreen}{rgb}{0,0.3,0}
16\definecolor{darkblue}{rgb}{0,0,0.4}
17
18% TeX2page-like coloring for SLaTeX
19\def\keywordfont#1{\textbf{\textcolor{maroon}{#1}}}
20\def\variablefont#1{\textcolor{darkblue}{#1}}
21\def\constantfont#1{\textcolor{darkgreen}{#1}}
22
23\makeatletter
24\renewcommand{\section}{\@startsection
25  % Name, sectioning level, indent from margin, beforeskip, afterskip, style
26  {section}{1}{0mm}{\baselineskip}{\baselineskip}
27  {\centering\large\sffamily\bfseries}
28}
29
30\renewcommand{\subsection}{\@startsection
31  {subsection}{2}{0mm}{0.5\baselineskip}{0.5\baselineskip}
32  {\centering\small\sffamily\bfseries}
33}
34\makeatother
35
36%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37
38\begin{document}
39
40\begin{center}
41  \Huge\textbf{Chicken Scheme}\\
42  \normalsize\textsc{``A practical and portable Scheme system''}
43  \vskip 0pt plus 1fill
44  \includegraphics[height=0.8\textwidth]{chicken-colored-no-text}
45  \vskip 0pt plus 1fill
46\end{center}
47
48
49\section{What is Chicken Scheme?}
50
51Chicken is a \emph{robust} and \emph{mature} compiler for the
52programming language \emph{Scheme}. Chicken has been around for over
5310 years now, and has a growing group of dedicated users.
54
55The system compiles to \emph{C}, which allows it to generate
56\emph{fast, portable code}. For easy development it also includes a
57powerful interpreter!
58
59Chicken is above all a \emph{practical} system; there are literally
60\emph{hundreds} of extension libraries (known as ``eggs'') available
61to help you get some real work done!  There are extensions for web
62development, concurrency and parallelism, cryptography, scientific
63computing and much, much more.
64
65All of the major platforms are supported, including GNU/Linux, the
66BSDs, MacOS X and Windows.
67
68\section{What is Scheme?}
69
70Scheme is a truly \emph{elegant and minimal} programming language
71which directly descends from Lisp, the \emph{second oldest}
72programming language still in use. But don't be fooled by that: It's
73still as fresh today as when it was first created!
74
75It has very simple syntax so it is \emph{easy to learn}. This also
76makes it a very powerful tool: writing extensions to the language can
77be done right from \emph{within} the language, allowing you to
78\emph{mold the language} to better fit your program's
79domain. User-added functionality is treated no different from
80``built-in'' functionality.
81
82Scheme is well-known as a \emph{functional} programming language, but
83it's more accurately described as a \emph{multi-paradigm} language.
84Sure, you can program in a functional style, but also in all flavors
85of object-oriented, logical, distributed and even imperative styles.
86If tomorrow a new cool style of programming is invented, Schemers
87won't need to switch languages. Instead, they can just add it to their
88favorite language!
89
90\section{So, why Chicken and not {\mdseries\itshape$<$insert~Scheme~here$>$?}}
91
92Scheme is such a minimalist and easy to parse language that there are
93\emph{thousands} of implementations. However, implementing a
94\emph{good} Scheme is nontrivial. Of the implementations that are not
95toys, we prefer Chicken because it:
96
97\begin{itemize}
98\item sticks to the original minimalist spirit of Scheme
99\item produces \emph{fast} code
100\item has a growing number of useful libraries for real-world tasks
101\item integrates very easily with C
102\item has an energetic and enthousiastic community!
103\end{itemize}
104
105\section{Show me some examples!}
106
107\subsection{Hello world}
108
109How boring can it be?
110
111\begin{schemedisplay}
112(print "Hello, world!")
113\end{schemedisplay}
114
115\subsection{Obligatory factorial program}
116
117Slightly less boring than the hello world program:
118
119\begin{schemedisplay}
120(define fac
121  (lambda (n)
122    (if (= n 0)
123        1
124        (* n (fac (- n 1))))))
125
126(print (fac (list-ref (argv) 2)))
127\end{schemedisplay}
128
129\subsection{Integrating Scheme with ``C''}
130
131\begin{schemedisplay}
132(define log10
133  (lambda (x)
134    (/ (log x) (log 10))))
135
136;; The same using log10 from C:
137(foreign-declare "#include <math.h>")
138
139(define log10-from-c
140  (foreign-lambda* double ((double x))
141    "double y;"
142    "y = log10(x);"
143    "C_return(y);"))
144
145;; Shorter versions:
146(define (log10 x) (/ (log x) (log 10)))
147(define log10-from-c
148  (foreign-lambda double "log10" double))
149\end{schemedisplay}
150
151% The example is a little contrived and maybe not too convincing
152
153As you can see, calling C functions is quite easy.  If you have longer
154C code, you can also write your functions in a separate C file and
155compile those against your Chicken program. You can just call those
156functions from Chicken.
157
158\section{Cool, I want to get started!}
159
160\begin{itemize}
161\item Main site: {\tt http://www.call-cc.org/}
162\item Code: {\tt http://code.call-cc.org/}
163\item Chat: {\tt \#chicken at irc.freenode.org}
164\item Documentation: {\tt http://wiki.call-cc.org/}
165\item About Scheme: {\tt http://www.schemers.org/}
166\end{itemize}
167
168
169\vskip 0pt plus 1fill
170{\footnotesize
171\hbox to \hsize{\hss Last updated September 2010\@.} 
172\par}
173
174
175\end{document}
Note: See TracBrowser for help on using the repository browser.