106 lines
5.1 KiB
HTML
106 lines
5.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<!-- This manual documents Guile version 3.0.10.
|
|
|
|
Copyright (C) 1996-1997, 2000-2005, 2009-2023 Free Software Foundation,
|
|
Inc.
|
|
|
|
Copyright (C) 2021 Maxime Devos
|
|
|
|
Copyright (C) 2024 Tomas Volf
|
|
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
|
any later version published by the Free Software Foundation; with no
|
|
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
|
|
copy of the license is included in the section entitled "GNU Free
|
|
Documentation License." -->
|
|
<title>Scheme vs C (Guile Reference Manual)</title>
|
|
|
|
<meta name="description" content="Scheme vs C (Guile Reference Manual)">
|
|
<meta name="keywords" content="Scheme vs C (Guile Reference Manual)">
|
|
<meta name="resource-type" content="document">
|
|
<meta name="distribution" content="global">
|
|
<meta name="Generator" content=".texi2any-real">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
<link href="index.html" rel="start" title="Top">
|
|
<link href="Concept-Index.html" rel="index" title="Concept Index">
|
|
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
|
|
<link href="Programming-Overview.html" rel="up" title="Programming Overview">
|
|
<link href="Testbed-Example.html" rel="next" title="Testbed Example">
|
|
<link href="Extending-Dia.html" rel="prev" title="Extending Dia">
|
|
<style type="text/css">
|
|
<!--
|
|
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
|
|
span:hover a.copiable-link {visibility: visible}
|
|
ul.mark-bullet {list-style-type: disc}
|
|
-->
|
|
</style>
|
|
<link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css">
|
|
|
|
|
|
</head>
|
|
|
|
<body lang="en">
|
|
<div class="subsection-level-extent" id="Scheme-vs-C">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Testbed-Example.html" accesskey="n" rel="next">Example: Using Guile for an Application Testbed</a>, Previous: <a href="Extending-Dia.html" accesskey="p" rel="prev">How One Might Extend Dia Using Guile</a>, Up: <a href="Programming-Overview.html" accesskey="u" rel="up">An Overview of Guile Programming</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<hr>
|
|
<h4 class="subsection" id="Why-Scheme-is-More-Hackable-Than-C"><span>5.7.2 Why Scheme is More Hackable Than C<a class="copiable-link" href="#Why-Scheme-is-More-Hackable-Than-C"> ¶</a></span></h4>
|
|
|
|
<p>Underlying Guile’s value proposition is the assumption that programming
|
|
in a high level language, specifically Guile’s implementation of Scheme,
|
|
is necessarily better in some way than programming in C. What do we
|
|
mean by this claim, and how can we be so sure?
|
|
</p>
|
|
<p>One class of advantages applies not only to Scheme, but more generally
|
|
to any interpretable, high level, scripting language, such as Emacs
|
|
Lisp, Python, Ruby, or TeX’s macro language. Common features of all
|
|
such languages, when compared to C, are that:
|
|
</p>
|
|
<ul class="itemize mark-bullet">
|
|
<li>They lend themselves to rapid and experimental development cycles,
|
|
owing usually to a combination of their interpretability and the
|
|
integrated development environment in which they are used.
|
|
|
|
</li><li>They free developers from some of the low level bookkeeping tasks
|
|
associated with C programming, notably memory management.
|
|
|
|
</li><li>They provide high level features such as container objects and exception
|
|
handling that make common programming tasks easier.
|
|
</li></ul>
|
|
|
|
<p>In the case of Scheme, particular features that make programming easier
|
|
— and more fun! — are its powerful mechanisms for abstracting parts
|
|
of programs (closures — see <a class="pxref" href="About-Closure.html">The Concept of Closure</a>) and for iteration
|
|
(see <a class="pxref" href="while-do.html">Iteration mechanisms</a>).
|
|
</p>
|
|
<p>The evidence in support of this argument is empirical: the huge amount
|
|
of code that has been written in extension languages for applications
|
|
that support this mechanism. Most notable are extensions written in
|
|
Emacs Lisp for GNU Emacs, in TeX’s macro language for TeX, and in
|
|
Script-Fu for the Gimp, but there is increasingly now a significant code
|
|
eco-system for Guile-based applications as well, such as Lilypond and
|
|
GnuCash. It is close to inconceivable that similar amounts of
|
|
functionality could have been added to these applications just by
|
|
writing new code in their base implementation languages.
|
|
</p>
|
|
|
|
</div>
|
|
<hr>
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Testbed-Example.html">Example: Using Guile for an Application Testbed</a>, Previous: <a href="Extending-Dia.html">How One Might Extend Dia Using Guile</a>, Up: <a href="Programming-Overview.html">An Overview of Guile Programming</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|