Updates#1
Open
notheotherben wants to merge 49 commits intofgretief:masterfrom
Open
Conversation
Now capable of tracing a lot more information about the execution of a script. This includes: - Function names for Lua functions - Variable access - Host variables for non-Lua functions (for stack traces) - Current document filename - Currently evaluating source code - Tracing calls to metamethods Also updated LuaRuntimeException to print well formatted merged stack traces which cross CLR->Lua->CLR boundaries in a sensical way.
Added a test to ensure that errors that are thrown from within child functions are correctly reported.
Just testing some additional changes to the stack trace reporting code.
Itteration of CLR enumerable objects is now supported through the clr.itterate function, which returns an itterator to move over a CLR IEnumerable type.
More fixes in InteropLibTests.lua, broke some of the tests.
Added support for Enumeration types, allowing access as either a member or index. Added error catching for get and set value operations, as well as more descriptive error messages for these errors.
Now formats message as "<file>:<line>:<error result as string>"
Now wraps certain exception types in LuaRuntimeException objects to make them easier to trace.
Overriding more methods to provide Lua specific functionality
Now testing for missing method exceptions in a logical manner.
Added an extension method which allows you to create a "LuaScope", which is a ScriptScope object using a LuaTable as the backing store for variables. This allows the use of metatables, and metamethods and generally allows the ScriptScope to behave as the Lua _G object should. Updated tests and other methods to support this, as well as adding custom support for this particular scope type into LuaContext for [Get,TryGet,Get<T> and Set]ScopeVariable operations.
Enabled a number of "broken" tests, which are now functional given updates to IronLua.
Now making use of latest SPARTAN563/main builds, allow LanguageContext to control Scope creation.
Supports the latest changes in the DLR which allow a LanguageContext to control creation of its own scopes, thus allowing us to set LuaTable as the default scope backing store for all created scopes.
Now making use of the latest SPARTAN563/main builds. No changes since the last update, but recompiled from the latest HEAD (rebuilt due to Encoding issues).
Fixed issues with returning to parent scope for DO<block>END statements (also no longer creates unused scope). Fixed GlobalGet instructions being registered as GlobalSets. Added variable names for local variable expressions to make debugging errors easier.
Added checks for null keys, return null and throw no error.
Now provides support for tracing variable value get and set operations, as well as computing the full path to the currently accessed object.
Traces scope entry and exit to allow local variable access information to be dumped from the variable access stack as soon as the current scope is left. Also added a test to LuaTests_Errors which tests this information for correctness.
Removed GetScope(path) override, falls back on the default implementation since it is no longer necessary.
_G and _ENV are now set by BaseLibrary on every scope which is initialized by LuaContext. This allows each context to redefine functions in its scope without breaking global values.
Now copies all the values from Globals into a new scope's values set
Was already in index when ignore was added to .gitignore. This is just doing some housekeeping
Allows you to access LuaTable as an IDictionary object, and provides CLR enumeration support over the table.
No actual functionality just yet.
Provided IDictionary<object,object> and IDictionary<string,object> interfaces for access to the elements in the table.
Uses CodeContext to provide code-instance specific storage, for example stack storage. This allows multiple simultaneous execution paths using different code instances, without the possibility of one execution scope manipulating another's data. Also moving towards implementing Microsoft.Scripting.Runtime.DebugContext as the debugger/tracer instead of our custom implementation in LuaTrace.
Massive overhauls of large portions of the code, as well as implementing custom Expression types for internal operations. Currently in a non-compilable state, with a lot of errors which need to be fixed, and new functionality which needs to be added before it is ready for testing.
Currently working on getting IronLua back to a compilable (and runnable) state. It currently passes most tests, but fails on syntax trees where NaN checking is done (since the LuaRuntimeException constructors are marked as internal. We will need to fix that before we can continue. When that is done, then we need to add support for rewriting lambda expressions for debug operations, and run some tests for closure support (should work given how the DLR is written, out of the box, but we will need to see). Also need to add tests for custom environments for different functions (it is now present in CodeContext, and just needs to be enabled in BaseLibrary). Then I need to clean up the code, and remove some expression types which I added but am not using. Maybe also add some new expression types to represent different things which may change, and which we can optimize the Expression tree by formatting depending on those changes.
Fully functional now, all tests passing as they should as well as some new tests to ensure that closures and function environments are working correctly. We still need to get debug tracing working correctly, and implement the DebugContext handlers before we have most of the TODO stuff completed, but the backend is now correctly rewritten.
Fixed local function variable definition order to fix possible failure to access a recursive local function.
Added tests for a number of advanced scenarios, including redefining functions, and getting a quick performance benchmark. Also testing MathLibrary and some quirky function behaviours.
Fixed random function, now accepts variable numbers of parameters and returns the correct values.
Made requests for libraries initialize them on demand, that way preventing the overhead of loading a base library if the user doesn't ever use it. Also fixed "math" initializing a new BaseLibrary instead of MathLibrary.
Added extension method for ScriptEngine which allows you to compile a given code snippet into a ScriptCode object which can be executed repeatedly without needing to parse the syntax tree again.
Added some compile-time optimizations for global member access (in particular, determining at compile time whether an identifier represents a native library or not). This has shaved a massive amount of time off of our global member accesses, particularly on the first run (which is now almost as fast a subsequent runs).
Added caching to LuaTable, will now remember the last index that was accessed, this provides a rather large performance increase when performing the same access on the table (for example, accessing the same function from within a loop).
Added readonly parent table functionality, should allow us to use static C# code for handling decisions regarding which tables to access for Global/Library functions. Should also ensure that the correct values are returned when selecting a key present in both tables.
Added missing value (and null parent) tests for new changes.
Added debug builds of the DLR (for .NET4) to make debugging easier.
Initial work towards allowing IronLua to generate its own source code from expressions through the DLR's standard interface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep This Open
Figured I would start a pull request here so we have a line of communication about where the project is headed?
What I'm Working On [SPARTAN563]
Currently rewriting most of the debug code again (going to try and make use of
Microsoft.Scripting.Runtime.DebugContextand all of its linked stuff. Looks like to do so I will need to change a number of things in how we handle LuaContext.I am also working towards making it safe to run multiple concurrent (and non-conflicting) code paths off the same engine. At the moment that isn't possible with the way engine Globals are handled and how we do metamethod lookups. I'm planning on implementing a CodeContext object which will act as a go between between LuaContext (our engine) and the actual code. This should allow us to manage nice separate stacks for the debug library, and even permit us to enable setenv() functionality. I'll update this post as I continue work on it.