feat: add example scripts for argparse, bytes, dataset, html, markdown, uuid, wdantic, and web chat modules

Add comprehensive demo scripts showcasing the usage of multiple Wren modules including argument parsing, byte manipulation, in-memory dataset operations, HTML encoding/slugification, markdown-to-HTML conversion, UUID generation/validation, schema validation with wdantic, and a full web chat application with REST endpoints.
This commit is contained in:
2026-01-24 22:40:22 +00:00
parent 0a65272f80
commit 5a4054ec66
105 changed files with 23275 additions and 94 deletions
+260
View File
@@ -0,0 +1,260 @@
<!DOCTYPE html>
<!-- retoor <retoor@molodetz.nl> -->
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Installation - Wren-CLI Manual</title>
<link rel="stylesheet" href="../css/style.css">
</head>
<body>
<button class="mobile-menu-toggle">Menu</button>
<div class="container">
<aside class="sidebar">
<div class="sidebar-header">
<h1><a href="../index.html">Wren-CLI</a></h1>
<div class="version">v0.4.0</div>
</div>
<nav class="sidebar-nav">
<div class="section">
<span class="section-title">Getting Started</span>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="installation.html" class="active">Installation</a></li>
<li><a href="first-script.html">First Script</a></li>
<li><a href="repl.html">Using the REPL</a></li>
</ul>
</div>
<div class="section">
<span class="section-title">Language</span>
<ul>
<li><a href="../language/index.html">Syntax Overview</a></li>
<li><a href="../language/classes.html">Classes</a></li>
<li><a href="../language/methods.html">Methods</a></li>
<li><a href="../language/control-flow.html">Control Flow</a></li>
<li><a href="../language/fibers.html">Fibers</a></li>
<li><a href="../language/modules.html">Modules</a></li>
</ul>
</div>
<div class="section">
<span class="section-title">API Reference</span>
<ul>
<li><a href="../api/index.html">Overview</a></li>
<li><a href="../api/http.html">http</a></li>
<li><a href="../api/websocket.html">websocket</a></li>
<li><a href="../api/tls.html">tls</a></li>
<li><a href="../api/net.html">net</a></li>
<li><a href="../api/dns.html">dns</a></li>
<li><a href="../api/json.html">json</a></li>
<li><a href="../api/base64.html">base64</a></li>
<li><a href="../api/regex.html">regex</a></li>
<li><a href="../api/jinja.html">jinja</a></li>
<li><a href="../api/crypto.html">crypto</a></li>
<li><a href="../api/os.html">os</a></li>
<li><a href="../api/env.html">env</a></li>
<li><a href="../api/signal.html">signal</a></li>
<li><a href="../api/subprocess.html">subprocess</a></li>
<li><a href="../api/sqlite.html">sqlite</a></li>
<li><a href="../api/datetime.html">datetime</a></li>
<li><a href="../api/timer.html">timer</a></li>
<li><a href="../api/io.html">io</a></li>
<li><a href="../api/scheduler.html">scheduler</a></li>
<li><a href="../api/math.html">math</a></li>
</ul>
</div>
<div class="section">
<span class="section-title">Tutorials</span>
<ul>
<li><a href="../tutorials/index.html">Tutorial List</a></li>
<li><a href="../tutorials/http-client.html">HTTP Client</a></li>
<li><a href="../tutorials/websocket-chat.html">WebSocket Chat</a></li>
<li><a href="../tutorials/database-app.html">Database App</a></li>
<li><a href="../tutorials/template-rendering.html">Templates</a></li>
<li><a href="../tutorials/cli-tool.html">CLI Tool</a></li>
</ul>
</div>
<div class="section">
<span class="section-title">How-To Guides</span>
<ul>
<li><a href="../howto/index.html">How-To List</a></li>
<li><a href="../howto/http-requests.html">HTTP Requests</a></li>
<li><a href="../howto/json-parsing.html">JSON Parsing</a></li>
<li><a href="../howto/regex-patterns.html">Regex Patterns</a></li>
<li><a href="../howto/file-operations.html">File Operations</a></li>
<li><a href="../howto/async-operations.html">Async Operations</a></li>
<li><a href="../howto/error-handling.html">Error Handling</a></li>
</ul>
</div>
</nav>
</aside>
<main class="content">
<nav class="breadcrumb">
<a href="../index.html">Home</a>
<span class="separator">/</span>
<a href="index.html">Getting Started</a>
<span class="separator">/</span>
<span>Installation</span>
</nav>
<article>
<h1>Installation</h1>
<p>Wren-CLI must be built from source. This page covers the build process for Linux, macOS, and FreeBSD.</p>
<div class="toc">
<h4>On This Page</h4>
<ul>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#linux">Building on Linux</a></li>
<li><a href="#macos">Building on macOS</a></li>
<li><a href="#freebsd">Building on FreeBSD</a></li>
<li><a href="#configurations">Build Configurations</a></li>
<li><a href="#verification">Verifying Installation</a></li>
</ul>
</div>
<h2 id="prerequisites">Prerequisites</h2>
<p>All platforms require:</p>
<ul>
<li>Git</li>
<li>C compiler (GCC or Clang)</li>
<li>Make</li>
<li>OpenSSL development libraries (for TLS/HTTPS support)</li>
<li>Python 3 (for running tests)</li>
</ul>
<h2 id="linux">Building on Linux</h2>
<h3>Install Dependencies</h3>
<p>On Debian/Ubuntu:</p>
<pre><code>sudo apt-get update
sudo apt-get install build-essential libssl-dev git python3</code></pre>
<p>On Fedora/RHEL:</p>
<pre><code>sudo dnf install gcc make openssl-devel git python3</code></pre>
<p>On Arch Linux:</p>
<pre><code>sudo pacman -S base-devel openssl git python</code></pre>
<h3>Build</h3>
<pre><code>git clone https://github.com/wren-lang/wren-cli.git
cd wren-cli
cd projects/make && make</code></pre>
<p>The binary will be created at <code>bin/wren_cli</code>.</p>
<h3>Install System-Wide (Optional)</h3>
<pre><code>sudo cp bin/wren_cli /usr/local/bin/wren</code></pre>
<h2 id="macos">Building on macOS</h2>
<h3>Install Dependencies</h3>
<p>Install Xcode Command Line Tools:</p>
<pre><code>xcode-select --install</code></pre>
<p>Install OpenSSL via Homebrew:</p>
<pre><code>brew install openssl</code></pre>
<h3>Build</h3>
<pre><code>git clone https://github.com/wren-lang/wren-cli.git
cd wren-cli
cd projects/make.mac && make</code></pre>
<div class="admonition note">
<div class="admonition-title">Note</div>
<p>If OpenSSL is not found, you may need to set the library path:</p>
<pre><code>export LDFLAGS="-L/opt/homebrew/opt/openssl/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl/include"</code></pre>
</div>
<h2 id="freebsd">Building on FreeBSD</h2>
<h3>Install Dependencies</h3>
<pre><code>sudo pkg install gmake git python3</code></pre>
<h3>Build</h3>
<pre><code>git clone https://github.com/wren-lang/wren-cli.git
cd wren-cli
cd projects/make.bsd && gmake</code></pre>
<h2 id="configurations">Build Configurations</h2>
<p>Several build configurations are available:</p>
<table>
<tr>
<th>Configuration</th>
<th>Description</th>
</tr>
<tr>
<td><code>release_64bit</code></td>
<td>Default optimized 64-bit build</td>
</tr>
<tr>
<td><code>release_32bit</code></td>
<td>Optimized 32-bit build</td>
</tr>
<tr>
<td><code>debug_64bit</code></td>
<td>Debug build with symbols</td>
</tr>
<tr>
<td><code>debug_32bit</code></td>
<td>32-bit debug build</td>
</tr>
<tr>
<td><code>release_64bit-no-nan-tagging</code></td>
<td>Without NaN tagging optimization</td>
</tr>
<tr>
<td><code>debug_64bit-no-nan-tagging</code></td>
<td>Debug without NaN tagging</td>
</tr>
</table>
<p>To use a specific configuration:</p>
<pre><code>make config=debug_64bit</code></pre>
<p>Debug builds output to <code>bin/wren_cli_d</code>.</p>
<h2 id="verification">Verifying Installation</h2>
<p>Verify the build was successful:</p>
<pre><code>bin/wren_cli --version</code></pre>
<p>Run the test suite:</p>
<pre><code>python3 util/test.py</code></pre>
<p>Start the REPL:</p>
<pre><code>bin/wren_cli</code></pre>
<div class="example-output">> </div>
<p>Type <code>System.print("Hello")</code> and press Enter to verify the REPL works.</p>
<h2>Troubleshooting</h2>
<h3>OpenSSL Not Found</h3>
<p>If you see errors about missing OpenSSL headers:</p>
<ul>
<li>Verify OpenSSL development packages are installed</li>
<li>On macOS, ensure Homebrew OpenSSL path is in your environment</li>
</ul>
<h3>Build Errors</h3>
<p>Try cleaning and rebuilding:</p>
<pre><code>make clean
make</code></pre>
<h3>Test Failures</h3>
<p>Run a specific test module to isolate issues:</p>
<pre><code>python3 util/test.py json</code></pre>
</article>
<footer class="page-footer">
<a href="index.html" class="prev">Overview</a>
<a href="first-script.html" class="next">First Script</a>
</footer>
</main>
</div>
<script src="../js/main.js"></script>
</body>
</html>