Hello, World
Testing all blog components - code blocks, callouts, dividers, and TOC.
First post. Testing all available components.
Code blocks
Plain block with lang tag and copy button:
fn greet(name: &str) -> String {
format!("Hello, {}!", name)
}
fn main() {
println!("{}", greet("world"));
}
Block with external link button:
fn greet(name: &str) -> String {
format!("Hello, {}!", name)
}
fn main() {
println!("{}", greet("world"));
}
Inline code looks like this.
01 - CALLOUT BLOCKS
Callouts
NOTE
Default callout. Uses the green accent. Good for general notes and observations.
KEY INSIGHT
Teal callout. Use for important takeaways, things worth remembering.
INFO
Blue callout. Good for background context or supplementary information.
WARNING
Yellow callout. Use for gotchas, caveats, things that need attention.
DANGER ZONE
Salmon callout. Reserve for unsafe code, footguns, things that can go wrong badly.
02 - MORE LANGUAGES
Other languages
const std = @import("std");
pub fn main() void {
const msg = "hello, world";
std.debug.print("{s}\n", .{msg});
}#include <stdio.h>
int main(void) {
printf("hello, world\n");
return 0;
}[package]
name = "example"
version = "0.1.0"
edition = "2021"
[dependencies]
serde = { version = "1", features = ["derive"] }03 - COMPARISON TABLE
Tables
| Feature | Rust | Zig | C |
|---|---|---|---|
| Memory safety | Compile-time borrow checker | Optional, manual | Manual |
| Build system | Cargo | Built-in zig build | Make / CMake |
| Error handling | Result<T, E> | Error unions | Return codes |
| Null safety | No null, use Option<T> | Optional types ?T | Nullable pointers |
| Compile speed | Slow | Fast | Fast |
| Runtime | Zero-cost abstractions | Zero-cost | Zero-cost |