Internetting from first principles; what is required to participate as an autonomous citizen of the World Wide Web.
![web-fundamentals](https://private-user-images.githubusercontent.com/583842/329807535-91c58bbc-2153-4792-8299-76dd3151a974.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NzQ1NTEsIm5iZiI6MTcxOTY3NDI1MSwicGF0aCI6Ii81ODM4NDIvMzI5ODA3NTM1LTkxYzU4YmJjLTIxNTMtNDc5Mi04Mjk5LTc2ZGQzMTUxYTk3NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjI5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyOVQxNTE3MzFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iMzgzOWFhNWQ2OWRiZjM4ODAwOTM4MzA0Y2U5MTE4ZmY0YzE1MWUxZDJmODZkYmEzM2VjNTA1MDhlZWU5MmI0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.BZSjLbq_kLNhZeAiUkyhn1gjXBLcgB4zFiNg2-3D-RI)
Look at stuff on the web; read.
use std::{cell::RefCell, marker::PhantomData, mem, rc::Rc}; | |
use thiserror::Error; | |
#[derive(Debug, Copy, Clone, Eq, PartialEq, Error)] | |
pub enum AccessError { | |
#[error("frozen value accessed outside of enclosing scope")] | |
Expired, | |
#[error("already borrowed incompatibly")] | |
BadBorrow, |
I won't go too far into the nitty details (lol), but this is generally how I've structured my WIP mostly-text-based, turn-based adventure game.
I emphasize that because I suspect this approach doesn't work all that well for other styles of games.
Specifically, because practically everything in my game happens on-click; there's very little running in the background.
Nah, I strained my eyes for this.
In this article, I'll explain why implementing numbers with just algebraic datatypes is desirable. I'll then talk about common implementations of FFT (Fast Fourier Transform) and why they hide inherent inefficiencies. I'll then show how to implement integers and complex numbers with just algebraic datatypes, in a way that is extremely simple and elegant. I'll conclude by deriving a pure functional implementation of complex FFT with just datatypes, no floats.
⚔️ Salutations fellow legends! ⚔️
Wow! Time has passed quickly since our last blog post, however, much progress has been made! Today, we're going to go over the technical aspects of the core engine for Legend of Worlds and what has been accomplished so far. The core of the engine has been completed, and now we are at the point where we can focus on gameplay and world creation logic!
Legend of Worlds is a cross-platform, cross-play, 2D online sandbox multiplayer experience where you can join, play, create and share player created worlds. This blog post covers the open-source game engine I've created in order to build this game.
In the last post, we discussed the benefits of Rust and WebAssembly in our game engine architecture. Rust gave us many benefits, but one issue it gave us was long compile times, depending on the more code and libraries we jammed into one module. This was getting to be a problem, as a Rust project starts off on my machine as a few seconds to compile
Let's list here crates that enhance Rust as a language.
It not "batteries" like in stdx, but Rust-specific crates for workarounds for various missing features and experimental ideals from non-accepted/postponed RFCs, or just hacky tricks.
The list is supposed to contain (mostly) crates that are internal to Rust, not ones for making Rust deal with "external world" like other languages bindings, file formats, protocols and so on.
Primary focus should be on crates that are not easy to find by conventional means (e.g. no algorithm name, format or protocol to search for).
Note that quality of the listed crates may vary from proof-of-concept to stable-and-widely-used.
Querying one's favorite search engine with the text "a monad is" yields this answer on StackOverflow, which explains, in excruciating mathematical symbology, what a monad in fact is. But, don't worry. Understanding monads doesn't require you to learn the nuances of such concepts as moirails and eigenfunctors. I would suggest that the concept of monads can be distilled into a clearer single sentence.
A monad is a control abstraction that defines a composition of effectful functions.
Let's unpack.
use thiserror::Error; | |
use tracing as trc; | |
/// An error that indicates that the program should exit with the given code | |
#[derive(Error, Debug)] | |
#[error("Program exited {0}")] | |
struct Exit(i32); | |
fn run() { | |
// Install tracing for logs |
Entity [ | |
MyComponent, | |
Scale { x: 2.0, y: 2.0, z: 2.0 }, | |
PropDemo { | |
value: "hello", | |
sequence: [0,1,2], | |
map: {field: 1.0, hello: "hi"}, | |
nested: {field: [{test: 1.0}]} | |
}, | |
// Children entities are nested |
Problem is, you will likely want to query by TimeStamp and need to index the TimeStamp in your schema. However when sending tons of mutations adding new values with high frequency the index keeps rebuilding and all attempts querying the timeseries data will either timeout or fail saying something like “try again later”. Recording a few values per minute should work fine, but for anything more aggressive run more tests before building a whole product relying on it. This approach puts timestamps on the node. An alternative approach is to put the timestamps on a facet, see below.
Schema
Name: string @index(fulltext, term, trigram) .
Value: uid @reverse .