New
0.4.0
The most notable features of this new release are:
- REPL
- WASM build and web REPL
- Tracing JIT
Here is the full changelog:
Added
- REPL (https://github.com/buzz-language/buzz/issues/17) available by running buzz without any argument
- WASM build (https://github.com/buzz-language/buzz/issues/142) and web REPL
- Tracing JIT (https://github.com/buzz-language/buzz/issues/134): will look for hot loops and compile them
- Tail call optimization (https://github.com/buzz-language/buzz/issues/9)
- Function argument names and object property names can be omitted if the provided value is a named variable with the same name (https://github.com/buzz-language/buzz/issues/204)
object Person {
str name,
str lastName,
}
const name = "Joe";
const lastName = "Doe";
before:
const person = Person {
name: name,
lastName: lastName,
};
after:
const person = Person {
name,
lastName,
};
- Sandboxing build options
memory_limitandcycle_limit(https://github.com/buzz-language/buzz/issues/182) - Block expression (https://github.com/buzz-language/buzz/issues/105):
var value = from {
| ...
out result;
}
recursive_call_limitbuild option limit recursive calls- Compiler will warn about code after a
returnstatement - Compiler will warn about unreferenced imports (https://github.com/buzz-language/buzz/issues/272)
namespace(https://github.com/buzz-language/buzz/issues/271): if a script exports at least one symbol, it has to define a namespace for the script withnamespace mynamespace- By default, imported symbols from another script will be under
libprefix.XXXX - When importing something, you can still redefine its namespace prefix with
import "..." as mynewnamespaceor remove it altogether withimport "..." _
- By default, imported symbols from another script will be under
- Ranges are now an actual buzz value (https://github.com/buzz-language/buzz/issues/170)
- new
rgtype myrange.toList()transforms a range into a list of integersmyrange.lowandmyrange.highto get a range bounds- works with
foreach
- new
list.fillstd.panicwill panic and print current stack trace- Loop can have labels that you can
breakorcontinueto (https://github.com/buzz-language/buzz/issues/199)
Changed
- Map type notation has changed from
{K, V}to{K: V}. Similarly map expression with specified typed went from{<K, V>, ...}to{<K: V>, ...}(https://github.com/buzz-language/buzz/issues/253) File.readLine,File.readAll,Socket.readLine,Socket.readAllhave now an optionalmaxSizeargument- Empty list and map without a specified type resolve to
[any]/{any: any}unless the variable declaration context provides the type (https://github.com/buzz-language/buzz/issues/86) - Function yield type is now prefixed with
*>:fun willYield() > T > Y?becomesfun willYield() > T *> Y?(https://github.com/buzz-language/buzz/issues/257) - Temporarily disabled
--treeand--fmt. The AST has been completely reworked and those feature will take some work to come back. math.randomremoved in favor ofstd.random
Fixed
- A bunch of crash after reported error. buzz tries to hit a maximum of syntax/compile errors by continuing after an error has been reported. This can lead to unexpected state and crash.
- Trying to resolve a global when only its prefix was provided would result in infinite recursion
- Forbid use of
yield/resume/resolvein the global scope - Would break on unfinished char literal
Note: No binaries are provided until I figure out https://github.com/buzz-language/buzz/issues/226