feat: add wasm build targets, profile hooks, os_demo example, and restructure manual source

- Add `wasm`, `wasm-clean`, and `install-emscripten` phony targets to Makefile for WebAssembly cross-compilation
- Insert `WREN_PROFILE_ENTER`/`WREN_PROFILE_EXIT` macros in `wren_vm.h` and `wren_vm.c` to support optional runtime profiling via `WREN_PROFILE_ENABLED`
- Create `example/os_demo.wren` demonstrating Platform, Process, and conditional exit usage
- Update `example/regex_demo.wren` to import `Match` and exercise Match object properties, groups, and `matchAll`
- Remove static HTML manual pages (`base64.html`, `dns.html`, `json.html`) and replace with structured `manual_src/` directory containing Jinja2 templates, YAML metadata, and content pages
- Expand `README.md` with build targets table, manual building instructions, source layout, and guide for adding new module documentation
This commit is contained in:
2026-01-26 04:12:14 +00:00
parent 79ff93c9a2
commit 04e467e09b
143 changed files with 13333 additions and 15112 deletions
+93
View File
@@ -0,0 +1,93 @@
{# retoor <retoor@molodetz.nl> #}
{% extends 'home.html' %}
{% set page_title = "Wren-CLI Manual" %}
{% set next_page = {"url": "getting-started/index.html", "title": "Getting Started"} %}
{% block article %}
<h2>What is Wren-CLI?</h2>
<p>Wren-CLI is a command-line interface for the <a href="https://wren.io">Wren programming language</a>, extended with powerful modules for networking, file I/O, databases, and more. It provides an async event loop powered by libuv, making it suitable for building servers, automation scripts, and command-line tools.</p>
<div class="card-grid">
<div class="card">
<h3><a href="getting-started/index.html">Getting Started</a></h3>
<p>Install Wren-CLI, write your first script, and learn the basics of the language.</p>
</div>
<div class="card">
<h3><a href="language/index.html">Language Reference</a></h3>
<p>Learn about classes, methods, control flow, fibers, and the module system.</p>
</div>
<div class="card">
<h3><a href="api/index.html">API Reference</a></h3>
<p>Complete documentation for all 32 built-in modules including HTTP, WebSocket, and SQLite.</p>
</div>
<div class="card">
<h3><a href="tutorials/index.html">Tutorials</a></h3>
<p>Step-by-step guides for building real applications with Wren-CLI.</p>
</div>
</div>
<h2>Available Modules</h2>
<p>Wren-CLI provides a rich set of modules for common programming tasks:</p>
<h3>Networking</h3>
<div class="module-grid">
<a href="api/http.html" class="module-card">http</a>
<a href="api/websocket.html" class="module-card">websocket</a>
<a href="api/tls.html" class="module-card">tls</a>
<a href="api/net.html" class="module-card">net</a>
<a href="api/udp.html" class="module-card">udp</a>
<a href="api/dns.html" class="module-card">dns</a>
</div>
<h3>Data Processing</h3>
<div class="module-grid">
<a href="api/json.html" class="module-card">json</a>
<a href="api/base64.html" class="module-card">base64</a>
<a href="api/regex.html" class="module-card">regex</a>
<a href="api/jinja.html" class="module-card">jinja</a>
<a href="api/crypto.html" class="module-card">crypto</a>
</div>
<h3>System</h3>
<div class="module-grid">
<a href="api/os.html" class="module-card">os</a>
<a href="api/env.html" class="module-card">env</a>
<a href="api/signal.html" class="module-card">signal</a>
<a href="api/subprocess.html" class="module-card">subprocess</a>
<a href="api/io.html" class="module-card">io</a>
<a href="api/pathlib.html" class="module-card">pathlib</a>
<a href="api/sysinfo.html" class="module-card">sysinfo</a>
<a href="api/fswatch.html" class="module-card">fswatch</a>
</div>
<h3>Data & Time</h3>
<div class="module-grid">
<a href="api/sqlite.html" class="module-card">sqlite</a>
<a href="api/datetime.html" class="module-card">datetime</a>
<a href="api/timer.html" class="module-card">timer</a>
<a href="api/math.html" class="module-card">math</a>
<a href="api/scheduler.html" class="module-card">scheduler</a>
</div>
<h2>Quick Example</h2>
<pre><code>import "http" for Http
import "json" for Json
var response = Http.get("https://api.github.com/users/wren-lang")
var data = Json.parse(response.body)
System.print("User: %(data["login"])")
System.print("Repos: %(data["public_repos"])")</code></pre>
<h2>Features</h2>
<ul>
<li><strong>Async I/O</strong> - Non-blocking operations powered by libuv</li>
<li><strong>HTTP/HTTPS</strong> - Full HTTP client with TLS support</li>
<li><strong>WebSocket</strong> - Client and server WebSocket support</li>
<li><strong>SQLite</strong> - Embedded database for persistent storage</li>
<li><strong>Templates</strong> - Jinja2-compatible template engine</li>
<li><strong>Regex</strong> - Full regular expression support</li>
<li><strong>Cross-platform</strong> - Runs on Linux, macOS, and FreeBSD</li>
</ul>
{% endblock %}