summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-01-24 21:59:22 -0500
committerDavid Thompson <dthompson2@worcester.edu>2023-06-08 08:14:41 -0400
commitaa057408b5ae36d7e78e557294570b01c02cdf87 (patch)
tree077927625889f7a23cfc84e6c56db4008741d8e0
parentae40818c8b70d037c8f9d0456748afd7a3fd6bc1 (diff)
Update some comments.
-rw-r--r--chickadee/graphics/seagull.scm23
1 files changed, 13 insertions, 10 deletions
diff --git a/chickadee/graphics/seagull.scm b/chickadee/graphics/seagull.scm
index 9f5aaeb..278ca63 100644
--- a/chickadee/graphics/seagull.scm
+++ b/chickadee/graphics/seagull.scm
@@ -681,13 +681,11 @@
;;; Typed expressions
;;;
-;; Transform all program expressions into typed expressions by
-;; applying a variant of the Hindley-Milner type inference algorithm.
-;; GLSL is a statically typed language, but thanks to type inference
-;; Seagull code doesn't need type annotations.
-;;
-;; This section includes all the kinds of types an expression may have
-;; and various transformation procedures to manipulate them.
+;; Typed expressions combine a Seagull expression with the data types
+;; that expression returns. This section includes all the kinds of
+;; types an expression may have and various transformation procedures
+;; to manipulate them. This will be used below to convert the mostly
+;; untyped Seagull program into a fully typed one.
;; Primitive types:
(define (primitive-type name)
@@ -1051,7 +1049,9 @@
;;;
;; Convert untyped Seagull expressions into typed expressions with
-;; variable components that need to be solved for.
+;; type variables representing all unknown types. This annotated
+;; version of a Seagull program can then be passed to the type
+;; inference algorithm to solve for all of the variables.
(define (lookup-type name env)
(let ((type (lookup name env)))
@@ -1230,7 +1230,10 @@
;;;
;; Walk the expression tree of a type annotated program and solve for
-;; the type variables present.
+;; all of the type variables using a variant of the Hindley-Milner
+;; type inference algorithm. GLSL is a statically typed language, but
+;; thanks to type inference the user doesn't have to specify any types
+;; expect for shader inputs, outputs, and uniforms.
(define (compose-substitutions a b)
(define b*
@@ -1523,7 +1526,7 @@
;;; GLSL emission
;;;
-;; Transform typed expressions into a string of GLSL code.
+;; Transform a fully typed Seagull program into a string of GLSL code.
(define (type-name type)
(primitive-type-name type))