Your first circuit
This is examples/Diode/rectifier.hvr from the repository — a full-bridge rectifier, small enough to read end to end. It converts a 50 Hz AC source to DC through four diodes and an output filter.
The three lines at the top
Every entry file starts with directives, not code — see .save / .tran / .solver for the full list. Here: .save picks which nodes end up in the output CSV, .tran sets the transient run window — start, end, and the largest step the run may take — and .solver picks the integration method (ndf2 — see available solvers). Note that 100u is a ceiling, not a fixed step: ndf2 is variable-step and will go below it wherever the waveform needs it, particularly at each diode commutation.
A reusable module
AC_Source is an analog module with generic parameters (amplitude, freq) and a declared port list (out_p, out_n). Inside it, plain C++-flavored expressions (sin(...), the built-in time) compute a signal that's driven onto the wires with voltage_source<>(v_sig)[...]. See Wires & components.
The top-level circuit
Every file needs exactly one module main<>(). It declares its wires, instantiates v_ac from the module above, instantiates four diodes imported from the standard library, and closes the loop with a load resistor and a smoothing capacitor. gnd is the one wire name that's always in scope.
parts.D1N4007 is a part card: a real device from <parts/diode>, wrapping the standard library's SPICE-level Diode model with the datasheet values already filled in. That is why it takes no generic parameters — the card supplies all fourteen of them. Reach for <semiconductors> directly only when you want to specify a junction yourself.
Run it
This compiles rectifier.hvr to a native binary (see The CLI), runs it, and writes simulation_output.csv with the nodes named in .save — ac_in1, ac_in2, dc_out — one column per node, one row per saved time step.