Files
wren/index.html

169 lines
7.8 KiB
HTML
Raw Normal View History

2013-12-04 07:46:41 -08:00
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
2019-02-06 02:52:27 +00:00
<title> &ndash; Wren</title>
2013-12-04 07:46:41 -08:00
<link rel="stylesheet" type="text/css" href="style.css" />
2015-01-15 21:18:18 -08:00
<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"/>
2013-12-04 07:46:41 -08:00
</head>
<body id="top">
2014-04-14 21:23:46 -07:00
<header>
<div class="page">
2014-04-20 21:42:17 -07:00
<div class="main-column">
2015-01-18 15:37:50 -08:00
<h1><a href="./">wren</a></h1>
2019-02-06 02:52:27 +00:00
<h2>a classy little scripting language</h2>
2014-04-14 21:23:46 -07:00
</div>
</div>
2014-08-19 07:35:20 -07:00
</header>
2014-04-14 21:23:46 -07:00
<div class="page">
2015-11-09 08:01:19 -08:00
<nav class="big">
2019-02-06 02:52:27 +00:00
<a href="./"><img src="./wren.svg" class="logo"></a>
2013-12-04 07:46:41 -08:00
<ul>
2014-04-09 07:53:30 -07:00
<li><a href="getting-started.html">Getting Started</a></li>
2015-11-09 08:01:19 -08:00
<li><a href="contributing.html">Contributing</a></li>
2019-02-06 02:52:27 +00:00
<li><a href="blog">Blog</a></li>
2013-12-04 07:46:41 -08:00
</ul>
2014-08-19 07:35:20 -07:00
<section>
2019-02-06 02:52:27 +00:00
<h2>guides</h2>
2014-08-19 07:35:20 -07:00
<ul>
<li><a href="syntax.html">Syntax</a></li>
<li><a href="values.html">Values</a></li>
<li><a href="lists.html">Lists</a></li>
<li><a href="maps.html">Maps</a></li>
2015-11-09 08:01:19 -08:00
<li><a href="method-calls.html">Method Calls</a></li>
<li><a href="control-flow.html">Control Flow</a></li>
<li><a href="variables.html">Variables</a></li>
<li><a href="functions.html">Functions</a></li>
<li><a href="classes.html">Classes</a></li>
<li><a href="concurrency.html">Concurrency</a></li>
<li><a href="error-handling.html">Error Handling</a></li>
<li><a href="modularity.html">Modularity</a></li>
2014-08-19 07:35:20 -07:00
</ul>
</section>
<section>
<h2>reference</h2>
<ul>
2015-11-09 08:01:19 -08:00
<li><a href="modules">Modules</a></li>
2017-10-19 07:05:45 -07:00
<li><a href="embedding">Embedding</a></li>
2014-08-19 07:35:20 -07:00
<li><a href="performance.html">Performance</a></li>
<li><a href="qa.html">Q &amp; A</a></li>
</ul>
</section>
</nav>
2015-11-09 08:01:19 -08:00
<nav class="small">
<table>
<tr>
2019-10-03 06:50:59 +00:00
<div><a href="getting-started.html">Getting Started</a></div>
<div><a href="contributing.html">Contributing</a></div>
<div><a href="blog">Blog</a></div>
2015-11-09 08:01:19 -08:00
</tr>
<tr>
2019-02-06 02:52:27 +00:00
<td colspan="2"><h2>guides</h2></td>
2015-11-09 08:01:19 -08:00
<td><h2>reference</h2></td>
</tr>
<tr>
<td>
<ul>
<li><a href="syntax.html">Syntax</a></li>
<li><a href="values.html">Values</a></li>
<li><a href="lists.html">Lists</a></li>
<li><a href="maps.html">Maps</a></li>
<li><a href="method-calls.html">Method Calls</a></li>
<li><a href="control-flow.html">Control Flow</a></li>
</ul>
</td>
<td>
<ul>
<li><a href="variables.html">Variables</a></li>
<li><a href="functions.html">Functions</a></li>
<li><a href="classes.html">Classes</a></li>
<li><a href="concurrency.html">Concurrency</a></li>
<li><a href="error-handling.html">Error Handling</a></li>
<li><a href="modularity.html">Modularity</a></li>
</ul>
</td>
<td>
<ul>
<li><a href="modules">Modules</a></li>
2017-10-19 07:05:45 -07:00
<li><a href="embedding">Embedding</a></li>
2015-11-09 08:01:19 -08:00
<li><a href="performance.html">Performance</a></li>
<li><a href="qa.html">Q &amp; A</a></li>
</ul>
</td>
</tr>
</table>
</nav>
2014-04-20 21:42:17 -07:00
<main>
2019-02-06 02:52:27 +00:00
<h2></h2>
2015-01-03 23:27:54 -08:00
<h2>Wren is a small, fast, class-based concurrent scripting language <a href="#wren-is-a-small,-fast,-class-based-concurrent-scripting-language" name="wren-is-a-small,-fast,-class-based-concurrent-scripting-language" class="header-anchor">#</a></h2>
2019-02-06 02:52:27 +00:00
<hr />
2015-11-09 08:01:19 -08:00
<p>Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in
a familiar, modern <a href="syntax.html">syntax</a>. </p>
2018-07-15 04:42:00 +00:00
<div class="codehilite"><pre><span class="vg">System</span><span class="o">.</span><span class="n">print</span><span class="p">(</span><span class="s">&quot;Hello, world!&quot;</span><span class="p">)</span>
2015-01-01 21:04:14 -08:00
2018-07-15 04:42:00 +00:00
<span class="k">class</span> <span class="vg">Wren</span> <span class="p">{</span>
<span class="n">flyTo</span><span class="p">(</span><span class="n">city</span><span class="p">)</span> <span class="p">{</span>
<span class="vg">System</span><span class="o">.</span><span class="n">print</span><span class="p">(</span><span class="s">&quot;Flying to </span><span class="si">%(</span><span class="n">city</span><span class="si">)</span><span class="s">&quot;</span><span class="p">)</span>
2018-07-13 09:03:56 -07:00
<span class="p">}</span>
<span class="p">}</span>
2015-01-03 23:27:54 -08:00
2018-07-15 04:42:00 +00:00
<span class="k">var</span> <span class="n">adjectives</span> <span class="o">=</span> <span class="vg">Fiber</span><span class="o">.</span><span class="n">new</span> <span class="p">{</span>
<span class="p">[</span><span class="s">&quot;small&quot;</span><span class="p">,</span> <span class="s">&quot;clean&quot;</span><span class="p">,</span> <span class="s">&quot;fast&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">each</span> <span class="p">{</span><span class="o">|</span><span class="n">word</span><span class="o">|</span> <span class="vg">Fiber</span><span class="o">.</span><span class="n">yield</span><span class="p">(</span><span class="n">word</span><span class="p">)</span> <span class="p">}</span>
2018-07-13 09:03:56 -07:00
<span class="p">}</span>
2015-01-03 23:27:54 -08:00
2018-07-15 04:42:00 +00:00
<span class="k">while</span> <span class="p">(</span><span class="o">!</span><span class="n">adjectives</span><span class="o">.</span><span class="n">isDone</span><span class="p">)</span> <span class="vg">System</span><span class="o">.</span><span class="n">print</span><span class="p">(</span><span class="n">adjectives</span><span class="o">.</span><span class="n">call</span><span class="p">())</span>
2018-07-13 09:03:56 -07:00
</pre></div>
2015-01-01 21:04:14 -08:00
<ul>
<li>
2019-02-06 02:52:27 +00:00
<p><strong>Wren is small.</strong> The VM implementation is under <a href="https://github.com/wren-lang/wren/tree/master/src">4,000 semicolons</a>.
2015-11-09 08:01:19 -08:00
You can skim the whole thing in an afternoon. It&rsquo;s <em>small</em>, but not
2019-02-06 02:52:27 +00:00
<em>dense</em>. It is readable and <a href="https://github.com/wren-lang/wren/blob/46c1ba92492e9257aba6418403161072d640cb29/src/wren_value.h#L378-L433">lovingly-commented</a>. </p>
2015-01-01 21:04:14 -08:00
</li>
<li>
2015-11-09 08:01:19 -08:00
<p><strong>Wren is fast.</strong> A fast single-pass compiler to tight bytecode, and a
compact object representation help Wren <a href="performance.html">compete with other dynamic
languages</a>. </p>
2015-01-01 21:04:14 -08:00
</li>
<li>
2015-11-09 08:01:19 -08:00
<p><strong>Wren is class-based.</strong> There are lots of scripting languages out there,
but many have unusual or non-existent object models. Wren places
<a href="classes.html">classes</a> front and center. </p>
2015-01-01 21:04:14 -08:00
</li>
<li>
2015-11-09 08:01:19 -08:00
<p><strong>Wren is concurrent.</strong> Lightweight <a href="concurrency.html">fibers</a> are core to the execution
model and let you organize your program into an army of communicating
coroutines. </p>
2015-01-03 23:27:54 -08:00
</li>
<li>
2015-11-09 08:01:19 -08:00
<p><strong>Wren is a scripting language.</strong> Wren is intended for embedding in
applications. It has no dependencies, a small standard library,
2017-10-19 07:05:45 -07:00
and <a href="embedding">an easy-to-use C API</a>. It compiles cleanly as C99, C++98
2015-11-09 08:01:19 -08:00
or anything later. </p>
2015-01-01 21:04:14 -08:00
</li>
</ul>
2019-02-06 02:52:27 +00:00
<hr />
2015-11-09 08:01:19 -08:00
<p>If you like the sound of this, <a href="getting-started.html">let&rsquo;s get started</a>. You can even try
it <a href="http://ppvk.github.io/wren-nest/">in your browser</a>! Excited? Well, come on and <a href="contributing.html">get
involved</a>! </p>
</main>
2014-04-14 21:23:46 -07:00
</div>
<footer>
<div class="page">
2014-08-19 07:35:20 -07:00
<div class="main-column">
2015-11-09 08:01:19 -08:00
<p>Wren lives
2019-02-06 02:52:27 +00:00
<a href="https://github.com/wren-lang/wren">on GitHub</a>
2015-11-09 08:01:19 -08:00
&mdash; Made with &#x2764; by
<a href="http://journal.stuffwithstuff.com/">Bob Nystrom</a> and
2019-02-06 02:52:27 +00:00
<a href="https://github.com/wren-lang/wren/blob/master/AUTHORS">friends</a>.
2015-11-09 08:01:19 -08:00
</p>
2014-08-19 07:35:20 -07:00
<div class="main-column">
2014-04-14 21:23:46 -07:00
</div>
</footer>
2013-12-04 07:46:41 -08:00
</body>
2015-04-25 08:50:08 -07:00
</html>