Skip to content

Instantly share code, notes, and snippets.

@nahuakang
nahuakang / zig_type_system.md
Created January 28, 2023 11:21 — forked from lobre/zig_type_system.md
Zig type system illustrated using ascii diagrams

Zig Type System

Zig aims to be a simple language. It is not easy to define what simple exactly means, but zig is also a low-level programming language that aims for c-compatibility. To reach this goal, it needs good semantics in its type system so that developers have a complete toolbox to manipulate data.

So types in zig are composable, but this can become rapidly overwhelming. See those examples. Are you able to understand them at a glance, as soon as you read them?

*const ?u8
?*const u8
*const [2]u8
@nahuakang
nahuakang / ANSI.md
Created January 19, 2023 18:06 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27

Keybase proof

I hereby claim:

  • I am nahuakang on github.
  • I am nahua (https://keybase.io/nahua) on keybase.
  • I have a public key ASC9YMx32r5VuKEUHt3Qmcp8X3tHm1-vXhax2w4R5aYJewo

To claim this, I am signing this object: