Skip to content

Blog — page 14

664 posts on software development, newest first. Browse by topic:Rust, Go, Python, JavaScript & web, AI & data, DevOps & tooling, Mobile & Android, .NET & C#, C++ & systems, LaTeX, Investing, Everything else.

  1. RustCalling WebAssembly from JavaScript: exports, imports and when it is fasterHow to load a .wasm module in the browser, call its exports, pass JavaScript functions in as imports, and decide whether moving code to WebAssembly will help.
  2. JavaScript & webSubscribing a customer to a Clover recurring plan with PHPUse Clover's sandbox APIs from PHP to tokenize a card, create a customer with a card on file, look up a tax rate, and subscribe them to a recurring plan.
  3. RustCalling C functions from Rust with FFI and the cc crateCompile a small C file with a Cargo build script, declare it in an unsafe extern block, and call it from Rust, including passing strings with CString.
  4. RustWrite a procedural macro in Rust: a custom assert_equals! with syn and quoteBuild a function-like procedural macro that compares two expressions and prints both values on failure, and compare it with a macro_rules! version.
  5. Rustserde_json basics: converting Rust structs to and from JSONAdd serde and serde_json to a Rust project, derive Serialize and Deserialize, and convert structs to and from JSON strings with error handling.
  6. RustUnsafe Rust basics: raw pointers and calling C's malloc and freeWhat the unsafe keyword allows in Rust, with two examples, dereferencing a raw pointer and managing a buffer with libc's malloc and free, plus the rules you must uphold.
  7. RustRust and other languages: FFI, WebAssembly, and gRPC comparedThree ways to make Rust work with other languages: in-process calls over the C ABI, compiling to WebAssembly, and gRPC services over the network.
  8. RustCalling C and C++ code from Rust with FFI and the cc crateCompile C and C++ sources with the cc crate, declare them in Rust with extern "C", pass strings safely with CString, and wrap C++ classes in C functions.
  9. RustSharing data between threads in Rust with Arc and MutexUse Arc<Mutex<T>> to let several threads update one Vec safely, plus when an atomic or a channel is the better synchronization primitive.
  10. RustBuilding a TCP chat server and client in Rust with std::netA small multi-client chat program using only Rust's standard library: TcpListener, one thread per client, and a shared map of connections for broadcasting.
  11. RustGetting started with Rocket 0.5: routes, catchers and Tera templatesSet up a Rocket 0.5 web app in Rust on stable: define routes, add a custom 404 catcher, and render HTML with rocket_dyn_templates and Tera.
  12. RustHashing strings with SHA-256 and SHA-512 in Rust using the sha2 crateA small Rust program that reads a line from stdin and prints its SHA-256 and SHA-512 digests as hex, using the RustCrypto sha2 and hex crates.

© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)