1
0
Fork 0
forked from fun/fun

Added new blog post and a lot of content fixes. No code changes. (0.40.6)

This commit is contained in:
Johannes Findeisen 2026-04-23 00:34:04 +02:00
commit 1415b7fc9d
5 changed files with 72 additions and 19 deletions

View file

@ -4,7 +4,7 @@ published: true
noToc: false
noComments: false
noDate: false
title: Fun - Internals
title: Internals
subtitle: Implementation details, bytecode format, VM architecture, stacks/frames, parser, and dispatch.
description: Implementation details, bytecode format, VM architecture, stacks/frames, parser, and dispatch.
permalink: /documentation/internals/
@ -201,7 +201,6 @@ Fun supports a lightweight include mechanism at the source text level (handled b
// __include_begin__: <path>:<line>
…included lines…
// __include_end__: <path>:<line>
- map_expanded_line_to_include(path, line, out_path, out_line) uses these markers to map a line in the expanded text back to the original file:line that contributed it.
When the VM produces stderr output, fun_vm_vfprintf annotates messages with the mapped file and line if possible.
@ -227,7 +226,6 @@ Key components:
- parse_block handles nested blocks, indentation tracking, and emits OP_LINE markers for accurate source positioning.
- Controlflow codegen:
- Conditional and loop constructs emit OP_JUMP/OP_JUMP_IF_FALSE with forward jump placeholders patched later via bytecode_set_operand.
- try/catch/finally: emit OP_TRY_PUSH/OP_TRY_POP and arrange handler ips; OP_THROW for explicit throw.
@ -269,10 +267,10 @@ Feature flags (CMake):
- Use OP_LINE markers (visible via bytecode_dump) to correlate bytecode with source lines.
- vm_dump_globals helps inspect nonnil globals at runtime.
- When adding a new opcode:
1) Extend enum OpCode and opcode_names[]
2) Implement a handler (small C file) and include it from src/vm.c
3) Teach the parser/emitter to generate the opcode
4) Update documentation/spec and examples
1. Extend enum OpCode and opcode_names[]
2. Implement a handler (small C file) and include it from src/vm.c
3. Teach the parser/emitter to generate the opcode
4. Update documentation/spec and examples
## Data limits and sizes

View file

@ -4,7 +4,7 @@ published: true
noToc: false
noComments: false
noDate: false
title: Fun - Website Documentation (fun-lang.xyz)
title: Website Documentation (fun-lang.xyz)
subtitle: Documentation for the fun-lang.xyz website in the `./web/` directory.
description: Documentation for the fun-lang.xyz website in the `./web/` directory.
permalink: /documentation/website/
@ -24,9 +24,9 @@ This document describes the structure and maintenance of the website for the Fun
The website is built using [Jekyll](https://jekyllrb.com/){:class="ext"}, a static site generator written in Ruby.
- **Markdown Engine:** kramdown (configured for GFM)
- **Syntax Highlighting:** Rouge
- **Plugins:**
- Markdown Engine: kramdown (configured for GFM)
- Syntax Highlighting: Rouge
- Plugins:
- `jekyll-paginate`
- `jekyll-sitemap`
- `jekyll-toc`
@ -65,13 +65,13 @@ The `./web/` directory contains a `Makefile` to simplify common tasks:
To run the website locally for development:
1. **Prerequisites:** Ensure you have Ruby, Bundler, and optionally the `minify` tool installed.
2. **Install dependencies:**
1. Prerequisites: Ensure you have Ruby, Bundler, and optionally the `minify` tool installed.
2. Install dependencies:
```bash
cd web/
bundle install
```
3. **Run the development server:**
3. Run the development server:
Using the Makefile:
```bash
make run
@ -84,9 +84,9 @@ To run the website locally for development:
## Content Management
- **Blog Posts:** Add new `.md` files to `_posts/` following the `YYYY-MM-DD-title.md` naming convention.
- **Pages:** Create new `.md` or `.html` files in the root of the `./web/` directory or in subdirectories.
- **Configuration:** Update `_config.yml` for site-wide settings, navigation, or social media links.
- Blog Posts: Add new `.md` files to `_posts/` following the `YYYY-MM-DD-title.md` naming convention.
- Pages: Create new `.md` or `.html` files in the root of the `./web/` directory or in subdirectories.
- Configuration: Update `_config.yml` for site-wide settings, navigation, or social media links.
## Deployment