brain
tamnd's digital brain — notes, problems, research
42740 notes
Zig has a formatting system built into the standard library. You have already used it many times through std.debug.print.
Performance is one of the main reasons people choose Zig.
A memory mapped file is a file that the operating system places into your program's address space.
A thread is a separate path of execution inside one program.
Zig works unusually well with C because it treats C as a first-class part of systems programming.
Zig has a built-in test system. You do not need a separate testing library to start writing tests.
Zig has a built-in build system.
std is Zig’s standard library.
An ArrayList is one of the most important data structures in Zig.
Memory is one of the most important ideas in Zig.
Zig has special built-in functions whose names start with @.
comptime means “compile time.”
An optional type is a type that can hold either a value or no value.
A struct method is a function that belongs to a struct.
A multidimensional array is an array whose elements are also arrays.
A many item pointer is a pointer that can move across several values of the same type.
try is the most common way to handle errors in Zig.
Recursion is a technique where a function calls itself.
A struct is a type that groups several values together.
An array literal is the syntax you use to write array values directly in source code.
A pointer is a value that stores the address of another value.
An error union type means:
Many functions need to produce more than one piece of information.
Loops repeat code. But sometimes you do not want a loop to finish in the normal way.
An array is a group of values stored next to each other.
Memory is where a program keeps its data while it runs.
An error set is a group of possible error names.
Zig has blocks.
Functions often need to produce results.
A keyword is a word that has special meaning in Zig.
Most programming languages need a way to handle failure.
A while loop repeats while a condition is true.
Programs often need to repeat work.
Names are part of the program.
Function parameters are the inputs of a function.
Functions are reusable blocks of code.
An if statement is good for general conditions:
Comments are notes for humans who read the code.
A string is text.
Initialization means giving a value to something when it is created.
In Zig, undefined means “this value has not been initialized.”
Type inference means Zig can figure out a type from the value you write.
A boolean is a value that can be only one of two things:
Floating point numbers are numbers with fractional parts.
Integers are whole numbers.
Every value in a Zig program has a type.
Sooner or later, every Zig beginner meets the compiler.
You can write Zig code in any text editor.
So far, we have used single-file programs.
When beginners hear the word “compiler,” they often think of one job:
In the previous section, we used this command:
Now we will write and run a complete Zig program.
Before writing larger Zig programs, you need to understand an important fact:
Before we write more Zig code, we need the Zig compiler.
Zig exists because low-level programming is still important, but the old tools have painful tradeoffs.
Programs need to make choices.
A program stores values so it can use them later. In Zig, you store values with two main keywords:
Zig is a programming language for writing programs that are fast, clear, and close to the machine.
Zig is a programming language for writing fast, small, reliable programs.
Zig is a programming language for writing fast, small, reliable programs.
A set is a collection of objects called elements.
Modern number theory continues to evolve rapidly.
The Langlands program is one of the largest and most influential research programs in modern mathematics.
An elliptic curve over $\mathbb{Q}$ may be written in Weierstrass form
The Riemann zeta function is one of the central objects in mathematics.
Fermat's Last Theorem states that there are no positive integers
Number theory contains some of the oldest and deepest unsolved problems in mathematics.
Arithmetic statistics studies the distribution of arithmetic objects inside large families.
Prime numbers are deterministic objects, but many aspects of their distribution resemble random behavior.
The Riemann zeta function is defined for $\operatorname{Re}s>1$ by
Sieve methods are extremely effective for estimating how many integers avoid small prime factors. They have produced major results about:
The Twin Prime Conjecture states that infinitely many primes satisfy
A probabilistic algorithm uses random choices during its execution. In number theory, this is often a practical advantage rather than a weakness.
The Prime Number Theorem for arithmetic progressions states that for
The classical Langlands program relates:
Write the two integers as
One of the central problems of analytic number theory is understanding how primes distribute among residue classes.
A primality test determines whether an integer is prime.
Modular curves parameterize elliptic curves and connect modular forms with arithmetic geometry.
Fourier analysis decomposes functions into harmonic frequencies.
Classical sieve methods estimate how many integers survive congruence restrictions. The large sieve approaches these problems from a different direction.
One of the deepest ideas in algebraic number theory is that prime numbers possess hidden symmetry inside field extensions.
Let
Brun's sieve introduced the idea of estimating sifted sets through truncated inclusion-exclusion. However, Brun's method often produced bounds that were technically difficult...
A positive integer is called $y$-smooth if all of its prime factors are at most $y$.
The Riemann zeta function
Sieve methods are techniques for counting integers that remain after removing residue classes modulo primes.
In the ordinary integers, every nonzero integer factors uniquely into prime numbers.
Number theory often studies exact statements about individual integers. For example, one may ask whether a given integer is prime, squarefree, smooth, or representable as a...
The Langlands program predicts that many different arithmetic objects are connected by systematic transfers.
In additive number theory, ordinary asymptotic density is often too weak to control additive behavior.
Classical number theory studies arithmetic globally over fields such as
A zero-knowledge proof allows one party to convince another that a statement is true without revealing why it is true.
Galois groups encode the symmetries of algebraic equations and field extensions.
A central question in additive number theory asks whether every integer can be represented as a sum of elements from a fixed set.
The real numbers arise by completing the rational numbers using the ordinary absolute value. The $p$-adic numbers arise by completing the rational numbers using the $p$-adic...
Modern public-key cryptography relies heavily on two computational assumptions:
The Langlands program is one of the most ambitious and influential theories in modern mathematics.
Exponential sums are among the central tools of analytic number theory.
In ordinary analysis, the absolute value