1
0
Fork 0
cl-sites/guile.html_node/General-Libguile-Concepts.html

93 lines
4.3 KiB
HTML
Raw Normal View History

2024-12-17 12:49:28 +01:00
<!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>General Libguile Concepts (Guile Reference Manual)</title>
<meta name="description" content="General Libguile Concepts (Guile Reference Manual)">
<meta name="keywords" content="General Libguile Concepts (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-in-C.html" rel="up" title="Programming in C">
<link href="Defining-New-Foreign-Object-Types.html" rel="next" title="Defining New Foreign Object Types">
<link href="Linking-Guile-with-Libraries.html" rel="prev" title="Linking Guile with Libraries">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
-->
</style>
<link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css">
</head>
<body lang="en">
<div class="section-level-extent" id="General-Libguile-Concepts">
<div class="nav-panel">
<p>
Next: <a href="Defining-New-Foreign-Object-Types.html" accesskey="n" rel="next">Defining New Foreign Object Types</a>, Previous: <a href="Linking-Guile-with-Libraries.html" accesskey="p" rel="prev">Linking Guile with Libraries</a>, Up: <a href="Programming-in-C.html" accesskey="u" rel="up">Programming in C</a> &nbsp; [<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>
<h3 class="section" id="General-concepts-for-using-libguile"><span>5.4 General concepts for using libguile<a class="copiable-link" href="#General-concepts-for-using-libguile"> &para;</a></span></h3>
<p>When you want to embed the Guile Scheme interpreter into your program or
library, you need to link it against the <samp class="file">libguile</samp> library
(see <a class="pxref" href="Linking-Programs-With-Guile.html">Linking Programs With Guile</a>). Once you have done this, your C
code has access to a number of data types and functions that can be used
to invoke the interpreter, or make new functions that you have written
in C available to be called from Scheme code, among other things.
</p>
<p>Scheme is different from C in a number of significant ways, and Guile
tries to make the advantages of Scheme available to C as well. Thus, in
addition to a Scheme interpreter, libguile also offers dynamic types,
garbage collection, continuations, arithmetic on arbitrary sized
numbers, and other things.
</p>
<p>The two fundamental concepts are dynamic types and garbage collection.
You need to understand how libguile offers them to C programs in order
to use the rest of libguile. Also, the more general control flow of
Scheme caused by continuations needs to be dealt with.
</p>
<p>Running asynchronous signal handlers and multi-threading is known to C
code already, but there are of course a few additional rules when using
them together with libguile.
</p>
<ul class="mini-toc">
<li><a href="Dynamic-Types.html" accesskey="1">Dynamic Types</a></li>
<li><a href="Garbage-Collection.html" accesskey="2">Garbage Collection</a></li>
<li><a href="Control-Flow.html" accesskey="3">Control Flow</a></li>
<li><a href="Asynchronous-Signals.html" accesskey="4">Asynchronous Signals</a></li>
<li><a href="Multi_002dThreading.html" accesskey="5">Multi-Threading</a></li>
</ul>
</div>
</body>
</html>