mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 14:48:40 +01:00
130 lines
4.4 KiB
HTML
130 lines
4.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
|
<title>Modules – Wren</title>
|
|
<link rel="stylesheet" type="text/css" href="../style.css" />
|
|
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic,700italic|Source+Code+Pro:400|Lato:400|Sanchez:400italic,400' rel='stylesheet' type='text/css'>
|
|
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
|
|
the viewport. -->
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
|
|
</head>
|
|
<body id="top" class="module">
|
|
<header>
|
|
<div class="page">
|
|
<div class="main-column">
|
|
<h1><a href="../">wren</a></h1>
|
|
<h2>a classy little scripting language</h2>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="page">
|
|
<nav class="big">
|
|
<section>
|
|
<h2>core</h2>
|
|
<ul>
|
|
<li><a href="core">core</a></li>
|
|
</ul>
|
|
</section>
|
|
<section>
|
|
<h2>optional</h2>
|
|
<ul>
|
|
<li><a href="meta">meta</a></li>
|
|
<li><a href="random">random</a></li>
|
|
</ul>
|
|
</section>
|
|
<section>
|
|
<h2>cli</h2>
|
|
<ul>
|
|
<li><a href="io">io</a></li>
|
|
<li><a href="os">os</a></li>
|
|
<li><a href="scheduler">scheduler</a></li>
|
|
<li><a href="timer">timer</a></li>
|
|
</ul>
|
|
</section>
|
|
</nav>
|
|
<nav class="small">
|
|
<table>
|
|
<tr>
|
|
<td><h2>core</h2></td>
|
|
<td><h2>optional</h2></td>
|
|
<td><h2>cli</h2></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<ul>
|
|
<li><a href="core">core</a></li>
|
|
</ul>
|
|
</td>
|
|
<td>
|
|
<ul>
|
|
<li><a href="meta">meta</a></li>
|
|
<li><a href="random">random</a></li>
|
|
</ul>
|
|
</td>
|
|
<td>
|
|
<ul>
|
|
<li><a href="io">io</a></li>
|
|
<li><a href="os">os</a></li>
|
|
<li><a href="scheduler">scheduler</a></li>
|
|
<li><a href="timer">timer</a></li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</nav>
|
|
<main>
|
|
<h1>Modules</h1>
|
|
<p>Because Wren can be used both as an embedded scripting language, and as a
|
|
general purpose programming language run from the command line, the definition
|
|
of a “built-in” module is a little complicated. They are organized into three
|
|
categories: </p>
|
|
<h2>Core <a href="#core" name="core" class="header-anchor">#</a></h2>
|
|
<p>There is one core module. It is built directly into the VM and is implicitly
|
|
imported by every other module. It contains the classes for the objects built
|
|
directly into the language itself: <a href="core/num.html">numbers</a>, <a href="core/string.html">strings</a>, etc. </p>
|
|
<p>The core module is always available and can’t be removed. </p>
|
|
<ul>
|
|
<li><a href="core">core</a> </li>
|
|
</ul>
|
|
<h2>Optional <a href="#optional" name="optional" class="header-anchor">#</a></h2>
|
|
<p>Optional modules are available in the command line Wren interpreter. When you
|
|
embed Wren in your own host application, you can also include them too. They are
|
|
written in Wren and C, but have no external dependencies, so including them in
|
|
your application doesn’t force you to bring in any other third-party code. </p>
|
|
<p>At the same time, they aren’t <em>needed</em> by the VM itself to function, so you can
|
|
disable some or all of them if you want to keep your app as small and
|
|
constrained as possible. </p>
|
|
<p>There are a couple of optional modules: </p>
|
|
<ul>
|
|
<li><a href="meta">meta</a> </li>
|
|
<li><a href="random">random</a> </li>
|
|
</ul>
|
|
<h2>CLI <a href="#cli" name="cli" class="header-anchor">#</a></h2>
|
|
<p>The CLI modules are only available in the standalone command-line Wren
|
|
interpreter. They are deeply tied to <a href="http://libuv.org">libuv</a>, each other, and other internals
|
|
of the command-line app, so can’t be separated out and pulled into host
|
|
applications that want to embed Wren. </p>
|
|
<ul>
|
|
<li><a href="io">io</a> </li>
|
|
<li><a href="os">os</a> </li>
|
|
<li><a href="scheduler">scheduler</a> </li>
|
|
<li><a href="timer">timer</a> </li>
|
|
</ul>
|
|
</main>
|
|
</div>
|
|
<footer>
|
|
<div class="page">
|
|
<div class="main-column">
|
|
<p>Wren lives
|
|
<a href="https://github.com/munificent/wren">on GitHub</a>
|
|
— Made with ❤ by
|
|
<a href="http://journal.stuffwithstuff.com/">Bob Nystrom</a> and
|
|
<a href="https://github.com/munificent/wren/blob/master/AUTHORS">friends</a>.
|
|
</p>
|
|
<div class="main-column">
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|