NOTE: This update changes some of the fundamental definitions of items in Decision, and thus will break most source files, and all object files, from previous Decision versions!
- Removed multi-line comments.
- Added single-line comments: Anything after and including the
>
symbol on the same line will be ignored by the compiler.
- All nodes, sockets, variables, functions and subroutines now have both names
and descriptions which are accessible via the C API.
- The
Variable
property now has a description argument, e.g.Variable(count, Integer, 0, "Counts how many pies you've eaten today.")
- The
Function
andSubroutine
properties now have a description argument, e.g.Function(Double, "Doubles the number.")
- The
FunctionInput
andFunctionOutput
argument specification has changed:FunctionInput(functionName, inputName, inputType [,inputDefaultValue [, inputDescription]])
FunctionOutput(functionName, outputName, outputType [, outputDescription])
- The
- Integers as inputs to bitwise operators is now supported.
- Booleans as inputs to
Equal
andNotEqual
is now supported. - Reimplemented
Length
to use the C functionstrlen
.
- Changed the Decision VM to be stack-based, rather than register-based.
- The VM stack can grow and shrink in size, meaning the VM is not limited in the amount of memory it can use anymore.
- The stack holds temporary values (previously stored in the registers), arguments and return values (previously stored in the general stack), saved return addresses (previously stored in the call stack), as well as saved frame pointers.
- Now produces a runtime error if a division by 0 is attempted.
- Compiled object files (.dco) now store the version of Decision that created them. The compiler now checks to see if an object file was made with a future version of Decision, and will check in future releases for incompatible versions.
- C functions are now stored in sheets, rather than in a global list.
- Sheets can now be loaded with an initial list of included sheets, which are loaded before any compilation happens.
- Sheets now have an
allowFree
property that stops sheets that include it from freeing the sheet when they are freed. - Bytecode now stores the pointer to the
CFunction
struct containing the actual function pointer, rather than the function pointer itself, to conform to the ISO C Standard.
- The ability to debug Decision sheets has now been added, and can be done
through the C API (see ddebug.h).
- If compiling in debug mode, code generation will store information about instructions in the bytecode, and optimisation will no longer occur.
- You can provide agendas to debugging sessions, which allows you to give function pointers which are called when certain events happen, and also allows you to provide node and wire breakpoints.
- You can then run debug sessions, which essentially simulates running the Decision VM.
- A C test has been added to test this functionality.
- Split large source files into smaller ones to improve code readability.
- The graph components of sheets (i.e. the nodes and wires) have their own
set of files,
dgraph.c
anddgraph.h
. - Finding the definitions of names has been moved to
dname.c
anddname.h
. - Decision object files now have their own set of source files,
dobj.c
anddobj.h
, and the code has been revamped to be less error-prone.
- The graph components of sheets (i.e. the nodes and wires) have their own
set of files,
- Removed
d_insert_bytecode
, as it is no longer used. - Removed all calls to "safe" Visual C++ functions, due to considerations of standardisation.
- The compiler now has a
--export-core
flag, which will output the core reference in JSON format.- This is used in conjunction with an extension added to the user manual, which reads the JSON and displays the core reference automatically.
- Both the user and developer manuals have been updated for changes made in this update.
- Changed the build system such that most of the code compiles to a singular
library (which is either static or shared, static by default, see
README.md for more details), and link the executable to that
library. This has reduced the compile time significantly.
- Compiler warnings have also been set to maximum on both the executable and the library that is built.
- Syntax Analysis has been optimised to check the next token ahead before dedicating itself to a syntax definition.
- Nodes now reference their definitions, which reduces data redundancy.
- Wires are stored in an ordered list, rather than as direct pointers, to reduce the number of memory allocations and to remove the potential for dangling pointers.
- Fixed a bug where reduced types were no longer compatible with their connected sockets, but the compiler didn't throw an error.
- Fixed a bug where a stack overflow would occur if there was a circular include cycle in the sheets.
- Fixed a bug where the compiler would let subroutines with return values and without ending return nodes compile, leading to undefined values being returned.
- Added the
Length
core function, which returns the number of characters in a given string. - Added tests for the
Length
function.
- The compiler now automatically converts integer literals to float literals if the socket is a float-only socket.
- Moved the linking stage to the last step in loading a string instead of the first step in running a string.
- Optimised by adding a stage in linking dedicated to pre-calculating the memory locations of external variables and pointers.
- Fixed a bug where compiled sheets maintained their external pointers.
- Added
d_run_function
todecision.h
, which allows for running Decision functions and subroutines from C. - Added
dcfunc.c
anddcfunc.h
, which allow for running C functions from Decision. - Added new opcode
OP_CALLC
to the VM. - Added a
.c
section to compiled object files to store the specifications of C functions the sheet uses. - The compiler, as part of finding the definition of a name, will look at
defined C functions in
dcfunc.c
to find one. - Added
d_vm_pop_stack
,d_vm_pop_stack_float
andd_vm_pop_stack_ptr
todvm.h
. - Added
d_vm_push_stack
,d_vm_push_stack_float
andd_vm_push_stack_ptr
todvm.h
. - Added tests for the C API to the CMake project.
- Added "String Manipulation" section to the user manual.
- Added "The C API" chapter to the developer manual.
- Added note in the user manual about semi-colons being valid end of statement symbols.
- Changed the
bool
definition to the one instdbool.h
, which makes it consistent to the C++ definition of thebool
type.
This is the first release of Decision!
Feel free to download it and give it a try - if you want to start contributing
to the project, have a look at CONTRIBUTING.md
, and have fun!