From e04af86491d97b297406cc4cd0d77fbbfc3a94c4 Mon Sep 17 00:00:00 2001 From: JJ Date: Thu, 16 May 2024 17:40:34 -0700 Subject: docs: update website --- docs/book/TYPES.html | 271 ++++++++++++++++++++------------------------------- 1 file changed, 106 insertions(+), 165 deletions(-) (limited to 'docs/book/TYPES.html') diff --git a/docs/book/TYPES.html b/docs/book/TYPES.html index 488aa6d..5abe998 100644 --- a/docs/book/TYPES.html +++ b/docs/book/TYPES.html @@ -7,7 +7,7 @@ - + @@ -182,11 +182,10 @@

Basic types can be one-of:

-
  • decimal: precision decimal number. +
  • decimal: precision decimal number.
  • byte: an alias to u8.
  • -
  • char: a distinct alias to u32. For working with Unicode.
  • -
  • str: a string type. mutable. internally a byte-array: externally a char-array.
  • -
  • void: an internal type designating the absence of a value. often elided.
  • -
  • never: a type that denotes functions that do not return. distinct from returning nothing.
  • +
  • char: an alias to u32. For working with Unicode.
  • +
  • str: a string type. mutable. packed: internally a byte-array, externally a char-array.
  • +
  • void: an internal type designating the absence of a value. often elided.
  • +
  • never: a type that denotes functions that do not return. distinct from returning nothing.
  • bool and int/uint/float and siblings (and subsequently byte and char) are all considered primitive types and are always copied (unless passed as mutable). More on when parameters are passed by value vs. passed by reference can be found in the memory management document.

    -

    Primitive types combine with str, void, and never to form basic types. void and never will rarely be referenced by name: instead, the absence of a type typically implicitly denotes one or the other. Still, having a name is helpful in some situations.

    +

    Primitive types, alongside str, void, and never, form basic types. void and never will rarely be referenced by name: instead, the absence of a type typically implicitly denotes one or the other. Still, having a name is helpful in some situations.

    integers

    todo

    strings

    @@ -216,18 +215,18 @@
  • internally a byte array
  • externally a char (four bytes) array
  • prefixed with their length and capacity
  • -
  • automatically resize like a list
  • +
  • automatically resize
  • They are also quite complicated. Puck has full support for Unicode and wishes to be intuitive, performant, and safe, as all languages wish to be. Strings present a problem that much effort has been expended on in (primarily) Swift and Rust to solve.

    Abstract Types

    -

    Abstract types, broadly speaking, are types described by their behavior rather than their implementation. They are more commonly know as abstract data types: which is confusingly similar to "algebraic data types", another term for the advanced types they are built out of under the hood. We refer to them here as "abstract types" to mitigate some confusion.

    +

    Abstract types, broadly speaking, are types described by their behavior rather than their implementation. They are more commonly know as abstract data types: which is confusingly similar to "algebraic data types", another term for the advanced types they are built out of under the hood. We refer to them here as "abstract types" to mitigate some confusion.

    iterable types

    Iterable types can be one-of:

    These iterable types are commonly used, and bits and pieces of compiler magic are used here and there (mostly around initialization, and ownership) to ease use. All of these types are some sort of sequence: and implement the Iter interface, and so can be iterated (hence the name).

    other abstract types

    @@ -255,12 +254,12 @@ These are monomorphized into more specific functions at compile-time if needed.<

    Parameter types can be one-of: