]> ocean-lang.org Git - ocean-D/blobdiff - Diary
updates
[ocean-D] / Diary
diff --git a/Diary b/Diary
new file mode 100644 (file)
index 0000000..daa26f8
--- /dev/null
+++ b/Diary
@@ -0,0 +1,52 @@
+06oct2020
+
+I want to have a language where '//' is a token - integer division.
+I want three options in scanner:
+ 1/ parse the comment and report it as a token
+ 2/ parse the comment and don't report it as a token (i.e. 'ignored')
+ 3/ don't parse it, report as TK_mark
+
+This could apply separately for "#" and "//" and "/*".  But I only have two
+type: TK_comment and TK_line_comment.
+
+I could list these as 'known' but that prevents "///" being recognised
+as a mark.
+
+12mar2021
+How to split values from type so they can be small - only one type
+ pointer for an array, for example.
+Currently a "value" contains both a 'type' and a union of options:
+   str, num, bool, label, array(recursive), structure
+where some of these include type information.
+
+To split this I need to keep type and attach it to a var and pass
+around with a value.  So that value needs to be a pointer to a union?
+And a size in bytes?
+
+17mar2021
+ I need to have transient values - registers? - for holding the
+ intermediate result of a computation before assigning to a variable.
+ This is/was 'struct lrval' which was a val and a *lval.
+ Now that a 'struct value' is always a pointer, the 'struct value' can be
+ either the rval or lval, but I need to be able to store
+ content as well - the old 'struct value val'.
+ Maybe I want 'struct value' to still contain the thing (not a pointer)
+ and use 'char  ptr[1]' for generic content.
+
+10oct2021
+ arrays can have a 'const' as the size - and they can be calculated
+ from the current value of variables.  So how do we allocate them?
+ In particular, how do we handle them appearing in recursive functions?
+
+ For variables with a fixed size - known at function-start at least -
+ we can allocate a stack frame for all of them, and the index off
+ the stack frame.
+ I guess var-sized arrays have a pointer in the stack frame, are
+ allocated when they come into scope, and freed when they go out.
+
+ So I need var-alloc for these to be quite different to other vars
+ All vars need to be initialized when they come into scope, and
+ de-initialized.
+
+ Currently we initialise or re-initialised when entering scope,
+ and only free when exiting program