Releases: bitdotgames/BHL
v2.0.0-beta125
Warning: this release breaks BC with previous beta releases
New Features
- More generic implementation of arrays and maps which allows to implement much more optimal wrappers around C# lists/dictionaries. Basic array type []T now can be used as an interface for generic array access to native wrappers.
- Making more modular registration of native modules.
- Greatly improved types persistence per module. Gradually getting closer to implementation of basic generics.
Improvements
- Improving bad cast runtime checks for cases like (Foo)bar. Incompatible cast now triggers an exception like in C#.
- Runtime VM.Null value now has actual null type of instead of Types.Null for more explicit runtime errors
- Allowing null value to be force cast to any instantiatable type.
- More optimal 'func call' related opcodes implementation with less runtime overhead. Encoding func ip instead of func idx into call opcodes where possible.
- More optimal 'get func ptr' related opcodes implementation.
- Cleaning symbols setup logic after module loading.
- Func symbols are now additionally indexed per module so it's possible to lookup the function by its module index.
- Making compiler output less verbose by default. This behavior can be additionally controlled with BHL_VERBOSE=0|1|2 environment variable.
- Improving incremental builds by trying to compile modules which didn't have any parse errors. This way consequent compiler invokes after compile errors will use already cached compiled modules.
BC breaks
- Getting rid of too generic Proxy< T > in favor of concrete ProxyType.
- Renaming Types.ClassType -> Types.Type.
- Getting rid of ISymbolsIteratable in favour of IEnumerable< Symbol >.
Bugfixes
v2.0.0-beta118
Bugfixes
- Fiber now exits all its scopes immediately once it's stopped or released
- Double import of modules is now forbidden in userland code
- Improving file modification test in bhl.bat
- Fixing namespaces declaration edge case bugs
- Fixing stack trace retrieval triggered from functions invoked in defer blocks
- Disallowing empty paral {} blocks
- More robust check for improper usage of class types as values
Improvements
- Adding initial dotnet's .csproj and Unity's .asmdef support thanks @wrenge
v2.0.0-beta108
Bugfixes
- Making code thread safe
- Fixing 'double import' bug
v2.0.0-beta106
New Features
- Adding StackList < T > struct which can be used to pass small lists around without any allocations. Adding a VM.Start(..) variation which uses StackList < Val > to pass arguments to a Fiber
- Adding convenience VM.TryLoadModuleSymbol(..)
Bugfixes
- Fixing UTF8 symbols not being properly handled during the preprocessing phase
- Fixing potential infinite loop during bad imports pre-parsing phase
- Fixing priority of logical AND over OR operations in cases like:
bool a = true
bool b = true
bool c = true
bool d = false
bool e = a && b || c && d
// ^^^^^^^^^^^^^^^^^^^^^
// e is true, not false, expression is evaluated as follows:
// (a && b) || (c && d),
// not ((a && b) || c) && d) as before
- Adding implicit casting to int of the division product of two int operands:
int a = 11
int b = 2
int c = a / b // <--- c == 5, not 5.5 as before
v2.0.0-beta97
New Features
- Adding basic support for preprocessing and conditional compilation. For example:
#if SERVER
ProjectileShoot()
#else
ProjectileShow()
#endif
#if !CLIENT
ProjectileShoot()
#endif
Defines are declared in a project manifest bhl.proj as follows:
{
...
"defines" : ["CLIENT"]
...
}
Bugfixes
- Fixing rare bug related to object instance casting
v2.0.0-beta94
- Fixing 'as' casting for native types
- Adding parent and children tracking to fibers
- Improving error handling for unresolved types
- Adding 'inc_dirs' property to bhl.proj manifests for more flexible configuration of include path for imported modules resolving
{
"inc_dirs" : ["../"],
"src_dirs" : ["./", "../Shared"],
...
}
- Adding support for negative numbers in enums
- Adding implicit casting from enum to int type
- Fixing some parsing ambiguities
- VM.Null special case value now has Types.Null type for consistency
- LSP related miscellaneous fixes
- Adding static functions and variables support which are only visible in the current module
- Adding support for automatic initialization of modules once they are loaded via static init() function
static int HashAnimIdle
static func init() {
HashAnimIdle = Animator.MakeHash("Idle")
}
v2.0.0-beta80
- Added actually working built-in function: wait(milliseconds):
yield wait(100)
- Added InsertAt(idx, value) method for arrays (thanks @MaxShcherbakov) :
[]int arr = [14]
arr.InsertAt(0, 42)
-
Added C# API to access global variables
-
Numerous LSP fault tolerant parsing improvements
-
Fixing potential bug related to order of release calls for Frame instances
-
Fixing bug related to super class and implemented interfaces setup for native class symbols
-
Adding C# VM.OnNewFiber public event
-
Added C# ValList.GetEnumerator() implementation (thanks @Greysnek)
v2.0.0-beta69
- Adding initial support for 'capture list' semantics in lambdas similar to Swift:
for(int i=0;i<3;i++)
{
start(func() [i] { // Here we explicitly say we want a copy of the i variable. By default all variables are captured by reference.
trace((string)i)
})
}
- Adding a basic built-in debugger() function which will make the C# debugger stop (if it's attached) on the line.
func test() {
debugger()
}
This allows for example to inspect local function variables.
There's no a full blown BHL debugger yet but it's better than nothing.
-
Adding a compile time check for potentially ambiguous import paths. If several files might be imported using the same import path (via project's search path) the compile time error is triggered
-
Adding native C# type to all native symbols for better reflection inspection
-
Fixing stack trace retrieval for some edge cases in paral blocks
-
Fixing potential bug when a module imports itself
-
Fixing unserialisation of generic arrays and maps from compiled modules
-
Adding better validation of static methods and attributes calls during compilation
-
Adding basic support for LSP diagnostics
-
Improving LSP server support on Windows
v2.0.0-beta57
- Adding more strict parsing of statements expected to be separated with newlines or ';'. For example the following code will trigger a parsing error now:
int a, int b FooBar()
There's '=' missing but the previous parser would consider this to be a valid code:
- declaration of int a, int b
- FooBar() call
The new parser now requires an explicit separator between these statements: newline or ';'
- Removing "circular references" detection heuristics since it's not generic enough. It will be fixed with introduction of "weak references" semantics (like in Swift)
- Splitting namespaces linking during imports into 2 phases: pre-linking and actual linking for proper order-independent imports
- Adding draft version of LSP hover support
- Adding string methods: .Count, .At(i) and .IndexOf(str)
func string Reverse(string a) {
string b = ""
for(int i=a.Count-1;i>=0;i--) {
b += a.At(i)
}
return b
}
func int IndexOfBar(string a) {
return a.IndexOf("Bar")
}
v2.0.0-beta52
- Parser fixes for some edge cases related to return statement
- Initial implementation of LSP's 'Find references'
- LSP's 'Go To Definition' now properly jumps to native C# bindings
- Draft version of LSP's semantic tokens
- Fix for a possible memory Val leak due to self circular references in cases as follows:
class Bar {
func() ptr
func Dummy() {}
}
func test() {
Bar b = {}
b.ptr = func() {
b.Dummy() //<-- b 'upvalue' self reference, b wouldn't be properly released upon scope exit
}
}