The most notable features of this new release are:
- REPL
- WASM build and web REPL
- Tracing JIT
Here is the full changelog:
Added
- REPL (#17) available by running buzz without any argument
- WASM build (#142) and web REPL
- Tracing JIT (#134): will look for hot loops and compile them
- Tail call optimization (#9)
- Function argument names and object property names can be omitted if the provided value is a named variable with the same name (#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,
};
var value = from {
| ...
out result;
}
recursive_call_limit
build option limit recursive calls- Compiler will warn about code after a
return
statement - Compiler will warn about unreferenced imports (#272)
namespace
(#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 mynewnamespace
or remove it altogether withimport "..." _
- By default, imported symbols from another script will be under
- Ranges are now an actual buzz value (#170)
- new
rg
type myrange.toList()
transforms a range into a list of integersmyrange.low
andmyrange.high
to get a range bounds- works with
foreach
- new
list.fill
std.panic
will panic and print current stack trace- Loop can have labels that you can
break
orcontinue
to (#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>, ...}
(#253) File.readLine
,File.readAll
,Socket.readLine
,Socket.readAll
have now an optionalmaxSize
argument- Empty list and map without a specified type resolve to
[any]
/{any: any}
unless the variable declaration context provides the type (#86) - Function yield type is now prefixed with
*>
:fun willYield() > T > Y?
becomesfun willYield() > T *> Y?
(#257) - Temporarily disabled
--tree
and--fmt
. The AST has been completely reworked and those feature will take some work to come back. math.random
removed 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
/resolve
in the global scope - Would break on unfinished char literal
Note: No binaries are provided until I figure out #226