It still doesn't work, but I made good progress.
* Added prettyPrintTokens for slightly more readable token output
* Update readme and gitignore for ignore instructions
* Register a module-local StateVariable for each variable declared at
module scope
* Automatically change StateVariable types to pointers
* Automatically change references to StateVariables to pointer
dereferences
* Add NoEvalVariableGenerator for when references to state variables
need to access the state variable address
* Add token-splice-ref for ease of use (pairs well with quick-token-at)
* Add Converters.hpp to macro heading
* Fix PushBackTokenExpression not exiting at the final parenthesis of
the expression
* Update Debugging documentation to use cakelisp_cache folder
* Wrote hot-reload-make-state-variable-initializer and associated
experimentation for initializing StateVariables
* Experimented with using sizeof on arrays defined in different
modules
* I hand-wrote what I want the generated functions to look like, which
ended up informing how the runtime will manage state variables
* Don't add extern C to local functions. This may have to go away once
local functions can be partially reloaded, in which case they still
need to be extern "C", losing their static status
* def-function-signature is automatically local when in the
body. Remove the note and actually make it happen
* Run ./BuildAndRunTests.sh then run runtime/HotReloadingTest, then
make changes to TextAdventure.cake and run
./BuildHotReloadLib.sh. After, enter 'r' to reload the game. It's a
very simple example, but more good stuff is coming
* Hot-reloaded functions must use extern "C"
* Added additional error checking on command line options
* Move for-in into builtins
* Allow function signature declarations in everything but expression scope
* Add incr and decr aliases for ++ and --
* Reformatted some code
* Moved shared function signature parsing code to GeneratorHelpers. I also
moved shared type parsing code
* Added the ability to forward-declare function
pointers ("signatures")
* Added C-style casting
* Removed Generators.hpp dependency, because everything is in
GeneratorHelpers now
* runProcess now properly manages the memory for arguments. It's also
a bit easier to call now that you can pass const char* arguments to it
* Changed some (when) to (unless)
* Added basic skeleton (untested) of unload, load, and replace references for
hot-reloading
* Fix destructure-arguments not expecting arguments, and not working
for arguments which begin with an open parenthesis
* Added for-in (range-based for loop) generator
* Change functionNameMode to match other modes because sometimes
functions are actually variables (calling function at pointer)
* Close dynamic libraries once done
* Allow either block or scope for adding {} blocks
* Added path generator as a catch-all for object pathing
* Added tokenizeLinePrintError() to clean up code generated by
tokenize-push a little
* Fix multiple input files on command line
* Added ternary operator (?)
* Added unless
* Added "in" as the scope resolution operator (::)
* Added on-call for turning pathing, in, field, etc. into function
calls
* Finally added if. It accepts both a single statement (one block only,
essentially the same as (when)) and an else clause. The error will
warn you if you try to do more than 2 blocks, and tell you what to do
to get around it. I also caused scope to automatically be stripped
such that there's no extra braces in every if block
* Fix bug where module filenames could be deallocated or moved even
after tokens are referring to them. Filenames are now properly managed
* Changed include to import (for Cakelisp files) and c-import
instead. I threw away the simple include function because I decided
using a conventional build system to parse the includes was
unfeasible
* Added &comptime-only to resolve cases where macro- and
generator-only files don't actually create any headers, but are
still useful to import
* Made proper runtime build and run command
* Add CommandLineOptions.cake to feel out advanced struct annotation
This cleans up the dozens of files created for compile-time code
execution.
I also made sure "<global>" is only referenced through globalDefinitionName
* Name the compile-time artifacts with the definition name, making it
much easier to open the correct file for inspection
* Only rebuild if the source file is newer than the already created
dynamic library. This is a pretty massive performance gain, but does
require platform support to check file modification times
* Added more references, notes on the name, and section on includes
* Started on hot reloading runtime, itself written in Cakelisp
* Fix bug in PushBackTokenExpression where parentheses weren't counted
properly
* Added scope resolution operator (::) support for types. I decided to
go with "in", e.g. (in std vector) "in std, vector"
* Added some notes on what a real serializer would require
* Added MakeUniqueSymbolName() for safely generating unique variable
names
* tokenize-push only evaluates the output variable once
* tokenize-push properly pushes to the output variable, not hard-coded
"output"
* Use token-splice-array for stack-allocated arrays, else bad alloc
errors will occur
* Added more fun macros
* Explained how regular debuggers are useful for debugging Cakelisp at
all stages
* Made technical explanation a little better categories-wise
* Added Naughty Dog Scheme reference (maybe I'm not crazy after all!)
* Moved C-mera to similar languages section
* Added ExpectNumArguments to make it easy to validate things
* Added argument count validation to some of the C type
converters
* Fix segfault where compTimeOutput was being deleted wrongfully after
an error. I also fixed memory leaks where compTimeOutput should be
deleted after an error
* Actually use destructure-arguments. Attempt to do something useful
with def-serialize-struct: create a serialize function! WIP
* Macros use EvaluateGenerateAll_Recursive() now, which allows
multiple statements to be appended one-by-one. If I end up needing
delimiter functionality, that will need to be output from the macro
* Delimiter templates are only created when necessary
* Compile compile-time function definitions with debugging symbols
* Add documentation for how to debug compile-time definitions
* Added destructure-arguments macro (still work in progress)
If a compile-time function had a macro invocation which generated a
reference the compile-time function had already guessed, the reference
would never be resolved.
They are now resolved like the other invocations, which means the
environment is checked for the status of the reference and guessing
happens accordingly, then and there.
* CStatementGenerator now has "SmartEndStatement" which is
context-sensitive. This fixes ++, --, assignment, and on-call to add
";" when the context demands
* Added tokenize-push, a hacky implementation of "quoting". Tokens are
turned back into strings until (tokenize-*) functions are reached,
which causes the generator to insert arrays of tokens instead of a
string of tokens. I'm not really sure what a clean implementation of
quoting would look like for Cakelisp
* Moved write*ToBuffer because they have dependency on tokens (and
that's probably okay)
* Added on-call for calling member functions ("on X call Y")
* Add continue and break
* Made ExpressionList C statements accept no arguments and be happy
* More flailing with macros as they are
* Resolver wasn't resolving any known Cakelisp functions. It now
properly resolves them both at resolution time and regular
evaluation time
* Swapped order of (var) declaration to be (var name type &optional
initial-value), which matches (defstruct) member ordering. I also
like it because it makes the var name more important than the type,
which I think is good for readability
* Add early support for cross-compiling for Windows using MinGW
* Updated readme with more explanations
* Build Cakelisp into a library for easy embedding
* Add Clang-style help string
* Improved Converter errors
* Added defgenerator
* Added SpaceBefore to improve Splice formatting
* Wrap boolean operators with parentheses to make them unambiguous
* Write process output to separate pipes instead of
stdin. Additionally, read process output separately, one by one. This
ensures output comes through sequentially, which is important for
multi-line errors (often output by clang)
* Writer now only writes files which have meaningful output (leaving
out header files if the module is all local, etc.)
* Writer now properly handles splices which contain output for the
header file
* Started ModuleManager, which will handle multiple files in a shared
environment. I'm a bit sad to see the "one function shows the whole
pipeline" go, but it's necessary that the pipeline is broken up for
multiple files loading in at different times
* Cleaned up TODOs I didn't think were important/accurate
* #if 0'ed some code which isn't necessary
* Removed endToken from StringOutput because nothing really uses it
* Rename <module> to <global> because it is global
* Centralized fileLoad code
* Module definition is now created for running code at module-level.
This is useful for running macros which create functions, etc.
* Added guess state if a definition is already known (fixes false
positive error)
* Fix reference pool search not actually searching for the reference
name. This only broke once something was referred to twice
* Fix memory leak with definition output
* Fix GDB compile error to to va_start
* Cleaned up Jamfile and Jamrules
* Copy references to definitions and def refs in case iterators get
invalidated (the loop does run code which could add references
and definitions to the current definition)
* Added isLoaded for quickly checking definition status
* Remove old code
a.k.a. guessing a reference is a C function and compiling to see.
It's still WIP, because normal functions do not work any more.
However, macros are building and doing useful things, which is very exciting.