I got a little ahead of myself when I decided to start implementing optimizations in Fera... it has code flow graph generation now but it given my lack of access to some of the more efficient algorithms for doing anything beyond that, it makes more sense to get all the language features done and in place (and testcased).
So I did some of that the last couple of days, fixing a critical scoping bug for resolving imported types on declaration entries and implementing arrays (which went so smoothly that I had to pat myself on the back with this blog entry).
I also implemented inspection of method side effects, culminating in this warning which appears whenever you use a side-effect-free method as a standalone expression:
invalid-standalone-expr2.f(13,4): Warning: The method 'FeraLanguageTest.Program.MethodWithoutSideEffects' does not have side effects and returns a value. This usage of the method is probably not intended.
I'm developing the code in a very agile/test-driven way. Here is the Fera testcase suite results for today:
(pass) helloworld (Hello, world!)
(pass) echo1 (Echo (test 1))
(pass) partial-types1 (Partial types)
(pass) variables1 (Variable support (simple definition))
(pass) variables2 (Variable support (initialization))
(pass) variables3 (Variable support (assignment))
(pass) variables4 (Variable support (variable as instance))
(fail) mutate1 (Mutation (++x))
Caught exception 'Operation is not valid due to the current state of the object.'
(pass) bool-constants1 (Boolean constants (true))
(pass) bool-constants2 (Boolean constants (check))
(pass) bool-not (Boolean unary operator (!))
(pass) bool-and (Boolean binary operator (&&))
(pass) bool-or (Boolean binary operator (||, test 1))
(pass) bool-or2 (Boolean binary operator (||, test 2))
(pass) bool-or3 (Boolean binary operator (||, test 3))
(pass) methodcall1 (Method call (no parameters, void return))
(pass) methodcall2 (Method call (1 parameter, void return))
(pass) methodcall3 (Method call (1 parameter, throw-away return))
(pass) methodcall4 (Method call (1 parameter, used return))
(pass) methodcall5 (Method call (incorrect parameters, missing 1))
(pass) methodcall6 (Method call (incorrect parameters, 1 extra))
(pass) invalid-standalone-expr1 (Invalid standalone expressions (x + 3))
(pass) invalid-standalone-expr2 (Invalid standalone expressions (MethodWithoutSideEffects()))
(pass) imports-structure1 (Imported Namespaces (unqualified type for method return))
(pass) imports-structure1 (Imported Namespaces (unqualified type for method return))
(pass) imports-imperative1 (Imported Namespaces (unqualified type for variable definition))
(pass) switch1 (Switch test 1 (case variable scope))
(pass) switch2 (Switch test 2 (dynamic cases))
(pass) invalid-type-variable (Unknown type (variable))
(pass) missing-variable-initializer (Missing variable initializer (var x;))
(pass) valuetype-instance1 (Passing by-value types as instance parameter (int x; x.ToString ()))
(pass) valuetype-instance2 (Passing by-value types as instance parameter (addressof parameter))
(pass) valuetype-constant-instance1 (Passing by-value constants as instance parameter (38.ToString ()))
(pass) arrays1 (Arrays (array def/construction))
(pass) arrays2 (Arrays (element assignment))
(pass) arrays3 (Arrays (element access))
(fail) arrays4 (Arrays (use of Length))
Caught exception 'Unknown error'
(fail) variable-params1 (Variable parameters (basic test 1))
Compile was not successful (1 errors)
(fail) generics1 (Generics (test 1))
Compile was not successful (1 errors)
Press any key to continue . . .
As you see, there's still some bugs in arrays and variable parameters / generics are totally broken. As a nod to test driven development: the mutate testcase fails because of the changes to the Assignable expression model, I wouldn't have known without this great unit test framework!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment