fur
6 years agoAllocate Fur stacks on the C heap
David Kerkeslager [Tue, 12 Dec 2017 23:44:15 +0000 (18:44 -0500)]
Allocate Fur stacks on the C heap

6 years agoSet the environment to the same variable name
David Kerkeslager [Tue, 12 Dec 2017 23:37:37 +0000 (18:37 -0500)]
Set the environment to the same variable name

6 years agoChange parent_jump to parentJump to conform to previously used code style
David Kerkeslager [Mon, 25 Sep 2017 21:55:10 +0000 (17:55 -0400)]
Change parent_jump to parentJump to conform to previously used code style

6 years agoClean up stacks in the case of an exception
David Kerkeslager [Mon, 25 Sep 2017 21:49:12 +0000 (17:49 -0400)]
Clean up stacks in the case of an exception

6 years agoAdded a shell script that can be used to run Valgrind on Fur programs
David Kerkeslager [Sun, 24 Sep 2017 22:10:17 +0000 (18:10 -0400)]
Added a shell script that can be used to run Valgrind on Fur programs

6 years agoAdd very rudimentary line numbers to exceptions
David Kerkeslager [Sun, 24 Sep 2017 22:08:20 +0000 (18:08 -0400)]
Add very rudimentary line numbers to exceptions

6 years agoSimple exceptions (#6)
David Kerkeslager [Fri, 22 Sep 2017 03:38:34 +0000 (23:38 -0400)]
Simple exceptions (#6)

* Added basic exceptions

6 years agoMove .output.txt to .stdout.txt to reflect which output stream the files contain
David Kerkeslager [Thu, 21 Sep 2017 22:46:41 +0000 (18:46 -0400)]
Move .output.txt to .stdout.txt to reflect which output stream the files contain

6 years agoCapture stderr in integration tests
David Kerkeslager [Thu, 21 Sep 2017 22:40:00 +0000 (18:40 -0400)]
Capture stderr in integration tests

6 years agoStart passing around a jump buffer to handle errors
David Kerkeslager [Wed, 20 Sep 2017 22:32:08 +0000 (18:32 -0400)]
Start passing around a jump buffer to handle errors

6 years agoPass arguments to infix operators via the stack
David Kerkeslager [Thu, 14 Sep 2017 23:43:23 +0000 (19:43 -0400)]
Pass arguments to infix operators via the stack

6 years agoReuse normalize_basic_infix_operation in implementation of normalize_comparison_expre...
David Kerkeslager [Thu, 14 Sep 2017 23:23:06 +0000 (19:23 -0400)]
Reuse normalize_basic_infix_operation in implementation of normalize_comparison_expression

6 years agoMove desugaring ternary comparison operators into the normalization step
David Kerkeslager [Thu, 14 Sep 2017 23:06:05 +0000 (19:06 -0400)]
Move desugaring ternary comparison operators into the normalization step

6 years agoAdd a stack, and use that for function call arguments
David Kerkeslager [Sat, 2 Sep 2017 13:04:02 +0000 (09:04 -0400)]
Add a stack, and use that for function call arguments

6 years agoAdded a future folder to examples
David Kerkeslager [Fri, 1 Sep 2017 21:49:00 +0000 (17:49 -0400)]
Added a future folder to examples

6 years agoFix link
David Kerkeslager [Tue, 29 Aug 2017 18:18:58 +0000 (14:18 -0400)]
Fix link

6 years agoAdd structures, fix link
David Kerkeslager [Tue, 29 Aug 2017 18:17:58 +0000 (14:17 -0400)]
Add structures, fix link

6 years agoOne more thing it supports
David Kerkeslager [Tue, 29 Aug 2017 18:15:09 +0000 (14:15 -0400)]
One more thing it supports

6 years agoAdded basic README
David Kerkeslager [Tue, 29 Aug 2017 18:10:08 +0000 (14:10 -0400)]
Added basic README

6 years agoAdded structs
David Kerkeslager [Sat, 26 Aug 2017 20:00:35 +0000 (16:00 -0400)]
Added structs

6 years agoAdd double-quoted strings
David Kerkeslager [Fri, 25 Aug 2017 03:52:21 +0000 (23:52 -0400)]
Add double-quoted strings

6 years agoAdd a string concatenation operator
David Kerkeslager [Thu, 24 Aug 2017 23:55:20 +0000 (19:55 -0400)]
Add a string concatenation operator

6 years agoAdded list literals
David Kerkeslager [Fri, 18 Aug 2017 22:06:15 +0000 (18:06 -0400)]
Added list literals

6 years agoAdded if expression statements
David Kerkeslager [Thu, 17 Aug 2017 15:33:33 +0000 (11:33 -0400)]
Added if expression statements

6 years agoMake "do" a keyword
David Kerkeslager [Mon, 14 Aug 2017 06:34:41 +0000 (02:34 -0400)]
Make "do" a keyword

6 years agoRemove TODO with unclear reasoning
David Kerkeslager [Mon, 14 Aug 2017 04:19:37 +0000 (00:19 -0400)]
Remove TODO with unclear reasoning

6 years agoNormalize function expressions
David Kerkeslager [Sun, 13 Aug 2017 19:45:45 +0000 (15:45 -0400)]
Normalize function expressions

6 years agoNormalize symbol expressions
David Kerkeslager [Sun, 13 Aug 2017 19:18:11 +0000 (15:18 -0400)]
Normalize symbol expressions

6 years agoFixed some TODOs
David Kerkeslager [Sat, 12 Aug 2017 20:08:21 +0000 (16:08 -0400)]
Fixed some TODOs

6 years agoAdded some todos
David Kerkeslager [Sat, 12 Aug 2017 19:24:15 +0000 (15:24 -0400)]
Added some todos

6 years agoNormalize symbol expressions
David Kerkeslager [Sat, 12 Aug 2017 19:08:28 +0000 (15:08 -0400)]
Normalize symbol expressions

6 years agoNormalize literal expressions
David Kerkeslager [Sat, 12 Aug 2017 18:56:12 +0000 (14:56 -0400)]
Normalize literal expressions

6 years agoPrevent assignment to a builtin variable
David Kerkeslager [Sat, 12 Aug 2017 18:44:01 +0000 (14:44 -0400)]
Prevent assignment to a builtin variable

6 years agoAllow the results of function calls to be immediately called
David Kerkeslager [Sat, 12 Aug 2017 18:28:22 +0000 (14:28 -0400)]
Allow the results of function calls to be immediately called

6 years agoAdd support for parenthesized functions
David Kerkeslager [Sat, 12 Aug 2017 18:01:11 +0000 (14:01 -0400)]
Add support for parenthesized functions

6 years agoJust pass through the internals of parentheses, unwrapped
David Kerkeslager [Fri, 11 Aug 2017 21:55:35 +0000 (17:55 -0400)]
Just pass through the internals of parentheses, unwrapped

6 years agoClosures (and garbage collection for environments, which is required by closures...
David Kerkeslager [Fri, 11 Aug 2017 15:50:11 +0000 (11:50 -0400)]
Closures (and garbage collection for environments, which is required by closures) (#1)

* Add proper reference counting to environments

* It has become clear we need a garbage collector for environments before we can implement closures

* Allow line comments starting with #

* Allocate Environments from a garbage-collected EnvironmentPool

* Wrap closure functions in a struct in preparation for storing the defining environment with them

* Move the instantiation of closures into where they are created

* Fixed a bug in the mark/sweep algorithm:

* It would infinitely recurse in the case of cycles, because nothing was
  checking that Environments had already been marked.
* Simply exiting on self->mark == mark would fix this, but introduce a
  separate, worse bug where recursion wouldn't reach some live objects,
  since some objects might already be marked with the current mark due
  to previous cycles.
* To fix, I introduced a pass over the pool that marks everything false
  so we can reliably assume that self->mark == true means that the
  environment has been marked in the current GC round. It's slower than
  I wanted, but it's better to do the correct thing slowly than the
  wrong thing quickly.

* Store the defining environment on closures and GC it appropriately

* Test a simple case of closures and fix the discovered errors

* Add a test that explicitly demonstrates freeing a cycle

* Allow user-defined functions to take arguments

* Another closure example

6 years agoIgnore symbol folders
David Kerkeslager [Thu, 10 Aug 2017 03:36:13 +0000 (23:36 -0400)]
Ignore symbol folders

6 years agoAdd a suite of memory leak tests
David Kerkeslager [Thu, 10 Aug 2017 03:33:31 +0000 (23:33 -0400)]
Add a suite of memory leak tests

6 years agoFinish conditional compilation of operators
David Kerkeslager [Thu, 10 Aug 2017 01:59:30 +0000 (21:59 -0400)]
Finish conditional compilation of operators

6 years agoDon't compile in some unused operators
David Kerkeslager [Thu, 10 Aug 2017 01:46:12 +0000 (21:46 -0400)]
Don't compile in some unused operators

6 years agoClean up expression transformation a bit
David Kerkeslager [Thu, 10 Aug 2017 01:23:19 +0000 (21:23 -0400)]
Clean up expression transformation a bit

6 years agoAppease -Wall
David Kerkeslager [Thu, 10 Aug 2017 00:19:45 +0000 (20:19 -0400)]
Appease -Wall

6 years agoGo back to constructors and destructors
David Kerkeslager [Wed, 9 Aug 2017 18:46:08 +0000 (14:46 -0400)]
Go back to constructors and destructors

6 years agoGo back to allocating environments on the heap
David Kerkeslager [Wed, 9 Aug 2017 18:37:41 +0000 (14:37 -0400)]
Go back to allocating environments on the heap

6 years agoA featureful commit:
David Kerkeslager [Wed, 9 Aug 2017 18:26:10 +0000 (14:26 -0400)]
A featureful commit:

* Added support for a few new kinds of expression statements
* Cleaned up the generated C code a bit
* Pass through calling environments to functions

6 years agoAllow users to define new zero-argument functions
David Kerkeslager [Wed, 9 Aug 2017 15:34:44 +0000 (11:34 -0400)]
Allow users to define new zero-argument functions

6 years agoLicense under the GPL 3
David Kerkeslager [Wed, 9 Aug 2017 13:00:53 +0000 (09:00 -0400)]
License under the GPL 3

6 years agoGet called functions from the environment
David Kerkeslager [Wed, 9 Aug 2017 12:50:43 +0000 (08:50 -0400)]
Get called functions from the environment

6 years agoStore functions as objects
David Kerkeslager [Wed, 9 Aug 2017 10:55:00 +0000 (06:55 -0400)]
Store functions as objects

6 years agoAdded variable-length args to function calls
David Kerkeslager [Tue, 8 Aug 2017 22:57:17 +0000 (18:57 -0400)]
Added variable-length args to function calls

6 years agoNormalize parenthesized and negated expressions
David Kerkeslager [Tue, 8 Aug 2017 18:07:34 +0000 (14:07 -0400)]
Normalize parenthesized and negated expressions

6 years agoNormalized all infix expression statements
David Kerkeslager [Tue, 8 Aug 2017 17:47:45 +0000 (13:47 -0400)]
Normalized all infix expression statements

6 years agovariable assignment renamed to variable initialization for accuracy
David Kerkeslager [Tue, 8 Aug 2017 16:04:08 +0000 (12:04 -0400)]
variable assignment renamed to variable initialization for accuracy

6 years agoNormalize comparison expressions, even ternary comparison expressions
David Kerkeslager [Tue, 8 Aug 2017 15:56:07 +0000 (11:56 -0400)]
Normalize comparison expressions, even ternary comparison expressions

6 years agoStart playing out the normalization of other infix operations
David Kerkeslager [Tue, 8 Aug 2017 14:55:47 +0000 (10:55 -0400)]
Start playing out the normalization of other infix operations

6 years agoUse order instead of operator to normalize infix expressions
David Kerkeslager [Tue, 8 Aug 2017 14:52:13 +0000 (10:52 -0400)]
Use order instead of operator to normalize infix expressions

6 years agoNormalize infix operators
David Kerkeslager [Tue, 8 Aug 2017 08:03:35 +0000 (04:03 -0400)]
Normalize infix operators

6 years agoNormalize all the arguments to functions
David Kerkeslager [Tue, 8 Aug 2017 07:24:45 +0000 (03:24 -0400)]
Normalize all the arguments to functions

6 years agoMinor refactor
David Kerkeslager [Tue, 8 Aug 2017 07:01:38 +0000 (03:01 -0400)]
Minor refactor

6 years agoAdd a CExpressionStatement to wrap expressions instead of passing them into statement...
David Kerkeslager [Tue, 8 Aug 2017 06:53:25 +0000 (02:53 -0400)]
Add a CExpressionStatement to wrap expressions instead of passing them into statement functions

6 years agoSome minor refactoring and added a (currently trivial) normalization step
David Kerkeslager [Tue, 8 Aug 2017 05:29:14 +0000 (01:29 -0400)]
Some minor refactoring and added a (currently trivial) normalization step

6 years agoBetter names
David Kerkeslager [Tue, 8 Aug 2017 04:53:44 +0000 (00:53 -0400)]
Better names

6 years agoRemoved not-yet-relevant runtime
David Kerkeslager [Tue, 8 Aug 2017 04:03:51 +0000 (00:03 -0400)]
Removed not-yet-relevant runtime

6 years agoRemoved not-yet-relevant string type
David Kerkeslager [Tue, 8 Aug 2017 04:01:35 +0000 (00:01 -0400)]
Removed not-yet-relevant string type

6 years agoSlightly better naming
David Kerkeslager [Tue, 8 Aug 2017 02:08:33 +0000 (22:08 -0400)]
Slightly better naming

6 years agoCombined accumulators into one namedtuple
David Kerkeslager [Tue, 8 Aug 2017 02:02:36 +0000 (22:02 -0400)]
Combined accumulators into one namedtuple

6 years agoAdd newlines to the parsing of statements
David Kerkeslager [Mon, 7 Aug 2017 04:08:09 +0000 (00:08 -0400)]
Add newlines to the parsing of statements

6 years agoAdd boolean operators
David Kerkeslager [Sun, 6 Aug 2017 20:43:21 +0000 (16:43 -0400)]
Add boolean operators

6 years agoAdd support for ternary comparison operators
David Kerkeslager [Sun, 6 Aug 2017 20:18:21 +0000 (16:18 -0400)]
Add support for ternary comparison operators

6 years agoStore all Fur infix operator expressions in the same type
David Kerkeslager [Sun, 6 Aug 2017 19:54:35 +0000 (15:54 -0400)]
Store all Fur infix operator expressions in the same type

6 years agoGet function names for operators in transformation phase rather than generation phase
David Kerkeslager [Sun, 6 Aug 2017 19:43:14 +0000 (15:43 -0400)]
Get function names for operators in transformation phase rather than generation phase

6 years agoUse composition rather than inheritance to differentiate between different operators...
David Kerkeslager [Sun, 6 Aug 2017 19:25:41 +0000 (15:25 -0400)]
Use composition rather than inheritance to differentiate between different operators of the same level in parsing

6 years agoRemoved duplication in left recursive infix operator parsers
David Kerkeslager [Sun, 6 Aug 2017 18:59:10 +0000 (14:59 -0400)]
Removed duplication in left recursive infix operator parsers

6 years agoAdded support for comparison operators
David Kerkeslager [Sun, 6 Aug 2017 18:45:45 +0000 (14:45 -0400)]
Added support for comparison operators

6 years agoSome comments
David Kerkeslager [Sun, 6 Aug 2017 17:24:55 +0000 (13:24 -0400)]
Some comments

6 years agoAdded parenthesized expressions
David Kerkeslager [Sun, 6 Aug 2017 17:21:47 +0000 (13:21 -0400)]
Added parenthesized expressions

6 years agoAdded a boolean type
David Kerkeslager [Sun, 6 Aug 2017 16:51:44 +0000 (12:51 -0400)]
Added a boolean type

6 years agoAdd constant symbol list, which solves all the symbol allocation problems
David Kerkeslager [Sun, 6 Aug 2017 08:02:26 +0000 (04:02 -0400)]
Add constant symbol list, which solves all the symbol allocation problems

6 years agoParse function call names using the symbol expression
David Kerkeslager [Sun, 6 Aug 2017 06:45:13 +0000 (02:45 -0400)]
Parse function call names using the symbol expression

6 years agoAdd the ability to assign to and retrieve variables
David Kerkeslager [Sat, 5 Aug 2017 22:56:57 +0000 (18:56 -0400)]
Add the ability to assign to and retrieve variables

6 years agoAdd a negation operator
David Kerkeslager [Sat, 5 Aug 2017 20:33:35 +0000 (16:33 -0400)]
Add a negation operator

6 years agoA pretty featureful commit:
David Kerkeslager [Sat, 5 Aug 2017 19:37:52 +0000 (15:37 -0400)]
A pretty featureful commit:

* New builtin pow()
* Support for multiple arguments to functions
* Support for the results of function calls being passed to functions

6 years agoAdd an integration test to ensure left recursive parsing of math works
David Kerkeslager [Fri, 4 Aug 2017 23:17:25 +0000 (19:17 -0400)]
Add an integration test to ensure left recursive parsing of math works

6 years agoAdded integration test to ensure that order of operations is correct
David Kerkeslager [Fri, 4 Aug 2017 23:12:43 +0000 (19:12 -0400)]
Added integration test to ensure that order of operations is correct

6 years agoAdd basic math
David Kerkeslager [Fri, 4 Aug 2017 23:01:08 +0000 (19:01 -0400)]
Add basic math

6 years agoHandle multiple statements
David Kerkeslager [Fri, 4 Aug 2017 20:31:02 +0000 (16:31 -0400)]
Handle multiple statements

6 years agoAdded support for integers
David Kerkeslager [Fri, 4 Aug 2017 15:26:32 +0000 (11:26 -0400)]
Added support for integers

6 years agoUse an actual string type
David Kerkeslager [Fri, 4 Aug 2017 14:49:20 +0000 (10:49 -0400)]
Use an actual string type

6 years agoClean up after integration tests
David Kerkeslager [Fri, 4 Aug 2017 10:46:33 +0000 (06:46 -0400)]
Clean up after integration tests

6 years agoAdd a .gitignore
David Kerkeslager [Fri, 4 Aug 2017 10:18:03 +0000 (06:18 -0400)]
Add a .gitignore

6 years agoAdd integration tests
David Kerkeslager [Fri, 4 Aug 2017 10:15:50 +0000 (06:15 -0400)]
Add integration tests

6 years agoAdded a very rudimentary fur-to-c compiler
David Kerkeslager [Thu, 3 Aug 2017 19:26:54 +0000 (15:26 -0400)]
Added a very rudimentary fur-to-c compiler