summaryrefslogtreecommitdiff
path: root/comp/lucas-standen-NEA
diff options
context:
space:
mode:
Diffstat (limited to 'comp/lucas-standen-NEA')
-rw-r--r--comp/lucas-standen-NEA/code2/Makefile2
-rwxr-xr-xcomp/lucas-standen-NEA/code2/examples/fib_examplebin25496 -> 24664 bytes
-rw-r--r--comp/lucas-standen-NEA/code2/examples/fib_example.zpy1
-rwxr-xr-xcomp/lucas-standen-NEA/code2/examples/spaceinvadersbin1086520 -> 1078832 bytes
-rwxr-xr-xcomp/lucas-standen-NEA/code2/examples/str_examplebin25952 -> 19704 bytes
-rw-r--r--comp/lucas-standen-NEA/code2/stdlib/Makefile2
-rw-r--r--comp/lucas-standen-NEA/code2/stdlib/String/Makefile2
-rwxr-xr-xcomp/lucas-standen-NEA/code2/zpybin42592 -> 26616 bytes
-rw-r--r--comp/lucas-standen-NEA/code2/zpy.c2
-rw-r--r--comp/lucas-standen-NEA/writeup/otherwise the limit would be quickly reached, it can't314
-rw-r--r--comp/lucas-standen-NEA/writeup/t support the usage of higher order functions, this will mean the1208
-rw-r--r--comp/lucas-standen-NEA/writeup2/writeup.aux47
-rw-r--r--comp/lucas-standen-NEA/writeup2/writeup.fdb_latexmk10
-rw-r--r--comp/lucas-standen-NEA/writeup2/writeup.fls2
-rw-r--r--comp/lucas-standen-NEA/writeup2/writeup.log148
-rw-r--r--comp/lucas-standen-NEA/writeup2/writeup.out5
-rw-r--r--comp/lucas-standen-NEA/writeup2/writeup.synctex.gzbin206686 -> 211150 bytes
-rw-r--r--comp/lucas-standen-NEA/writeup2/writeup.tex44
-rw-r--r--comp/lucas-standen-NEA/writeup2/writeup.toc35
19 files changed, 1661 insertions, 161 deletions
diff --git a/comp/lucas-standen-NEA/code2/Makefile b/comp/lucas-standen-NEA/code2/Makefile
index 4dc4224..cfd4254 100644
--- a/comp/lucas-standen-NEA/code2/Makefile
+++ b/comp/lucas-standen-NEA/code2/Makefile
@@ -1,5 +1,5 @@
CC = cc
-CFLAGS = -O0 -ggdb
+CFLAGS =-O3
zpy: zpy.c comp.c parser.c tokenizer.c util.c
${CC} *.c -c ${CFLAGS}
diff --git a/comp/lucas-standen-NEA/code2/examples/fib_example b/comp/lucas-standen-NEA/code2/examples/fib_example
index bdd94ec..517a257 100755
--- a/comp/lucas-standen-NEA/code2/examples/fib_example
+++ b/comp/lucas-standen-NEA/code2/examples/fib_example
Binary files differ
diff --git a/comp/lucas-standen-NEA/code2/examples/fib_example.zpy b/comp/lucas-standen-NEA/code2/examples/fib_example.zpy
index a79b7d7..adb2a71 100644
--- a/comp/lucas-standen-NEA/code2/examples/fib_example.zpy
+++ b/comp/lucas-standen-NEA/code2/examples/fib_example.zpy
@@ -7,6 +7,7 @@
(endfun)
(defun main int)
+ (printstr "give me a number (bellow 30 if you want it to be quick): ")
(let n:int (readint))
(printint (fib n))
(printchar '\n')
diff --git a/comp/lucas-standen-NEA/code2/examples/spaceinvaders b/comp/lucas-standen-NEA/code2/examples/spaceinvaders
index ec88002..6208f66 100755
--- a/comp/lucas-standen-NEA/code2/examples/spaceinvaders
+++ b/comp/lucas-standen-NEA/code2/examples/spaceinvaders
Binary files differ
diff --git a/comp/lucas-standen-NEA/code2/examples/str_example b/comp/lucas-standen-NEA/code2/examples/str_example
index c543ab7..2cce391 100755
--- a/comp/lucas-standen-NEA/code2/examples/str_example
+++ b/comp/lucas-standen-NEA/code2/examples/str_example
Binary files differ
diff --git a/comp/lucas-standen-NEA/code2/stdlib/Makefile b/comp/lucas-standen-NEA/code2/stdlib/Makefile
index ff46d14..9d4bfd6 100644
--- a/comp/lucas-standen-NEA/code2/stdlib/Makefile
+++ b/comp/lucas-standen-NEA/code2/stdlib/Makefile
@@ -1,5 +1,5 @@
CC=cc
-CFLAGS=-O0 -ggdb
+CFLAGS=-O3
stdlib:
cd String && make
diff --git a/comp/lucas-standen-NEA/code2/stdlib/String/Makefile b/comp/lucas-standen-NEA/code2/stdlib/String/Makefile
index e61ca1d..053ab59 100644
--- a/comp/lucas-standen-NEA/code2/stdlib/String/Makefile
+++ b/comp/lucas-standen-NEA/code2/stdlib/String/Makefile
@@ -1,5 +1,5 @@
CC=cc
-CFLAGS=-ggdb
+CFLAGS=-O3
all: String.c
${CC} String.c -c -o String.o ${CFLAGS}
diff --git a/comp/lucas-standen-NEA/code2/zpy b/comp/lucas-standen-NEA/code2/zpy
index 0c23ae3..18b20e8 100755
--- a/comp/lucas-standen-NEA/code2/zpy
+++ b/comp/lucas-standen-NEA/code2/zpy
Binary files differ
diff --git a/comp/lucas-standen-NEA/code2/zpy.c b/comp/lucas-standen-NEA/code2/zpy.c
index 40a497e..c370ca2 100644
--- a/comp/lucas-standen-NEA/code2/zpy.c
+++ b/comp/lucas-standen-NEA/code2/zpy.c
@@ -88,7 +88,7 @@ int main(int argc, char **argv){
if (omitc == false){
char *cmd = malloc(512);
- snprintf(cmd, 512, "cc ./tmp.zpy.c /usr/local/share/zpylib/*.o -o %s -I/usr/local/share/zpylib/include -Wno-implicit-function-declaration ", outfilename);
+ snprintf(cmd, 512, "cc -O3 ./tmp.zpy.c /usr/local/share/zpylib/*.o -o %s -I/usr/local/share/zpylib/include -Wno-implicit-function-declaration ", outfilename);
for (int i = 0; i < compilerflagscount; i++){
cmd = appendsnprintf(cmd, 512, "%s ", compilerflags[i]);
}
diff --git a/comp/lucas-standen-NEA/writeup/otherwise the limit would be quickly reached, it can't b/comp/lucas-standen-NEA/writeup/otherwise the limit would be quickly reached, it can't
new file mode 100644
index 0000000..1250959
--- /dev/null
+++ b/comp/lucas-standen-NEA/writeup/otherwise the limit would be quickly reached, it can't
@@ -0,0 +1,314 @@
+
+ SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
+
+ Commands marked with * may be preceded by a number, _N.
+ Notes in parentheses indicate the behavior if _N is given.
+ A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
+
+ h H Display this help.
+ q :q Q :Q ZZ Exit.
+ ---------------------------------------------------------------------------
+
+ MMOOVVIINNGG
+
+ e ^E j ^N CR * Forward one line (or _N lines).
+ y ^Y k ^K ^P * Backward one line (or _N lines).
+ f ^F ^V SPACE * Forward one window (or _N lines).
+ b ^B ESC-v * Backward one window (or _N lines).
+ z * Forward one window (and set window to _N).
+ w * Backward one window (and set window to _N).
+ ESC-SPACE * Forward one window, but don't stop at end-of-file.
+ d ^D * Forward one half-window (and set half-window to _N).
+ u ^U * Backward one half-window (and set half-window to _N).
+ ESC-) RightArrow * Right one half screen width (or _N positions).
+ ESC-( LeftArrow * Left one half screen width (or _N positions).
+ ESC-} ^RightArrow Right to last column displayed.
+ ESC-{ ^LeftArrow Left to first column.
+ F Forward forever; like "tail -f".
+ ESC-F Like F but stop when search pattern is found.
+ r ^R ^L Repaint screen.
+ R Repaint screen, discarding buffered input.
+ ---------------------------------------------------
+ Default "window" is the screen height.
+ Default "half-window" is half of the screen height.
+ ---------------------------------------------------------------------------
+
+ SSEEAARRCCHHIINNGG
+
+ /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line.
+ ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line.
+ n * Repeat previous search (for _N-th occurrence).
+ N * Repeat previous search in reverse direction.
+ ESC-n * Repeat previous search, spanning files.
+ ESC-N * Repeat previous search, reverse dir. & spanning files.
+ ^O^N ^On * Search forward for (_N-th) OSC8 hyperlink.
+ ^O^P ^Op * Search backward for (_N-th) OSC8 hyperlink.
+ ^O^L ^Ol Jump to the currently selected OSC8 hyperlink.
+ ESC-u Undo (toggle) search highlighting.
+ ESC-U Clear search highlighting.
+ &_p_a_t_t_e_r_n * Display only matching lines.
+ ---------------------------------------------------
+ A search pattern may begin with one or more of:
+ ^N or ! Search for NON-matching lines.
+ ^E or * Search multiple files (pass thru END OF FILE).
+ ^F or @ Start search at FIRST file (for /) or last file (for ?).
+ ^K Highlight matches, but don't move (KEEP position).
+ ^R Don't use REGULAR EXPRESSIONS.
+ ^S _n Search for match in _n-th parenthesized subpattern.
+ ^W WRAP search if no match found.
+ ^L Enter next character literally into pattern.
+ ---------------------------------------------------------------------------
+
+ JJUUMMPPIINNGG
+
+ g < ESC-< * Go to first line in file (or line _N).
+ G > ESC-> * Go to last line in file (or line _N).
+ p % * Go to beginning of file (or _N percent into file).
+ t * Go to the (_N-th) next tag.
+ T * Go to the (_N-th) previous tag.
+ { ( [ * Find close bracket } ) ].
+ } ) ] * Find open bracket { ( [.
+ ESC-^F _<_c_1_> _<_c_2_> * Find close bracket _<_c_2_>.
+ ESC-^B _<_c_1_> _<_c_2_> * Find open bracket _<_c_1_>.
+ ---------------------------------------------------
+ Each "find close bracket" command goes forward to the close bracket
+ matching the (_N-th) open bracket in the top line.
+ Each "find open bracket" command goes backward to the open bracket
+ matching the (_N-th) close bracket in the bottom line.
+
+ m_<_l_e_t_t_e_r_> Mark the current top line with <letter>.
+ M_<_l_e_t_t_e_r_> Mark the current bottom line with <letter>.
+ '_<_l_e_t_t_e_r_> Go to a previously marked position.
+ '' Go to the previous position.
+ ^X^X Same as '.
+ ESC-m_<_l_e_t_t_e_r_> Clear a mark.
+ ---------------------------------------------------
+ A mark is any upper-case or lower-case letter.
+ Certain marks are predefined:
+ ^ means beginning of the file
+ $ means end of the file
+ ---------------------------------------------------------------------------
+
+ CCHHAANNGGIINNGG FFIILLEESS
+
+ :e [_f_i_l_e] Examine a new file.
+ ^X^V Same as :e.
+ :n * Examine the (_N-th) next file from the command line.
+ :p * Examine the (_N-th) previous file from the command line.
+ :x * Examine the first (or _N-th) file from the command line.
+ ^O^O Open the currently selected OSC8 hyperlink.
+ :d Delete the current file from the command line list.
+ = ^G :f Print current file name.
+ ---------------------------------------------------------------------------
+
+ MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS
+
+ -_<_f_l_a_g_> Toggle a command line option [see OPTIONS below].
+ --_<_n_a_m_e_> Toggle a command line option, by name.
+ __<_f_l_a_g_> Display the setting of a command line option.
+ ___<_n_a_m_e_> Display the setting of an option, by name.
+ +_c_m_d Execute the less cmd each time a new file is examined.
+
+ !_c_o_m_m_a_n_d Execute the shell command with $SHELL.
+ #_c_o_m_m_a_n_d Execute the shell command, expanded like a prompt.
+ |XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command.
+ s _f_i_l_e Save input to a file.
+ v Edit the current file with $VISUAL or $EDITOR.
+ V Print version number of "less".
+ ---------------------------------------------------------------------------
+
+ OOPPTTIIOONNSS
+
+ Most options may be changed either on the command line,
+ or from within less by using the - or -- command.
+ Options may be given in one of two forms: either a single
+ character preceded by a -, or a name preceded by --.
+
+ -? ........ --help
+ Display help (from command line).
+ -a ........ --search-skip-screen
+ Search skips current screen.
+ -A ........ --SEARCH-SKIP-SCREEN
+ Search starts just after target line.
+ -b [_N] .... --buffers=[_N]
+ Number of buffers.
+ -B ........ --auto-buffers
+ Don't automatically allocate buffers for pipes.
+ -c ........ --clear-screen
+ Repaint by clearing rather than scrolling.
+ -d ........ --dumb
+ Dumb terminal.
+ -D xx_c_o_l_o_r . --color=xx_c_o_l_o_r
+ Set screen colors.
+ -e -E .... --quit-at-eof --QUIT-AT-EOF
+ Quit at end of file.
+ -f ........ --force
+ Force open non-regular files.
+ -F ........ --quit-if-one-screen
+ Quit if entire file fits on first screen.
+ -g ........ --hilite-search
+ Highlight only last match for searches.
+ -G ........ --HILITE-SEARCH
+ Don't highlight any matches for searches.
+ -h [_N] .... --max-back-scroll=[_N]
+ Backward scroll limit.
+ -i ........ --ignore-case
+ Ignore case in searches that do not contain uppercase.
+ -I ........ --IGNORE-CASE
+ Ignore case in all searches.
+ -j [_N] .... --jump-target=[_N]
+ Screen position of target lines.
+ -J ........ --status-column
+ Display a status column at left edge of screen.
+ -k _f_i_l_e ... --lesskey-file=_f_i_l_e
+ Use a compiled lesskey file.
+ -K ........ --quit-on-intr
+ Exit less in response to ctrl-C.
+ -L ........ --no-lessopen
+ Ignore the LESSOPEN environment variable.
+ -m -M .... --long-prompt --LONG-PROMPT
+ Set prompt style.
+ -n ......... --line-numbers
+ Suppress line numbers in prompts and messages.
+ -N ......... --LINE-NUMBERS
+ Display line number at start of each line.
+ -o [_f_i_l_e] .. --log-file=[_f_i_l_e]
+ Copy to log file (standard input only).
+ -O [_f_i_l_e] .. --LOG-FILE=[_f_i_l_e]
+ Copy to log file (unconditionally overwrite).
+ -p _p_a_t_t_e_r_n . --pattern=[_p_a_t_t_e_r_n]
+ Start at pattern (from command line).
+ -P [_p_r_o_m_p_t] --prompt=[_p_r_o_m_p_t]
+ Define new prompt.
+ -q -Q .... --quiet --QUIET --silent --SILENT
+ Quiet the terminal bell.
+ -r -R .... --raw-control-chars --RAW-CONTROL-CHARS
+ Output "raw" control characters.
+ -s ........ --squeeze-blank-lines
+ Squeeze multiple blank lines.
+ -S ........ --chop-long-lines
+ Chop (truncate) long lines rather than wrapping.
+ -t _t_a_g .... --tag=[_t_a_g]
+ Find a tag.
+ -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e]
+ Use an alternate tags file.
+ -u -U .... --underline-special --UNDERLINE-SPECIAL
+ Change handling of backspaces, tabs and carriage returns.
+ -V ........ --version
+ Display the version number of "less".
+ -w ........ --hilite-unread
+ Highlight first new line after forward-screen.
+ -W ........ --HILITE-UNREAD
+ Highlight first new line after any forward movement.
+ -x [_N[,...]] --tabs=[_N[,...]]
+ Set tab stops.
+ -X ........ --no-init
+ Don't use termcap init/deinit strings.
+ -y [_N] .... --max-forw-scroll=[_N]
+ Forward scroll limit.
+ -z [_N] .... --window=[_N]
+ Set size of window.
+ -" [_c[_c]] . --quotes=[_c[_c]]
+ Set shell quote characters.
+ -~ ........ --tilde
+ Don't display tildes after end of file.
+ -# [_N] .... --shift=[_N]
+ Set horizontal scroll amount (0 = one half screen width).
+
+ --exit-follow-on-close
+ Exit F command on a pipe when writer closes pipe.
+ --file-size
+ Automatically determine the size of the input file.
+ --follow-name
+ The F command changes files if the input file is renamed.
+ --header=[_L[,_C[,_N]]]
+ Use _L lines (starting at line _N) and _C columns as headers.
+ --incsearch
+ Search file as each pattern character is typed in.
+ --intr=[_C]
+ Use _C instead of ^X to interrupt a read.
+ --lesskey-context=_t_e_x_t
+ Use lesskey source file contents.
+ --lesskey-src=_f_i_l_e
+ Use a lesskey source file.
+ --line-num-width=[_N]
+ Set the width of the -N line number field to _N characters.
+ --match-shift=[_N]
+ Show at least _N characters to the left of a search match.
+ --modelines=[_N]
+ Read _N lines from the input file and look for vim modelines.
+ --mouse
+ Enable mouse input.
+ --no-keypad
+ Don't send termcap keypad init/deinit strings.
+ --no-histdups
+ Remove duplicates from command history.
+ --no-number-headers
+ Don't give line numbers to header lines.
+ --no-search-header-lines
+ Searches do not include header lines.
+ --no-search-header-columns
+ Searches do not include header columns.
+ --no-search-headers
+ Searches do not include header lines or columns.
+ --no-vbell
+ Disable the terminal's visual bell.
+ --redraw-on-quit
+ Redraw final screen when quitting.
+ --rscroll=[_C]
+ Set the character used to mark truncated lines.
+ --save-marks
+ Retain marks across invocations of less.
+ --search-options=[EFKNRW-]
+ Set default options for every search.
+ --show-preproc-errors
+ Display a message if preprocessor exits with an error status.
+ --proc-backspace
+ Process backspaces for bold/underline.
+ --PROC-BACKSPACE
+ Treat backspaces as control characters.
+ --proc-return
+ Delete carriage returns before newline.
+ --PROC-RETURN
+ Treat carriage returns as control characters.
+ --proc-tab
+ Expand tabs to spaces.
+ --PROC-TAB
+ Treat tabs as control characters.
+ --status-col-width=[_N]
+ Set the width of the -J status column to _N characters.
+ --status-line
+ Highlight or color the entire line containing a mark.
+ --use-backslash
+ Subsequent options use backslash as escape char.
+ --use-color
+ Enables colored text.
+ --wheel-lines=[_N]
+ Each click of the mouse wheel moves _N lines.
+ --wordwrap
+ Wrap lines at spaces.
+
+
+ ---------------------------------------------------------------------------
+
+ LLIINNEE EEDDIITTIINNGG
+
+ These keys can be used to edit text being entered
+ on the "command line" at the bottom of the screen.
+
+ RightArrow ..................... ESC-l ... Move cursor right one character.
+ LeftArrow ...................... ESC-h ... Move cursor left one character.
+ ctrl-RightArrow ESC-RightArrow ESC-w ... Move cursor right one word.
+ ctrl-LeftArrow ESC-LeftArrow ESC-b ... Move cursor left one word.
+ HOME ........................... ESC-0 ... Move cursor to start of line.
+ END ............................ ESC-$ ... Move cursor to end of line.
+ BACKSPACE ................................ Delete char to left of cursor.
+ DELETE ......................... ESC-x ... Delete char under cursor.
+ ctrl-BACKSPACE ESC-BACKSPACE ........... Delete word to left of cursor.
+ ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor.
+ ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line.
+ UpArrow ........................ ESC-k ... Retrieve previous command line.
+ DownArrow ...................... ESC-j ... Retrieve next command line.
+ TAB ...................................... Complete filename & cycle.
+ SHIFT-TAB ...................... ESC-TAB Complete filename & reverse cycle.
+ ctrl-L ................................... Complete filename, list all.
diff --git a/comp/lucas-standen-NEA/writeup/t support the usage of higher order functions, this will mean the b/comp/lucas-standen-NEA/writeup/t support the usage of higher order functions, this will mean the
new file mode 100644
index 0000000..e18f9c0
--- /dev/null
+++ b/comp/lucas-standen-NEA/writeup/t support the usage of higher order functions, this will mean the
@@ -0,0 +1,1208 @@
+.TL
+The solution To bad code
+.AU
+Lucas Standen
+.AI
+7949
+.AB
+
+.NH 1
+Reading this document
+.LP
+This document is writen in roff and can be found online at:
+
+https://github.com/standenboy/school/tree/master/comp/lucas-standen-NEA/writeup
+
+It is using the ms macro of troff. It can be compiled using the Makefile,
+or make.sh. A table of
+contents has been generated using pdftocgen, it is embedded into the pdf,
+most pdf readers have
+a button to open it (firefox has it in the top left, in zathura press tab
+to view it).
+
+A note on formating of the roff, the text is limited to 80 characters per
+line and is writen in
+plain ascii, no utf8 emojis and the like. Code snippets are left in plain
+text, while full files
+are converted to a ps file via https://carbon.now.sh/ they should be 150mm ^
+2 (as ps is a vector
+format this wont lower quality, you might need to zoom in though) and then
+have there source linked
+above them; assuming they are from a file and not a small example.
+
+.NH 1
+Analysis
+.NH 2
+The current problem
+.LP
+For general small and simple projects, I write in C. However this leads to
+hours of debugging due to
+segfaults, and memory leaks. Due to the languages manual memory management
+the programmer is
+required to know so much information about the hardware they write for,
+and the second anything goes
+wrong, it is vague on how to fix things.
+
+.B "I need a language that stops me from shooting myself in the foot"
+
+C has been standard for many decades now and its age is showing, it lacks
+many modern features like
+OOP, or higher level functional abstractions, that have become common in
+modern years due to there
+helpfulness. This is not to fault C's achievements either, the language is
+my personal choice for
+most projects for a reason, it's fast and powerful; any solution I make
+should not cut that away.
+
+.NH 2
+A solution
+.LP
+.BI "Zippy LANG"
+
+A next generation language, for general use. Designed for keeping code simple,
+neat and readable.
+It will be similar to functional languages, known for there strict ability
+to keep code safe and
+practical. The language should be interpreted like python, perl and lisp,
+to allow for easy
+debugging tools.
+
+The goal of Zippy is to make codding easier, while remaining fast, with a
+interpreter writen in C.
+
+.NH 2
+What is a programming language
+.NH 3
+A very simple explanation
+.LP
+At its lowest definition a PL is a set of specific words, that when given
+to a computer in the
+right order have a reproducible behaviour. A more human way of saying that,
+would be its how we
+control computers.
+.NH 3
+Why are there so many
+.LP
+When someone is looking at code it can often be seen as just that, however
+there are hundreds of
+languages that all take the idea of "code" in very different ways. Some are
+designed for specific
+hardware, some are designed for making general use programs while others
+are highly specialized.
+It is important to see "code", as more than just one overarching term and
+instead see where the code
+is being used, and evaluate it from that.
+
+
+.NH 2
+Researching, and getting a scope of the project
+.LP
+Before I start to design a language i should first find examples of others
+and find what i want my
+language to be like.
+
+I'd like my language to feel modern so i should take inspiration from what
+other modern languages
+do, however on the backed i want my language to be stable and fast, for that
+i should look at
+older projects.
+
+.NH 3
+Examples of older similar projects, that are a good base for my language
+.NH 4
+Python
+.LP
+Python is a high level OOP language that was designed in 1991. It was made
+to make programming easy
+while still being able to use some of C's functions. Although it has become
+standard for many use
+cases, it is slow and inefficient, and very bloated.
+
+https://www.python.org/
+
+Zippy should take pythons high level abstractions, as they make programming
+very easy and it should
+try and take notes from its libraries as they are mostly well written,
+and well documented.
+.NH 4
+Lisp
+.LP
+Lisp is the second ever programming language, developed at MiT, it is the
+first functional language,
+creating many common features like higher order functions, recursion, and
+garbage collection. It is
+generally not used any more as it feels old compared to other functional
+languages, like Ocaml or
+Haskell.
+
+https://lisp-lang.org/
+
+Zippy should try to take alot from the syntax of lisp, () make it easy to
+see what parts of code
+will effect what, and make things easy to parse.
+.NH 4
+Perl
+.LP
+Perl is scripting language designed for use in linux, when bash is too slow,
+or not suited for the
+job. Perl is often described as the glue of the universe (see xkcd
+https://3d.xkcd.com/224/).
+Its syntax is quite strange however and it is slow. Making it poorly suited
+towards general use.
+
+https://www.perl.org/
+
+Zippy should take from perls minimalism, it is a small language that is of
+a similar size to bash
+or zsh, while feeling closer to python. If Zippy can achieve a similar small
+size, while remaining
+powerful I will be happy.
+
+.NH 3
+Examples of new similar projects that are also a good base
+.NH 4
+Gleam
+.LP
+Gleam is a modern language releasing in the past 5 years. It is highly
+functional, with no mutable
+data, no traditional loops. Instead recursion can be used to replace alot
+of these features.
+Gleam compiles to erlang/Beam bytecode, much like java to the jvm, and doing
+this has made Gleam
+a highly scalable language with good library support out the box.
+
+https://gleam.run/
+
+Zippy should take from the functional elements of Gleam, as they keep programs
+safer, however Zippy
+should not remove all procedural elements, as for loops are very helpful
+.NH 4
+Haskell
+.LP
+Haskell is another modern functional language known for being very complicated,
+however incredibly
+powerful. Its syntax feels very mathematical, and incredibly terse.
+
+https://www.haskell.org/
+
+Perhaps Zippy could learn from Haskell, as it provides functional and
+procedural elements, making it
+a well rounded language
+.NH 4
+Hare
+.LP
+Hare was designed to be a 100 year language, and thus stability is its main
+goal, it is not set to
+have a syntax change any time soon, and it has strong emphasis on memory
+safety. It fits into the
+same part of the tech stack as C, and thus it can be used for some very low
+level work.
+
+https://harelang.org/
+
+I think Zippy should have a strong emphasis on stability, much like Hare,
+to many times have I segfaulted due to a
+tiny mistake. Zippy should also look to Hare's small size, you can buy a
+copy of Hare on a
+
+.B "SINGLE 3 1/2'' FLOLPY"
+
+.LP
+This is something I too should try to achieve.
+
+.NH 3
+What should be taken away from these languages?
+.LP
+I was already leaning towards functional programming when I started this
+project however now I
+believe it's the only option for producing safe applications. Zippy will be
+a functional language
+with a strong emphasis on recursion.
+
+I also believe that I should take size of the interpreter into account,
+as this is important for
+keeping the project manageable and consistent.
+
+And finally I think that syntax should be inspired by Lisp, although Lisp
+itself can be a messy
+language, with the right changes I am confident that I can make a attractive
+language for the 21st
+century.
+
+.NH 2
+Clients
+.LP
+In a project of this nature, the Client is every programmer alive; which is
+a pretty large scope.
+To narrow this down as much as possible, I will interview a small handful
+of people throughout the
+project, of different skill levels.
+
+.NH 3
+Client 1, Amy C
+.LP
+My first client is a friend of mine, Amy C, she is a confident programmer
+who has completed many
+complicated projects. I am choosing her as a client as she can give me
+technical feed back on my
+project and its function/utility.
+.NH 3
+Client 2, Rayn M
+.LP
+Another friend of mine, Rayn M, is a technical computer user, however he
+does not know how to
+program at a high level. He will be a good client as he can show me how my
+language looks to
+some one who doesn't understand the inside workings, helping me design the
+structure of the code.
+.NH 3
+Client 3, a normie
+.LP
+some stuff about how the normie finds the completed project.
+.NH 3
+Client 4, myself
+.LP
+I've wanted to take out a project like this for a long long time, and this
+is the perfect
+opportunity to do so, I will be assessing myself along the way of this,
+building the project to my
+personal specification.
+
+.NH 2
+Questionnaires
+.LP
+It is important to get feedback from end users, so I will take multiple
+questionnaires throughout
+the project. I will then use them to slightly edit the requirements of my
+project this should make
+the final outcome more helpful and what people want.
+
+In the section bellow you will find questionnaires from the analyses stage
+of my project.
+.NH 3
+Questionnaire 1 for Amy C
+
+.BI "[30th April 2024]"
+.BI "answered by Amy, see pull request she left"
+.NH 4
+What do you find the most important in a language? (eg: speed, readability)
+.LP
+Speed, readability, debugging ease and disk space efficiency.
+.NH 4
+What tools are important for a language to have? (eg: pkg-manager, IDE
+integration)
+.LP
+IDE integration (things like tab complete and debugging tools), a package
+manager, and the ability
+to interact with the user through the command line easily.
+.NH 4
+What features do you like from other languages (eg: C's advanced memory
+management, haskell's terse
+syntax)
+.LP
+The ability to pass the memory reference of an object or function and a
+collection of built-in or
+standard functions like "print", "split", or "sort".
+.NH 4
+What do you want to program in this language (eg: websites, low level systems)
+.LP
+Lightweight command line tools and web back ends.
+.NH 4
+Do you intend to use graphics in the programs you write?
+.LP
+No.
+.NH 4
+Would you prefer a language that focuses on ease of use, or power of the code?
+.LP
+I like a good balance between the two.
+.NH 4
+What were your last 3 projects? (could they have been written in Zippy?)
+.LP
+A website, a small command-line tool and a midi keyboard (program runs on
+a Raspberry Pi Pico).
+.NH 4
+How many languages would you use on a single project? (could Zippy be used
+in your codebase?)
+.LP
+I try to use as little languages in a project as possible, so likely not in
+an existing project.
+.NH 4
+Do you care for low level control, or would you prefer high level abstractions?
+.LP
+I think low-level control is very important, but high-level abstractions
+are convenient, so a good
+balance between the two is best.
+.NH 4
+Would you be happy to develop libraries for things that aren't already
+implemented
+(eg: an SQL library)
+.LP
+Potentially if it is simple enough to implement new things.
+
+.NH 3
+Notes from questionnaire 1
+.LP
+Some of the key things that I'm taking away from this first questionnaire,
+are my client/users
+initial needs and use cases. I think it's clear my language can be of
+assistance to my client, Zippy
+will be a good language for web back ends and small command line tools,
+which my client expressed
+interested in.
+
+I find the fact my client is worried by executable size interesting, however
+I doubt it will be an
+issue; a ballooning code-base is unlikely as only one person is writing
+the project.
+
+I am also taking on the fact that my client wants good command line tools,
+so a pkg-manager and
+bundler should be a priority, perhaps they could be written in Zippy after
+the interpreter is done.
+
+.NH 2
+The first elements of the project
+.LP
+At this stage I can say that I'm confident in my project and its scope. I
+have a goal in mind for
+it.
+
+.B "The key things to take away from this section are:"
+
+.B ----
+Make a high level language with a useable set of features, to replace C in
+many situations.
+
+.B ----
+Keep the language readable and easy, with powerful tools available.
+
+.B ----
+Ensure the language is well supported with tools like a pkg-manager.
+
+.NH 2
+Moddeling
+.LP
+In larger projects, when a programmer needs a data structure that the language
+they are writing in
+doesn't provide, they will need to make their own.
+
+Bellow are a few examples of these data structures that C doesn't already
+provide.
+.NH 3
+Linked lists
+.LP
+this is an alternative implementation of a list, where you store some data,
+and the memory address
+to the next node. Then you can move through the list by reading the data
+then reading the data of
+the next node, and then repeating until the 'next' part of the node is empty.
+
+A diagram showing this can be seen here:
+
+.PSPIC linkedlist.ps
+
+.LP
+In C this is easy to implement as you can find a memory address very easily
+with '&' to find where
+a bit of data is stored. I will need to use a 'struct', which is a bit like
+a class in C (however
+you can't attach a function to it). A simple implementation looks like this:
+
+typedef struct ll {
+ void *data; // the data of the node
+ ll *next; // the next node
+
+} ll;
+
+.LP
+The pro's of a linked list are the fact that they can have data appended to
+the start or end easily
+by changing the root node, or the next node.
+
+Linked lists have a few downsides, for example you can't move through them
+backwards, and unless you
+store it on its own, you cant find the length of it in a fast way.
+
+In my project I would like to use linked list in the AST (see later sections
+for info), and to store
+lists in the language.
+.NH 3
+Dictionaries
+.LP
+A dictionary is a simple data structure that just stores, a bit of data,
+and a number or string to
+identify it.
+A dictionary like a linked list can be implemented with a struct in c like so:
+
+typedef struct dict {
+ void *data;
+ int id;
+
+} dict;
+
+.LP
+In my project I think I could use a linked list represent a Zippy variable
+and an ID that i can use
+to identify it, this could make execution faster as i can compare ID's
+rather than string values
+
+.NH 2
+Prototyping hard features
+.NH 3
+Abstract Syntax Trees (AST) theory
+.LP
+In a programming language many abstract data types will be used to allow
+the code to execute,
+however I think the hardest part of this is an abstract syntax tree. This
+is a data structure that
+holds the code in an ordered form that can be analysed and executed in a
+simple way. It is a tree
+structure, with the top node being a root and all lower nodes being things
+needed to calculate the
+root. It can be used not only for code but also for mathematical expressions. I
+think the easiest
+way to show it is via a mathematical example
+
+Take the follow expression for example:
+
+.BX "(1 + (10 * (3 - (2 * 4))))"
+
+We know that this is equal to -49
+
+However for a computer this is far harder to understand. This is because it
+has no understanding of
+order of operation
+
+To solve this we use an AST (abstract syntax tree)
+
+When you solve that expression you know to start with (2 * 4), then 3 -
+the answer to that and so on
+
+We can represent the steps as a tree like so:
+
+.PSPIC ast.ps
+
+.I "[Evalutates to 2 * (2 + 2)]"
+
+As you can see, you need to evaluate the expression in the most brackets
+first, then the next, and
+so on, working you way up
+
+You can evaluate code in a similar way, treating each operation (such as +-*/)
+as functions, doing
+the most deeply nested function first, then working up. Each expression can
+be represented in this
+tree, then to show a whole program you can create a list of trees
+
+.NH 3
+Implementing AST's
+.LP
+As a prototype i will make a program that can take mathematical expressions
+and evaluate them, and
+allowing for functions (in the form f(x)).
+It will do this via AST's
+
+This prototype takes 173 lines of code, it takes a string as a cmd line
+argument then converts it
+into an abstract syntax tree, and finally it executes it. This is just a
+simple prototype and thus
+it is small in scope. It can only do simple operators (+-*/) and requires
+literal values to be
+surrounded by [] so it knows its not another expression to evaluate.
+
+https://github.com/standenboy/school/tree/master/comp/lucas-standen-NEA/code/proto/ast
+
+.PSPIC astg.ps
+
+.LP
+Above is the code for the AST, it stores an operation (which is just an
+integer), and it stores
+a real left and real right value, along side two other nodes. The real values
+are integers, this
+would be the 2 numbers in reference in the expression. The 2 nodes are a
+recursive data structure,
+much like putting an object of a class inside the definition of that class
+itself. They are used to
+store values that may still be expressions, for example (+ [1] (+ [1] [1]))
+the second part of this
+expression would be in the "right" variable. When code is executed I can
+check if "left", or "right"
+are null and if they are i know that i am at the lowest expression that is
+only literal values.
+Then I can execute that node and work my way up the tree.
+
+
+The exec function will execute the operation, unless there is a deeper node,
+if there is a deeper
+node, then it executes it, and places the result in the right or left spot
+respectively.
+
+Expressions are taken as input with the following code, and converted into
+the AST:
+
+https://github.com/standenboy/school/tree/master/comp/lucas-standen-NEA/code/proto/ast
+
+.PSPIC ast.c.ps
+
+Here is an example input and output:
+
+ ./ast "(+ (- [3] [1]) (- [3] [1]))"
+
+.BX 4
+
+Note the [] used to tell the program where the literal values are.
+
+Overall this was a relatively successful prototype, however it isn't fully
+functional as a language
+it has fit the design.
+
+The rest of the code is the process of converting the string input to literal
+values and inserting
+them into the AST
+
+.NH 3
+Feedback
+.LP
+From my first Client (Amy C), she said that putting the numbers inside square
+brackets was
+inconvenient and annoying and it would be better if the numbers were separated
+by spaces instead of
+separate square bracket surrounded literals.
+
+As this is a prototype I won't fix this issue, however in the actual language
+this is a needed
+feature that I will be implementing.
+
+.NH 3
+Mixing linked lists and AST's
+.LP
+Mixing these 2 data structures together you can repressent an entire program. A
+linked list of
+AST's is how Zippy will repressent all code the user writes
+
+Here is an example of this:
+
+.PSPIC AST+LL.ps
+
+.LP
+In this example the linked list is represented by the numbers seen at the top,
+and the AST's are the
+tree's moving down.
+
+As you can see when a value is referenced that is from a different AST the
+tree will link to another
+one. This will work the same for function calls, however instead of linking
+to value definitions it
+will link to function definitions.
+
+.NH 2
+Objectives
+.NH 3
+An interpreter for the Zippy language
+.NH 4
+Linked list of AST's
+.LP
+All of a loaded program should be represented as a linked list of individual
+AST's, The developer
+should be able to access the AST for easy hacking. Functions can be represented
+as a pointer to
+another part of the list.
+.NH 4
+A lisp like syntax
+.LP
+This is to ensure the language can be parsed quickly, and is easy to write.
+.NH 4
+Functional language
+.LP
+This language should lean into the functional programming paradigm, taking
+inspiration from other
+functional languages such as lisp, and gleam.
+.NH 5
+Recursion
+.LP
+Zippy must support recursive algorithms being implemented into it, this will
+make the AST, have
+nodes linking back to parent nodes in a linked list.
+.NH 5
+Higher order functions
+.LP
+Zippy must support the usage of higher order functions, this will mean the
+AST needs to have an
+unlimited depth as otherwise the limit would be quickly reached, it can't
+be hard-coded, it must be
+dynamic.
+.NH 4
+Performance
+.LP
+The interpreter must be fast and memory efficient, the language is designed
+to work as an
+alternative to C, one of the fastest languages of all time, the interpreter
+must be fast, however
+memory footprint is not as much of a requirement.
+.NH 4
+Safe
+.LP
+Code that the user writes must be safe, and not prone to errors. This can
+be handeled via the strong
+syntax checker and type safety.
+
+.NH 3
+Standard library for Zippy
+.NH 4
+io
+.LP
+The language must have a simple to use I/O library to make outputs easy.
+.NH 4
+string
+.LP
+The language should have a sting library that provides a string type, and
+many complex algorithms
+that can be applied to them (concatenation, insertion, appending, splitting,
+stripping).
+.NH 4
+sorts
+.LP
+The language should have a sorting library that provides algorithms used
+for sorting (like merge
+sort).
+.NH 4
+graphs
+.LP
+the language must have a graph library, that allows for easy creation and
+working with graphs, it
+should provide many algorithms to help traverse these graphs
+
+.NH 3
+Tooling for the Zippy language
+.NH 4
+zpypkg
+.LP
+Zippy must provide a package manager, that allows code to be shared between
+multiple users, easily.
+It should sync projects via git and allow them to be stored on any git host
+the user likes.
+.NH 4
+Syntax checker
+.LP
+Zippy shouldn't have a built in syntax checker, instead it should be something
+that can be run
+independently of the interpreter, this means that a lot of the checking that
+interpreted languages
+do, can be done once by the developer, before shipping the app, as opposed
+to every time the program
+is run, which brings down performance.
+.NH 3
+Integration with C, via a C API
+.NH 4
+C API
+.LP
+You should be able to execute a string of Zippy code in C using a library
+that is linked with
+interpreter. This could allow Zippy to be used as a configuration language
+like Lua.
+
+.NH 2
+Desirable features
+.LP
+If time allows I'd like to add some of the following features to flesh out
+the language:
+.NH 3
+Raylib support
+.LP
+Raylib is a powerful game engine for C, however it has been ported to most
+languages under the
+sun due to how simple it is. If I have time, porting Raylib to Zippy would
+make the language
+far more useable, as it can be use for graphics programming.
+
+https://www.Raylib.com/
+
+.NH 3
+Vim integration.
+.LP
+Zippy should have integration with the Vim editor for syntax highlighting,
+this can be done via
+generating a linked list of AST's then colouring function calls a specific
+colour, and variables
+another, etc, etc.
+.NH 3
+LSP
+.LP
+A LSP (language server protocol), is used in code IDE's to auto complete
+code for you, I'd
+like one for Zippy. Although I am unsure as to how to tackle this. I believe
+a program called
+treesitter can be helpful for this.
+.NH 3
+Networking sockets
+.LP
+If possible I'd also like to provide bindings for unix network sockets,
+however this would be
+very difficult, as I would need to allow Zippy stucts to be directly converted
+to C stucts,
+when executing ELF symbols (Parts of an execuable file).
+
+.NH 1
+Design
+.NH 2
+Language specification
+.LP
+Like any other programming language Zippy needs to have a defined syntax,
+as mentioned in the
+objectives section of Analysis, I want the language to follow a lisp like
+syntax.
+
+I also believe higher order functions should be taken as standard and many
+core functions will use
+them.
+
+.NH 3
+Data types
+.NH 4
+Basic types
+.LP
+i32 - signed integer of size 32 bits
+
+u32 - unsigned integer of size 32 bits
+
+i64 - signed integer of size 64 bits
+
+u64 - unsigned integer of size 64 bits
+
+char - single ascii code
+
+float - standard C float
+
+.NH 4
+Advanced types
+.LP
+function - a function that can be used
+
+generic - should be avoided, removes checks for data types when inputting
+values to functions
+will cause many runtime errors, however when absolutely needed it is useful.
+
+.NH 4
+Arrays
+.LP
+Arrays can be show like so:
+
+x:type[]
+
+With x being the variable name, type being the type of variable, and []
+showing its an array
+
+All arrays are dynamic, represented by a linked list on the back end.
+.NH 5
+Strings
+.LP
+Strings, like in C are arrays of chars
+
+.NH 3
+Built in functions
+.NH 4
+defun
+.LP
+(defun a:type b:type returntype
+ ...
+ ...
+
+)
+
+Returns a function that take A and B as an argument (fixed types), and
+returns a value of
+returntype.
+
+.NH 4
+let
+.LP
+(let x:type value)
+
+Creates constant x of type type to value.
+
+.NH 4
+set
+.LP
+(set x:type value)
+
+Creates/recreates the variable value of x to value.
+
+.NH 4
+if/elif/else
+.LP
+(if condition function)
+
+(elif condition function)
+
+(else function)
+
+
+Executes the function provided if the condition is true.
+
+Elif works the same, except only if the previous if statement is false.
+
+Else executes only if all previous statements were false.
+
+.NH 4
+for
+.LP
+(for i (condition) function)
+
+Runs the function while the condition is true, and increments i every time
+the function
+is called.
+
+.NH 4
+while
+.LP
+(while condition function)
+
+Runs the function if the condition is true, keeps running until it is false.
+
+.NH 4
+symbol
+.LP
+(symbol a:type b:type c:type returntype name:char[] elf:char[])
+
+Returns a function that takes arguments A, B, C (of fixed types), the name
+of the function,
+and the file path of the elf.
+.NH 5
+
+.NH 4
+Arithmetic operations
+.LP
+Simple operations
+
+(+ a b) returns a + b
+
+(- a b) returns a - b
+
+(* a b) returns a * b
+
+(/ a b) returns a / b
+
+.NH 4
+Comparison
+.LP
+All return true or false
+
+(= a b) returns if a = b
+
+(!= a b) returns if a != b
+
+(> a b) returns if a > b
+
+(< a b) returns if a < b
+
+(=> a b) returns if a => b
+
+(=< a b) returns if a =< b
+
+.NH 4
+cast
+.LP
+(cast a:generic type:char[])
+
+returns a but cast to data type type, which is a string.
+
+.NH 4
+typeof
+.LP
+(typeof a:generic)
+
+returns in a string the type that variable A is.
+
+.NH 4
+terminate
+.LP
+(terminate error:error)
+
+Kills the program at the current point, frees all related memory, prints
+error info stored in error.
+
+.NH 4
+return
+.LP
+(return a:type)
+
+Must be used in defun, returns "a" from the function, "a" must be of the
+functions return type.
+
+.NH 3
+List of keywords
+.LP
+defun
+
+for
+
+while
+
+if
+
+elif
+
+else
+
+exit
+
+return
+
+symbol
+
+set
+
+let
+
+.NH 2
+Memory management
+.LP
+Memory will be allocated when a variable is initialized, and freed when the
+program stops.
+Although this isn't the fastest method, it is simple and has less runtime
+overhead.
+
+.NH 2
+Questionnaire 2 for Rayn M
+.NH 3
+How do you find this layout of the language?
+.LP
+.I "(5-6 points)"
+- I like the immutable nature of the language
+- I like the simplicity
+- I like the low level performance this will have
+- I dislike the word terminate
+- I like the procedural approach, with the function robustness
+- I dislike the brackets!
+.NH 3
+Response
+.LP
+Although he does dislike some of my features I believe them to be core parts
+of the language so
+I will keep them. I will also keep his points in mind though, I don't want
+to discourage learning
+the language due to its abstract syntax.
+
+However as per his request I will change the terminate keyword to the more
+normal exit.
+
+An updated keyword list is as flows:
+
+defun
+
+for
+
+while
+
+if
+
+elif
+
+else
+
+exit
+
+return
+
+symbol
+
+set
+
+let
+
+.NH 2
+What language do you use to make a programming language
+.LP
+As mentioned before Zippy will be written in C, with some parts being written
+in Zippy itself.
+I will try and keep most dependencies/libraries to a minimal to make the
+project easier to manage.
+
+.NH 3
+What is C?
+.LP
+C was made by Dennis Ritchie, in 1972 at AT&T's bell labs. It was designed
+to make programming low
+level systems far easier than it had been before. It was used to create the
+unix operating system
+which would go on to inspire most modern operating systems in some way. (macos
+still has code from
+the original release of C+unix).
+
+The language quickly caught on outside of bell labs after more available
+releases of unix arrived
+such as bsd 4.4, sun os and GNU. It was found to be able to do all the things
+that you could do in
+ASM however with far less a headache.
+
+.NH 3
+Why is C?
+.LP
+As mentioned C can do anything that ASM can do, meaning it is lightning fast
+and can take advantage
+of direct memory access. This allows you to make very fast lightweight
+executables that can rival
+the performance of handwritten ASM (often beating it if you enable compiler
+optimisations). It is
+this that makes C the perfect language for any and all programming languages,
+where speed is key,
+and allfeatures need to be available are present.
+
+.NH 3
+How is C?
+.LP
+C is compiled to ASM, the main compilers available are clang, gcc and MSVC,
+I will be using gcc
+as it is generally standard in linux environments.
+
+Many build systems are available for C, the main ones being cmake and gnu
+make. Both of them have
+the goal of putting the compiling process in one command. Cmake is cross
+platform (sorta windows
+doesn't work well but it does work).
+
+.NH 3
+Libraries
+.LP
+The libraries I will use are the following:
+
+C stdlib
+
+C unistd
+
+C errno
+
+Unix device files
+
+Zippy strings
+
+Zippy graphs
+
+Zippy sorts
+
+Addition libraries (may not be implemented):
+
+Raylib
+
+C sockets + Zippy sockets
+
+.NH 3
+Modularization
+.LP
+To make the project more manageable I will split it into many C files,
+this is to keep it from
+becoming impossible to edit code.
+
+The file layout looks as follows:
+
+PLACE HERE
+
+As you can see this is split up over around 40 files and 16 folders, each
+file should not go over
+~500 lines of code. This is to keep everything as easy to manage as possible.
+
+This level of modularization in needed for the development of Zippy as
+without it, files will become
+a mess that can't be worked with.
+
+All .c files will be compiled into .o files, then the .o files can be linked
+with the final zpy.c
+to generate the final executable.
+
+
+.NH 4
+Build system
+.LP
+The entire project is being build with GNU make files, each folder that
+builds something will have
+its own makefile. This will mean the entire project can be compiled with a
+single make in the root
+folder of the project.
+
+Example of make:
+
+make -j2
+
+This will build all files specified by 'Makefile' with 2 threads.
+
+The project should be build with gcc, and ld. It should be build with the
+-O3 build flag to ensure
+the program runs as fast as possible. -O3 forces the compiler to build with
+optimizations.
+
+When the project is finished, I will try compiling with clang and tcc,
+to compare performance.
+
+.NH 2
+Time table
+.LP
+The first step is to tackle the interpreter, so the zpy.c file needs to be
+finished. The tokenizer,
+execution, and libs folders need to be finished, after this point you should
+be able to execute
+Zippy code however not syntax check it or get error handling.
+
+The next step is zpycheck, the syntax and error handler, this should be ran
+before code is shipped
+to the user. It can reuse a lot of code from the tokenizer and execution steps.
+
+Finally I need to make zpypkg, this should be easy as most of it can be
+written in Zippy, and a few
+bits can be written in bash. It should be a good test to how Zippy can
+be written.
+
+If time allows it is at this point that I will write a Raylib library and
+a unix/C sockets library.
+
+.NH 2
+Flow through the system
+.LP
+The alogrithum to run code is quite complex however it can be boiled down
+to a few simple steps:
+
+.B "read the text file (strip line breaks and tabs)"
+.LP
+.B "create an empty linked list"
+.LP
+.B "get the first expression from the text file (with be encapsulated with
+"()""
+.B "get the function call and its args into a token"
+.LP
+.B "if the arguments of the function are there own function call, then
+convert them into a token"
+.LP
+.B "set that token as the argument in the first token"
+.LP
+.B "append the root token to the linked list"
+.LP
+.B "repeat until the text file string is empty"
+.LP
+.B "allocate memory for the program and prepare the exection step"
+.LP
+.B "at the start of the linked list traverse to the bottem of the tree
+(made of tokens)"
+.LP
+.B "execute the lowest token"
+.LP
+.B "repeat until all tokens including the root have been executed"
+.LP
+.B "move to the next node of the linked list"
+.LP
+.B "repeat until the linked list is empty"
+
+.LP
+Within each of these steps is many smaller steps. The hardest part will be
+making the tokens, as
+this requires alot of string manipultation. The execution will be a recursive
+alogrithum. All trees
+will be represented via structs (see section on AST's).
+
+PUT SOME FLOW CHARTS HERE
+
+.NH 1
+Technical Solution
+.NH 1
+Testing
+.NH 1
+Evaluation
+.AE
diff --git a/comp/lucas-standen-NEA/writeup2/writeup.aux b/comp/lucas-standen-NEA/writeup2/writeup.aux
index 87403dd..df324dc 100644
--- a/comp/lucas-standen-NEA/writeup2/writeup.aux
+++ b/comp/lucas-standen-NEA/writeup2/writeup.aux
@@ -9,32 +9,37 @@
\@writefile{toc}{\contentsline {section}{\numberline {2}Analysis}{3}{section.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}The current problem}{3}{subsection.2.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}A solution}{3}{subsection.2.2}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}What is a programming language}{3}{subsection.2.3}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.1}A very simple explanation}{3}{subsubsection.2.3.1}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}What is a programming language}{4}{subsection.2.3}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.1}A very simple explanation}{4}{subsubsection.2.3.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.2}Why are there so many}{4}{subsubsection.2.3.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Researching and getting a scope of the project}{4}{subsection.2.4}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.4.1}Examples of older similar projects}{4}{subsubsection.2.4.1}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.4.2}Examples of newer similar projects}{4}{subsubsection.2.4.2}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.4.2}Examples of newer similar projects}{5}{subsubsection.2.4.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.4.3}What should be taken away from these languages}{5}{subsubsection.2.4.3}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {2.5}Clients}{5}{subsection.2.5}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.1}Client 1: Amy C}{5}{subsubsection.2.5.1}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.2}Client 2: Rayn M}{5}{subsubsection.2.5.2}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {2.5}Clients}{6}{subsection.2.5}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.1}Client 1: Amy C}{6}{subsubsection.2.5.1}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.2}Client 2: Rayn M}{6}{subsubsection.2.5.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.3}Client 3: Myself}{6}{subsubsection.2.5.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.6}Questionnaires}{6}{subsection.2.6}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.6.1}Amy C, initial ideas}{6}{subsubsection.2.6.1}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.6.2}Notes from questionnare 1}{6}{subsubsection.2.6.2}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.6.2}Notes from questionnare 1}{7}{subsubsection.2.6.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.7}The first elements of the project}{7}{subsection.2.7}\protected@file@percent }
-\@writefile{toc}{\contentsline {section}{\numberline {3}Modelling}{7}{section.3}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Linked lists}{7}{subsection.3.1}\protected@file@percent }
-\@writefile{lol}{\contentsline {lstlisting}{\numberline {1}Linked list example}{7}{lstlisting.1}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Dictionaries}{8}{subsection.3.2}\protected@file@percent }
-\@writefile{lol}{\contentsline {lstlisting}{\numberline {2}Dictionary example}{8}{lstlisting.2}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Prototyping harder features}{8}{subsection.3.3}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.1}Abstract syntax trees (AST's) theory}{8}{subsubsection.3.3.1}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.2}Abstract syntax trees (AST's) practical}{9}{subsubsection.3.3.2}\protected@file@percent }
-\@writefile{lol}{\contentsline {lstlisting}{../code/proto/AST/ast.c}{9}{lstlisting.-1}\protected@file@percent }
-\@writefile{lol}{\contentsline {lstlisting}{../code/proto/AST/astg.c}{12}{lstlisting.-2}\protected@file@percent }
-\@writefile{lol}{\contentsline {lstlisting}{../code/proto/AST/astg.h}{12}{lstlisting.-3}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Feedback}{13}{subsection.3.4}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {3.5}Mixing linked lists and AST's}{14}{subsection.3.5}\protected@file@percent }
-\gdef \@abspage@last{14}
+\@writefile{toc}{\contentsline {section}{\numberline {3}Modelling}{8}{section.3}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Linked lists}{8}{subsection.3.1}\protected@file@percent }
+\@writefile{lol}{\contentsline {lstlisting}{\numberline {1}Linked list example}{8}{lstlisting.1}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Dictionaries}{9}{subsection.3.2}\protected@file@percent }
+\@writefile{lol}{\contentsline {lstlisting}{\numberline {2}Dictionary example}{9}{lstlisting.2}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Prototyping harder features}{9}{subsection.3.3}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.1}Abstract syntax trees (AST's) theory}{9}{subsubsection.3.3.1}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.2}Abstract syntax trees (AST's) practical}{10}{subsubsection.3.3.2}\protected@file@percent }
+\@writefile{lol}{\contentsline {lstlisting}{../code/proto/AST/ast.c}{10}{lstlisting.-1}\protected@file@percent }
+\@writefile{lol}{\contentsline {lstlisting}{../code/proto/AST/astg.c}{13}{lstlisting.-2}\protected@file@percent }
+\@writefile{lol}{\contentsline {lstlisting}{../code/proto/AST/astg.h}{14}{lstlisting.-3}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Feedback}{15}{subsection.3.4}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {3.5}Mixing linked lists and AST's}{15}{subsection.3.5}\protected@file@percent }
+\@writefile{toc}{\contentsline {section}{\numberline {4}Objectives}{15}{section.4}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Core objectives}{15}{subsection.4.1}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Extra objectives}{16}{subsection.4.2}\protected@file@percent }
+\@writefile{toc}{\contentsline {section}{\numberline {5}Design}{16}{section.5}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Language specification}{16}{subsection.5.1}\protected@file@percent }
+\gdef \@abspage@last{16}
diff --git a/comp/lucas-standen-NEA/writeup2/writeup.fdb_latexmk b/comp/lucas-standen-NEA/writeup2/writeup.fdb_latexmk
index 52f97a4..b5daa67 100644
--- a/comp/lucas-standen-NEA/writeup2/writeup.fdb_latexmk
+++ b/comp/lucas-standen-NEA/writeup2/writeup.fdb_latexmk
@@ -1,5 +1,5 @@
# Fdb version 4
-["pdflatex"] 1728905490.10155 "writeup.tex" "writeup.pdf" "writeup" 1728905492.58947 0
+["pdflatex"] 1729593294.73764 "writeup.tex" "writeup.pdf" "writeup" 1729593297.07819 0
"../code/proto/AST/ast.c" 1726310530.07745 2961 c47f93a2515bbdc975ff63648a7cdd5e ""
"../code/proto/AST/astg.c" 1726310530.07745 952 02073ee7971b5c86c469ca9979e7558e ""
"../code/proto/AST/astg.h" 1726310530.07745 275 d81b6b122dc745e84025255cf68ff265 ""
@@ -186,10 +186,10 @@
"/usr/share/texmf-dist/web2c/texmf.cnf" 1727349926 41588 b43d3e860a4f94167ee1e725ff526a72 ""
"/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1727772120.4956 5312047 b07fcd2a9090df96fc745b92a3db793b ""
"/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1727771987 7112995 7933768d5ebcb328850d23523e531d79 ""
- "writeup.aux" 1728905492.33432 4432 710fbc040802dbc9eb40406952fd6ed2 "pdflatex"
- "writeup.out" 1728905492.33765 4997 e70a9c8f057c1547035bac5d30a3014a "pdflatex"
- "writeup.tex" 1728905489.59434 20681 18e84f17b265407f364fdfa5882ac984 ""
- "writeup.toc" 1728905492.33765 2529 a2fe1657a58b702f5bfb72c069988614 "pdflatex"
+ "writeup.aux" 1729593296.82823 5023 b94e2bad255ab6fc65527a147ae1fd64 "pdflatex"
+ "writeup.out" 1729593296.83157 5613 7c3ad93782220212e41c0210b94b7a3a "pdflatex"
+ "writeup.tex" 1729593291.60157 21720 39514597b13b8cf3e51451b7a897ebc0 ""
+ "writeup.toc" 1729593296.83157 2914 8c622606e53239bead78f7db81bd25ed "pdflatex"
(generated)
"writeup.aux"
"writeup.log"
diff --git a/comp/lucas-standen-NEA/writeup2/writeup.fls b/comp/lucas-standen-NEA/writeup2/writeup.fls
index a358e98..f862a35 100644
--- a/comp/lucas-standen-NEA/writeup2/writeup.fls
+++ b/comp/lucas-standen-NEA/writeup2/writeup.fls
@@ -324,6 +324,7 @@ INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmtt12.tfm
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmbxti10.tfm
INPUT /usr/share/texmf-dist/fonts/tfm/jknappen/ec/tcrm1200.tfm
+INPUT /usr/share/texmf-dist/fonts/enc/dvips/cm-super/cm-super-ts1.enc
INPUT /usr/share/texmf-dist/tex/latex/listings/lstlang1.sty
INPUT /usr/share/texmf-dist/tex/latex/listings/lstlang1.sty
INPUT /usr/share/texmf-dist/tex/latex/listings/lstlang1.sty
@@ -334,7 +335,6 @@ INPUT /usr/share/texmf-dist/tex/latex/listings/lstmisc.sty
INPUT /usr/share/texmf-dist/tex/latex/listings/lstmisc.sty
INPUT /usr/share/texmf-dist/tex/latex/listings/lstmisc.sty
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmtt10.tfm
-INPUT /usr/share/texmf-dist/fonts/enc/dvips/cm-super/cm-super-ts1.enc
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmr17.tfm
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm
diff --git a/comp/lucas-standen-NEA/writeup2/writeup.log b/comp/lucas-standen-NEA/writeup2/writeup.log
index c519293..7d63240 100644
--- a/comp/lucas-standen-NEA/writeup2/writeup.log
+++ b/comp/lucas-standen-NEA/writeup2/writeup.log
@@ -1,4 +1,4 @@
-This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/Arch Linux) (preloaded format=pdflatex 2024.10.1) 14 OCT 2024 12:31
+This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/Arch Linux) (preloaded format=pdflatex 2024.10.1) 22 OCT 2024 11:34
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
@@ -586,24 +586,24 @@ Package geometry Warning: Over-specification in `h'-direction.
(./writeup.aux)
\openout1 = `writeup.aux'.
-LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 55.
-LaTeX Font Info: ... okay on input line 55.
-LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 55.
-LaTeX Font Info: ... okay on input line 55.
-LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 55.
-LaTeX Font Info: ... okay on input line 55.
-LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 55.
-LaTeX Font Info: ... okay on input line 55.
-LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 55.
-LaTeX Font Info: ... okay on input line 55.
-LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 55.
-LaTeX Font Info: ... okay on input line 55.
-LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 55.
-LaTeX Font Info: ... okay on input line 55.
-LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 55.
-LaTeX Font Info: ... okay on input line 55.
-LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 55.
-LaTeX Font Info: ... okay on input line 55.
+LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 56.
+LaTeX Font Info: ... okay on input line 56.
+LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 56.
+LaTeX Font Info: ... okay on input line 56.
+LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 56.
+LaTeX Font Info: ... okay on input line 56.
+LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 56.
+LaTeX Font Info: ... okay on input line 56.
+LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 56.
+LaTeX Font Info: ... okay on input line 56.
+LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 56.
+LaTeX Font Info: ... okay on input line 56.
+LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 56.
+LaTeX Font Info: ... okay on input line 56.
+LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 56.
+LaTeX Font Info: ... okay on input line 56.
+LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 56.
+LaTeX Font Info: ... okay on input line 56.
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
@@ -639,7 +639,7 @@ LaTeX Font Info: ... okay on input line 55.
* \@reversemarginfalse
* (1in=72.27pt=25.4mm, 1cm=28.453pt)
-Package hyperref Info: Link coloring OFF on input line 55.
+Package hyperref Info: Link coloring OFF on input line 56.
(./writeup.out) (./writeup.out)
\@outlinefile=\write5
\openout5 = `writeup.out'.
@@ -665,9 +665,9 @@ Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 48
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
))
LaTeX Font Info: External font `cmex10' loaded for size
-(Font) <14.4> on input line 57.
+(Font) <14.4> on input line 58.
LaTeX Font Info: External font `cmex10' loaded for size
-(Font) <7> on input line 57.
+(Font) <7> on input line 58.
[1
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./writeup.toc
@@ -682,46 +682,36 @@ LaTeX Font Info: External font `cmex10' loaded for size
\openout6 = `writeup.toc'.
[2] [3] [4] [5]
-Overfull \hbox (8.48462pt too wide) in paragraph at lines 248--249
+Overfull \hbox (8.48462pt too wide) in paragraph at lines 250--251
[]\OT1/cmr/m/n/12 Speed, read-abil-ity, de-bug-ging ease
[]
-Overfull \hbox (2.0985pt too wide) in paragraph at lines 250--253
+Overfull \hbox (2.0985pt too wide) in paragraph at lines 252--255
[]\OT1/cmr/m/n/12 IDE in-te-gra-tion (things like tab com-
[]
-
-Overfull \hbox (0.31256pt too wide) in paragraph at lines 263--264
+[6]
+Overfull \hbox (0.31256pt too wide) in paragraph at lines 265--266
[]\OT1/cmr/m/n/12 I like a
[]
-Overfull \hbox (2.0225pt too wide) in paragraph at lines 268--271
+Overfull \hbox (2.0225pt too wide) in paragraph at lines 270--273
[]\OT1/cmr/m/n/12 I try to use as lit-tle lan-guages
[]
-Overfull \hbox (17.51675pt too wide) in paragraph at lines 272--275
+Overfull \hbox (17.51675pt too wide) in paragraph at lines 274--277
[]\OT1/cmr/m/n/12 I think
[]
-Overfull \hbox (26.90446pt too wide) in paragraph at lines 276--277
+Overfull \hbox (26.90446pt too wide) in paragraph at lines 278--279
[]
[]
-[6]
-Underfull \hbox (badness 10000) in paragraph at lines 320--325
-
- []
-
-
-Underfull \hbox (badness 10000) in paragraph at lines 326--328
-
- []
-
-(/usr/share/texmf-dist/tex/latex/listings/lstlang1.sty
+[7{/usr/share/texmf-dist/fonts/enc/dvips/cm-super/cm-super-ts1.enc}] (/usr/share/texmf-dist/tex/latex/listings/lstlang1.sty
File: lstlang1.sty 2024/02/21 1.10 listings language file
) (/usr/share/texmf-dist/tex/latex/listings/lstlang1.sty
File: lstlang1.sty 2024/02/21 1.10 listings language file
@@ -729,81 +719,33 @@ File: lstlang1.sty 2024/02/21 1.10 listings language file
File: lstmisc.sty 2024/02/21 1.10 (Carsten Heinz)
)
Package hyperref Info: bookmark level for unknown lstlisting defaults to 0 on input line 357.
- [7{/usr/share/texmf-dist/fonts/enc/dvips/cm-super/cm-super-ts1.enc}]
-Underfull \hbox (badness 10000) in paragraph at lines 398--400
-
- []
-
+ [8]
LaTeX Font Info: External font `cmex10' loaded for size
-(Font) <17.28> on input line 401.
-
-Underfull \hbox (badness 10000) in paragraph at lines 401--403
-
- []
-
-[8] (../code/proto/AST/ast.c [9] [10]) [11]
-Underfull \hbox (badness 10000) in paragraph at lines 461--463
-
- []
-
-(../code/proto/AST/astg.c)
-Underfull \hbox (badness 10000) in paragraph at lines 465--467
-
- []
-
-(../code/proto/AST/astg.h [12])
-Underfull \hbox (badness 10000) in paragraph at lines 469--471
-
- []
-
-
-Underfull \hbox (badness 10000) in paragraph at lines 472--480
-
- []
-
-
-Underfull \hbox (badness 10000) in paragraph at lines 481--485
-
- []
-
-
-Underfull \hbox (badness 10000) in paragraph at lines 486--490
-
- []
-
-
-Underfull \hbox (badness 10000) in paragraph at lines 497--499
-
- []
-
-
-Underfull \hbox (badness 10000) in paragraph at lines 500--503
-
- []
-
+(Font) <17.28> on input line 400.
+ [9] (../code/proto/AST/ast.c [10] [11] [12]) (../code/proto/AST/astg.c) [13] (../code/proto/AST/astg.h)
LaTeX Font Info: Font shape `OT1/cmtt/bx/n' in size <12> not available
-(Font) Font shape `OT1/cmtt/m/n' tried instead on input line 505.
-[13] [14] (./writeup.aux)
+(Font) Font shape `OT1/cmtt/m/n' tried instead on input line 495.
+ [14] [15] [16] (./writeup.aux)
***********
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-02-20>
***********
Package rerunfilecheck Info: File `writeup.out' has not changed.
-(rerunfilecheck) Checksum: E70A9C8F057C1547035BAC5D30A3014A;4997.
+(rerunfilecheck) Checksum: 7C3AD93782220212E41C0210B94B7A3A;5613.
)
Here is how much of TeX's memory you used:
- 33295 strings out of 476076
- 715046 string characters out of 5793775
- 2238187 words of memory out of 5000000
- 54687 multiletter control sequences out of 15000+600000
+ 33307 strings out of 476076
+ 715190 string characters out of 5793775
+ 2239187 words of memory out of 5000000
+ 54692 multiletter control sequences out of 15000+600000
565524 words of font info for 61 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
98i,9n,101p,1606b,2286s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmbxti10.pfb></usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb></usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr6.pfb></usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmti12.pfb></usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb></usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt12.pfb></usr/share/texmf-dist/fonts/type1/public/cm-super/sfrm1200.pfb>
-Output written on writeup.pdf (14 pages, 186326 bytes).
+Output written on writeup.pdf (16 pages, 190164 bytes).
PDF statistics:
- 566 PDF objects out of 1000 (max. 8388607)
- 522 compressed objects within 6 object streams
- 271 named destinations out of 1000 (max. 500000)
- 229 words of extra memory for PDF output out of 10000 (max. 10000000)
+ 600 PDF objects out of 1000 (max. 8388607)
+ 554 compressed objects within 6 object streams
+ 278 named destinations out of 1000 (max. 500000)
+ 269 words of extra memory for PDF output out of 10000 (max. 10000000)
diff --git a/comp/lucas-standen-NEA/writeup2/writeup.out b/comp/lucas-standen-NEA/writeup2/writeup.out
index f14fad4..a805fec 100644
--- a/comp/lucas-standen-NEA/writeup2/writeup.out
+++ b/comp/lucas-standen-NEA/writeup2/writeup.out
@@ -25,3 +25,8 @@
\BOOKMARK [3][-]{subsubsection.3.3.2}{\376\377\000A\000b\000s\000t\000r\000a\000c\000t\000\040\000s\000y\000n\000t\000a\000x\000\040\000t\000r\000e\000e\000s\000\040\000\050\000A\000S\000T\000'\000s\000\051\000\040\000p\000r\000a\000c\000t\000i\000c\000a\000l}{subsection.3.3}% 25
\BOOKMARK [2][-]{subsection.3.4}{\376\377\000F\000e\000e\000d\000b\000a\000c\000k}{section.3}% 26
\BOOKMARK [2][-]{subsection.3.5}{\376\377\000M\000i\000x\000i\000n\000g\000\040\000l\000i\000n\000k\000e\000d\000\040\000l\000i\000s\000t\000s\000\040\000a\000n\000d\000\040\000A\000S\000T\000'\000s}{section.3}% 27
+\BOOKMARK [1][-]{section.4}{\376\377\000O\000b\000j\000e\000c\000t\000i\000v\000e\000s}{}% 28
+\BOOKMARK [2][-]{subsection.4.1}{\376\377\000C\000o\000r\000e\000\040\000o\000b\000j\000e\000c\000t\000i\000v\000e\000s}{section.4}% 29
+\BOOKMARK [2][-]{subsection.4.2}{\376\377\000E\000x\000t\000r\000a\000\040\000o\000b\000j\000e\000c\000t\000i\000v\000e\000s}{section.4}% 30
+\BOOKMARK [1][-]{section.5}{\376\377\000D\000e\000s\000i\000g\000n}{}% 31
+\BOOKMARK [2][-]{subsection.5.1}{\376\377\000L\000a\000n\000g\000u\000a\000g\000e\000\040\000s\000p\000e\000c\000i\000f\000i\000c\000a\000t\000i\000o\000n}{section.5}% 32
diff --git a/comp/lucas-standen-NEA/writeup2/writeup.synctex.gz b/comp/lucas-standen-NEA/writeup2/writeup.synctex.gz
index 90a6a89..da76c36 100644
--- a/comp/lucas-standen-NEA/writeup2/writeup.synctex.gz
+++ b/comp/lucas-standen-NEA/writeup2/writeup.synctex.gz
Binary files differ
diff --git a/comp/lucas-standen-NEA/writeup2/writeup.tex b/comp/lucas-standen-NEA/writeup2/writeup.tex
index 7427570..3eba42e 100644
--- a/comp/lucas-standen-NEA/writeup2/writeup.tex
+++ b/comp/lucas-standen-NEA/writeup2/writeup.tex
@@ -35,6 +35,7 @@
tabsize=8
}
+
\lstset{style=mystyle}
\titleformat{\section}
@@ -58,6 +59,7 @@
\tableofcontents
\newpage
+\setlength{\parskip}{1em}
{\setlength{\parindent}{0cm}
\section{A breif head note and introduction}
@@ -321,10 +323,8 @@ this is an alternative implementation of a list, where you store some data, and
the memory address to the next node. Then you can move through the list by reading
the data then reading the data of the next node, and then repeating until the
'next' part of the node is empty.
-\\
A diagram showing this can be seen here:
-\\
\begin{tikzpicture}
\tikzset{edge from parent/.style={draw,edge from parent path={(\tikzparentnode.south)-- +(0,-8pt)-| (\tikzchildnode)}}}
@@ -396,10 +396,8 @@ be used to show mathematical expressions and function calls, but I thing easiest
show it is via a mathematical example.
Take the follow expression for example:
-\\
{\Large{\(1 + (10 * (3 - (2 * 4)))\)}}
-\\
We know that this is equal to \(-49\)
@@ -459,15 +457,12 @@ expression to evaluate.
\lstinputlisting[language=C++]{../code/proto/AST/ast.c}
\textit{The main loop for the ast code.}
-\\
\lstinputlisting[language=C++]{../code/proto/AST/astg.c}
\textit{The execution loop for the ast code.}
-\\
\lstinputlisting[language=C++]{../code/proto/AST/astg.h}
\textit{The definition of the ast, and function prototypes.}
-\\
Above is the code for the AST, it stores an operation (which is just an integer), and
it stores a real left and real right value, along side two other nodes. The real values
@@ -476,17 +471,14 @@ recursive data structure, much like putting an object of a class inside the defi
itself. They are used to store values that may still be expressions, for example
(+ [1] (+ [1] [1])) the second part of this expression would be in the "right"
variable.
-\\
When code is executed I can check if "left", or "right" are NULL and if
they are I know that I am at the lowest expression that is only literal values.
Then I can execute that node and work my way up the tree.
-\\
The exec function will execute the operation, unless there is a deeper node, if there is
a deeper node, then it executes it, and places the result in the right or left spot
respectively.
-\\
\textbf{Here is an example input and output:}
@@ -495,11 +487,9 @@ respectively.
4
{\small Note the [ ] used to tell the program where the literal values are.}
-\\
Overall this was a relatively successful prototype, however it isn't fully functional
as a language but it has fit the design for a prototype.
-\\
\textbf{The code for the AST can be found here:
\url{https://github.com/standenboy/school/tree/master/comp/lucas-standen-NEA/code/proto/ast}}
@@ -519,5 +509,35 @@ linked list, and in the data element put a AST, then the next node can contain t
This might be a help to zippy as the compiler can convert all code to an AST, then
compile it.
}
+\section{Objectives}
+Zippy must support the following features, it needs them to be a usable language that has
+many uses.
+\subsection{Core objectives}
+\begin{description}
+ \item[A compiler for the Zippy language]
+ \item[AST's used to compile source code]
+ \item[A lisp like syntax]
+ \item[Functional paradigm language]
+ \item[Recursion]
+ \item[Higher order functions] \textit{(this means functions can be passed as arguments to
+ other functions)}
+ \item[High performance language]
+ \item[A package manager]
+ \item[Ability to call C functions]
+\end{description}
+If possible I would like Zippy to also meet the following extra objectives
+\subsection{Extra objectives}
+\begin{description}
+ \item[String parsing in the stdlib]
+ \item[graphs in the stdlib]
+ \item[networking in the stdlib]
+ \item[graphics in the stdlib]
+\end{description}
+
+\section{Design}
+\subsection{Language specification}
+Like any other programming language Zippy needs to have a defined syntax, bellow
+you can find a syntax for zippy that will be complaint with my objectives.
+
\end{document}
diff --git a/comp/lucas-standen-NEA/writeup2/writeup.toc b/comp/lucas-standen-NEA/writeup2/writeup.toc
index 1455ed2..4faccde 100644
--- a/comp/lucas-standen-NEA/writeup2/writeup.toc
+++ b/comp/lucas-standen-NEA/writeup2/writeup.toc
@@ -3,26 +3,31 @@
\contentsline {section}{\numberline {2}Analysis}{3}{section.2}%
\contentsline {subsection}{\numberline {2.1}The current problem}{3}{subsection.2.1}%
\contentsline {subsection}{\numberline {2.2}A solution}{3}{subsection.2.2}%
-\contentsline {subsection}{\numberline {2.3}What is a programming language}{3}{subsection.2.3}%
-\contentsline {subsubsection}{\numberline {2.3.1}A very simple explanation}{3}{subsubsection.2.3.1}%
+\contentsline {subsection}{\numberline {2.3}What is a programming language}{4}{subsection.2.3}%
+\contentsline {subsubsection}{\numberline {2.3.1}A very simple explanation}{4}{subsubsection.2.3.1}%
\contentsline {subsubsection}{\numberline {2.3.2}Why are there so many}{4}{subsubsection.2.3.2}%
\contentsline {subsection}{\numberline {2.4}Researching and getting a scope of the project}{4}{subsection.2.4}%
\contentsline {subsubsection}{\numberline {2.4.1}Examples of older similar projects}{4}{subsubsection.2.4.1}%
-\contentsline {subsubsection}{\numberline {2.4.2}Examples of newer similar projects}{4}{subsubsection.2.4.2}%
+\contentsline {subsubsection}{\numberline {2.4.2}Examples of newer similar projects}{5}{subsubsection.2.4.2}%
\contentsline {subsubsection}{\numberline {2.4.3}What should be taken away from these languages}{5}{subsubsection.2.4.3}%
-\contentsline {subsection}{\numberline {2.5}Clients}{5}{subsection.2.5}%
-\contentsline {subsubsection}{\numberline {2.5.1}Client 1: Amy C}{5}{subsubsection.2.5.1}%
-\contentsline {subsubsection}{\numberline {2.5.2}Client 2: Rayn M}{5}{subsubsection.2.5.2}%
+\contentsline {subsection}{\numberline {2.5}Clients}{6}{subsection.2.5}%
+\contentsline {subsubsection}{\numberline {2.5.1}Client 1: Amy C}{6}{subsubsection.2.5.1}%
+\contentsline {subsubsection}{\numberline {2.5.2}Client 2: Rayn M}{6}{subsubsection.2.5.2}%
\contentsline {subsubsection}{\numberline {2.5.3}Client 3: Myself}{6}{subsubsection.2.5.3}%
\contentsline {subsection}{\numberline {2.6}Questionnaires}{6}{subsection.2.6}%
\contentsline {subsubsection}{\numberline {2.6.1}Amy C, initial ideas}{6}{subsubsection.2.6.1}%
-\contentsline {subsubsection}{\numberline {2.6.2}Notes from questionnare 1}{6}{subsubsection.2.6.2}%
+\contentsline {subsubsection}{\numberline {2.6.2}Notes from questionnare 1}{7}{subsubsection.2.6.2}%
\contentsline {subsection}{\numberline {2.7}The first elements of the project}{7}{subsection.2.7}%
-\contentsline {section}{\numberline {3}Modelling}{7}{section.3}%
-\contentsline {subsection}{\numberline {3.1}Linked lists}{7}{subsection.3.1}%
-\contentsline {subsection}{\numberline {3.2}Dictionaries}{8}{subsection.3.2}%
-\contentsline {subsection}{\numberline {3.3}Prototyping harder features}{8}{subsection.3.3}%
-\contentsline {subsubsection}{\numberline {3.3.1}Abstract syntax trees (AST's) theory}{8}{subsubsection.3.3.1}%
-\contentsline {subsubsection}{\numberline {3.3.2}Abstract syntax trees (AST's) practical}{9}{subsubsection.3.3.2}%
-\contentsline {subsection}{\numberline {3.4}Feedback}{13}{subsection.3.4}%
-\contentsline {subsection}{\numberline {3.5}Mixing linked lists and AST's}{14}{subsection.3.5}%
+\contentsline {section}{\numberline {3}Modelling}{8}{section.3}%
+\contentsline {subsection}{\numberline {3.1}Linked lists}{8}{subsection.3.1}%
+\contentsline {subsection}{\numberline {3.2}Dictionaries}{9}{subsection.3.2}%
+\contentsline {subsection}{\numberline {3.3}Prototyping harder features}{9}{subsection.3.3}%
+\contentsline {subsubsection}{\numberline {3.3.1}Abstract syntax trees (AST's) theory}{9}{subsubsection.3.3.1}%
+\contentsline {subsubsection}{\numberline {3.3.2}Abstract syntax trees (AST's) practical}{10}{subsubsection.3.3.2}%
+\contentsline {subsection}{\numberline {3.4}Feedback}{15}{subsection.3.4}%
+\contentsline {subsection}{\numberline {3.5}Mixing linked lists and AST's}{15}{subsection.3.5}%
+\contentsline {section}{\numberline {4}Objectives}{15}{section.4}%
+\contentsline {subsection}{\numberline {4.1}Core objectives}{15}{subsection.4.1}%
+\contentsline {subsection}{\numberline {4.2}Extra objectives}{16}{subsection.4.2}%
+\contentsline {section}{\numberline {5}Design}{16}{section.5}%
+\contentsline {subsection}{\numberline {5.1}Language specification}{16}{subsection.5.1}%