Codecs are standardized components dedicated to the encoding and decoding of dataset formats accessed through IO or from memory. Codecs are indirectly called by LOAD and SAVE functions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red/System [ | |
| Title: "llama.cpp static binding for Red" | |
| Purpose: "Imports the llama-red shim (llama-red.c) bundled with llama.cpp + ggml" | |
| Note: { | |
| Extension-less import: Red's -s static linker resolves llama-red.lib, | |
| a dynamic build would resolve llama-red.dll. The shim keeps every | |
| by-value struct of llama.h on the C side -- only scalars cross here. | |
| } | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red [ | |
| Title: "llm-demo — a statically-linked LLM inside a Red executable" | |
| File: %llm-demo.red | |
| Note: { | |
| llama.cpp + ggml statically linked via the llama-red shim: one | |
| standalone 32-bit exe, no DLLs, running quantized GGUF models. | |
| Build: redc -r -s -t Windows llm-demo.red | |
| Run: llm-demo <model.gguf> [prompt words...] | |
| llm-demo models/Qwen3-0.6B-Q8_0.gguf Why is the sky blue? /no_think |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| ** llama-red.c -- minimal extern-C cdecl shim over llama.cpp for Red/System | |
| ** | |
| ** llama.h passes its config structs by value (llama_model_params, | |
| ** llama_context_params, llama_sampler_chain_params, llama_batch). Red/System | |
| ** CAN pass structs by value (the `value` keyword), but mirroring these large, | |
| ** version-volatile layouts field-for-field on the Red side would break on | |
| ** every llama.cpp upgrade -- so they stay behind pointer-and-scalar entry | |
| ** points here. One opaque handle carries model+ctx+sampler. | |
| ** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red [] | |
| recycle/off | |
| s: make string! 20e6 | |
| clear s | |
| append s "hello" | |
| recycle | |
| mem0: stats | |
| clock [ loop 1e5 [insert s [1 3.14 (1.0, 2,0)]] ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red [ | |
| Title: "SVG Tools" | |
| Date: 27-Jan-2020 | |
| Author: "Christopher Ross-Gill" | |
| Rights: http://opensource.org/licenses/Apache-2.0 | |
| Version: 0.3.2 | |
| History: [ | |
| 0.3.2 27-Jan-2020 "Better handling of text whitespace; bold/italic" | |
| 0.3.1 24-Jan-2020 "PATH model rewrite; VIEW wrapper to view an SVG" | |
| 0.3.0 23-Jan-2020 "Reorganise PATH handling; render whole/partial object; further refactoring" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The following text is the description of the Draw DSL for Red programming language. The word "dialect" which will be used is a synonym for DSL. | |
| 1. Preliminary knowledge to be able to read and write Draw dialect programs | |
| 1.1 Red datatypes and literal syntax | |
| Draw dialect relies on a subset of Red language values. Each Red value has a unique datatype. By convention, datatype names end with an exclamation mark. The datatypes used by Draw: | |
| 1.1.1 Block! datatype |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red [ | |
| Needs: View | |
| ] | |
| nb: 500 | |
| list: [] | |
| make-dir folder: %images-test/ | |
| loop nb [ | |
| append list img: make image! as-pair 100 + random 300 100 + random 300 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // generated from https://chatgpt.com/canvas/shared/67afab561d4c8191bbb497e5cef5147b | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <math.h> | |
| #define ULP_TOLERANCE 10 | |
| int float_almost_equal(float a, float b) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root: 5185/7876, runs: 133, mem: 25173016 => 20056768, mark: 6.3ms, sweep: 4.0ms | |
| root: 5185/7876, runs: 134, mem: 25147196 => 20068176, mark: 6.0ms, sweep: 4.0ms | |
| root: 5185/7876, runs: 135, mem: 25160776 => 19639592, mark: 5.4ms, sweep: 3.5ms | |
| root: 5185/7876, runs: 136, mem: 25169800 | |
| *** Runtime Error 1: access violation | |
| *** in file: /C/dev/Red/runtime/hashtable.reds | |
| *** at line: 578 | |
| *** | |
| *** --Frame-- --Code-- --Call-- | |
| *** 0105A990h 0042FE5Dh red/_hashtable/mark 274556F0h |
NewerOlder