Releases: WeirdConstructor/WLambda
v0.8.1
0.8.1 (2022-03-05)
This is a feature and documentation improvement release.
- Feature: (Optional) Embedded MQTT broker and client API for inter process
communication across WLambda applications. See that you compile in the
mqtt
feature and check outstd:mqtt:broker:new
andstd:mqtt:client:new
. - Feature: (Optional) HTTP Client API that supports GET for now. See
std:http:client:new
andstd:http:get
.
And alsostd:http:post
andstd:http:request
. - Feature: The LocalFileModuleResolver now does keep around the
loaded symbol table and does not re-evaluate the module source on every
import. This makes it possible to define global stuff inside the modules
and keep that around. - Feature: Default value operators
//
,/?
,/$n
,/$o
and/$e
added. Which can be conveniently used to provide default values in many useful
circumstances. - Feature: Stack traces now also contain the function arguments.
- Feature: Added
v_b
andv_bk
to the wlambda::VVal API. - Change: Error messages and stack traces more readable and with line feeds.
- Change: Improved parse and compile error output readability.
- Change: Vim syntax file does not define ':' as keyword character anymore.
- Change: Vim syntax file extended by more function combinators and
special operators like//
,/?
, ...
v0.8.0
0.8.0 (2021-07-28)
This is just a bugfix release.
- Bugfix: Code generation for direct blocks
if $true { !x = 3; x } $n
was broken. It unwound the locals while the return value was still referencing
those locals. No crash, just wrong results. Code became slightly faster too. - Bugfix: Catch
x % 0
and make a WLambda panic of that.
- Most current documentation can be found here: https://docs.rs/wlambda/newest/wlambda/prelude/index.html#wlambda-reference
- The live web version can be found here: http://wlambda.m8geil.de/
v0.7.1
0.7.1 (2021-05-25)
This release added mostly missing functionality. Like map
and filter
in the prelude
root namespace. And some functions that help when writing scripts for system administration
with WLambda. Most notably is probably the REPL live documentation that is compiled
into the wlambda
executable. Very handy for quickly looking up stuff from the
reference documentation.
- Most current documentation can be found here: https://docs.rs/wlambda/newest/wlambda/prelude/index.html#wlambda-reference
- The live web version can be found here: http://wlambda.m8geil.de/
See also the detailed changelog:
- Feature: Added
std:process:spawn
andstd:process:kill_wait
. - Feature: Added
std:process:wait
andstd:process:try_wait
for waiting it to exit. - Feature: Calling into EvalContext::eval*() can now be done
recursively. - Feature: Added simple UDP networking via
std:net:udp:new
,
std:net:udp:send
andstd:net:udp:recv
. - Feature: Added
map
andfilter
to the core language keywords. - Feature: The command line REPL can now search and display contents
of the reference manual with the?
command. - Feature: Implemented
std:str:edit_distance
utility function. - Feature: Added more filesystem related functions:
std:fs:remove_file
,
std:fs:remove_dir
andstd:fs:remove_dir_all
. - Change: VVal::new_fun() added.
- Change: Refactored the code base a bit.
- Bugfix: Panic on pair mutation (like on integer/float vector mutation).
- Bugfix:
$iter
iterators did not work with functions like
for
,filter
,map
andstd:fold
. - Bugfix: Fixed a crash in
std:fs:read_dir
. - Bugfix: panic in parser when a ';' was missed at the wrong place.
- Bugfix:
$F
formatters did eat whitespace and wlambda comments, which
was and is not intended. - Change: Improved vim syntax file.
Regex changes, Char/Byte Data Type, Networking
0.7.0 (2021-01-18)
This release comes with a huge load of new features. Most importantly: a new data type for
Unicode characters and bytes. Basic TCP networking, more regex features, binary utilities like std:bytes:pack
and many other small things. Also a few bug fixes.
- Most current documentation can be found here: https://docs.rs/wlambda/newest/wlambda/prelude/index.html#wlambda-reference
- The live web version can be found here: http://wlambda.m8geil.de/
See also the detailed changelog:
- Feature: Implemented
std:sys:os
andstd:process:run
. - Change: Regexes/Patterns allow more characters like
/
and!
to be used directly now. But only in the context of a single regex pattern like$r(foo/bar)
. This makes it easier to process text. - Change: Decided it's more idiomatic to use
if
instead of?
after all.?
will of course remain. - Optimization: Boxed debugging information, which made some benchmarks faster by 15%.
- Feature: Character and Byte literals
'c'
and$b'c'
were added.
With functions:is_byte
,is_char
. - Feature: Global regex matches with
$rg/.../
. - Feature: Global regex substitutions with
$rs/.../
. - Feature: Implemented
&or
and$and
for structure patterns (match
and$M
). - Feature: Commandline scripts with -e and file based evaluation get command line arguments via global variable
@@
now. - Feature: Added
std:bytes:pack
andstd:bytes:unpack
for handling binary data formats. - Feature: Added
std:fs:read_dir
,std:chrono:format_utc
andstd:chrono:format_local
. - Feature: Added XML parsing and writing functionality
std:xml:read_sax
andstd:xml:create_sax_writer
. - Feature: You can customize the
DefaultThreadCreator
easily with aDefaultGlobalEnvCreator
trait implementation which is conveniently provided byFunctionGlobalEnvCreator
. This makes embedding WLambda with threading easier. - Feature: Implemented
std:bytes:find
. - Feature: Extended syntax for string escapes by ASCII character names like
$b"\<STX>"
or$b"\<DEL>"
. - Feature: Added
std:str:from_latin1
andstd:str:to_bytes_latin1
to be able to convert bytes to/from ISO-8859-1 encoding in a more or less clean way. It allows better parsing of text protocols by converting them to strings directly. - Feature: Added
std:num:fract
. - Feature: Added basic TCP networking and sockets:
std:net:tcp:connect
,std:net:tcp:listen
,std:io:write
,std:io:write_some
andstd:io:read_some
. - Bugfix:
v.0 => v.1
did not parse correctly. - Bugfix: Calling
$i(...)
and$p()
without any arguments did not yield the called value itself.
Finishing the Function Reference Documentation
This release adds a few bits of functionality and finally completes the standard library
reference documentation. All standard library functions have now at least a small
note and/or example to show how to use it. You can read the documenation
here: https://docs.rs/wlambda/newest/wlambda/prelude/index.html#wlambda-reference
- Incompatible Change: Renamed
std:io:file:copy
tostd:fs:copy
. - Incompatible Change: Renamed
error_to_str
tostd:error_to_str
. - Documentation: Completed standard library function reference documentation.
- Feature:
std:rand :i64
now returns an integer in the full i64 range. - Feature: Implemented slicing operations for calling pairse and integer vectors
with vectors and iterators.
Operator assignment, Formatting and more Documentation
In this release there have been some new operators added. Most importantly
assignment operators .x += 10
. Also new operators for function application &@>
have been added and for collection appending/prepending +>
and <+
.
Another big addition is the string formatting $F"x={:8.2}" 10.32432
, which finally
makes string formatting a lot easier than by using just std:str:cat
.
Also check out the reference documentation, most functions now have at least
a short description and example.
- Bugfix: Selectors for recursive
$S(**/..)
did not process node conditions
right. - Bugfix:
!@import wlambda
did not work as expected, it should have the same
meaning as!@wlambda
. - Bugfix:
$i(...)
and$f(...)
constructions were done in the wrong order
if arguments were on the stack. - Bugfix: If a call in RPCHandle paniced, there was absolutely no error message.
- Change: Give proper error if a numeric vector is mutated.
- Change: Numerical vectors serialize to lists of numbers now instead some
custom Rust data structure serialization. - Change:
$code
now parses blocks directly. This means$code { ... }
will
only contain the text inside the curly bracktes but not the brackets themself.
This allows for more idiomaticstd:thread:spawn $code { ... }
syntax. - Feature: Added negative key match to recursive selectors
$S(**!key=childs)
to prohibit it to recurse into certain keys. - Feature: Added positive value condition to recursive selectors
$S(**=:{x=10})
to select only specific values to recurse into. - Feature: Added std:bytes:replace function.
- Documentation: Color conversion functions
std:v:rgb2hsv
,std:v:hsv2rgb
and others. - Documentation: Added documentation for
std:values
,std:thread:spawn
, - Documentation: Completely documented the currently implemented threading support.
fvec
,ivec
,is_ivec
,is_fvec
,is_nvec
,std:str:find
,std:ref_id
and many more. - Feature: Added debug print function special value, that includes source position and
dynamic type name:$DEBUG ...
. - Feature: Added
std:time:now
,std:srand
andstd:rand
. - Feature: Introduced variable and field assignment
operator syntax.x += 10
ando.x += 10
. - Feature: Added apply operators
&@>
and<@&
. - Feature: Added collection addition operators
+>
and<+
. - Feature:
std:values
also returns the individual elements of a numerical vector. - Feature:
std:keys
also returns the keys of a numerical vector. - Feature: Implemented
std:str:find
. - Feature: Implemented
std:write_str
. - Feature: Implemented custom WLambda string formatting, that even supports
writing numerical vectors, vectors or maps in a nicer formatted way.
See also$F
andstd:formatter
.
Changed Reference Semantics
- Incompatible Change: Reverted the weakable reference semantics with regard
to capturing. It's too unintuitive. You will have to invest the overhead
about which closures capture what and why. The other semantics are too
unpredictable. - Incompatible Change: Removed the extra value of drop function. They can
just as easily passed as upvalue. - Change: Previous weakable references are now called hidden references,
because they are automatically dereferenced on variable access. - Incompatible Change: Strong references are not implicitly dereferenced
on variable access anymore. - Incompatible Change:
iter $&&i
, which was a bad idea, was reverted.
New data structure match
This release adds one of the last big building blocks of WLambda: The new match
operation. It's quite fast, faster than using an if cascade of course.
Aside from that the pairs got an interesting new a => b
operator for
construction, which allows for syntactic sugar in some other places than just match
.
The stack space is finally dynamically grown now too.
- Incompatible Change: The nested parenthesis matching for quoted strings
was a bad design because you can't properly quote strings
with non matching parenthesis anymore - which is sometimes desired if a
regex pattern or selector pattern is to be quoted. - Incompatible Change:
a + b ~ c
is no longera + (b ~ c)
but(a + b) ~ c
to letiter i 0 => 10 ~ std:displayln i
work properly. - Incompatible Change: Removed old
match
function and replaced it with a
structure pattern match function, which is even faster than the match
before. - Feature: Allowing to use
if
instead of?
. - Feature:
iter $&&i ...
syntax implemented, for creating new references
for each iteration for easier closure generation. - Feature: Implemented pair operator
a => b
which does the same as$p(a, b)
. - Feature:
$iter $p(0, 10)
does now the same as$iter $i(0, 10)
, allowing
nice composition with the pair operator:$iter 0 => 10
. - Feature: Implemented argument function call operators
a &> f
andf <& a
,
so you can write regular expressions like? "foo" &> $r/a*b/ { ... }
without parenthesis. - Feature: Implementes structure patterns as complement to the selector patterns
and regex patterns:$M _expr_
. - Feature: Added a jump table operation
jump idx branch-a branch-b branch-c
as supporting operation formatch
. - Feature: Updates VIM syntax file
vim/wlambda.vim
. - Optimization: VVal size is down from 48 bytes to 32 bytes.
- Optimization: VM Op size is down from 40 bytes to 24 bytes.
- Bugfix: The stack size is no longer fixed and is dynamically grown if
required.
Rewrite to VM evaluator, Numeric Vectors, Selectors and Patterns
This has been the most significant update so far. The highlight is the new
evaluator based on a VM. And many other things, such as builtin patterns and
data structure selectors. And most notably: a contributed numeric vector implementation!
- Incompatible Change: VVal::Nul was renamed to VVal::None because it
was called$none
in WLambda anyways. - Incompatible Change: Renamed
padl
andpadr
topad_start
andpad_end
to make it more consistent naming totrim_start
andtrim_end
. - Incompatible Change: Renamed
neg
toneg_i64
,uneg
toneg_u32
. - Incompatible Change: Rewrote the complete threading implementation
of WLambda. - Incompatible Change: Replaced while statement in prelude with
while <cond> <block>
. - Incompatible Change:
zip
andenumerate
push their arguments
to the end of the argument list now. - Incompatible Change:
VVal::set_map_key()
has been removed and replaced by
VVal::set_key_mv()
. - Incompatible Change: Strings and byte vectors are immutable data types now.
- Incompatible Change: VValUserData::call takes an Env now instead of the
argument vector directly. - Incompatible Change: Replaced MsgHandle by wlambda::rpc_helper::RPCHandle.
- Potentially Incompatible Change: The compiler and evaluator was completely replaced
by a VM and code generator for it. - Change: Function arguments are stored in right order (function, arg1, arg2, ...) on the
stack now. This changes some of the argument handling and semantics of functions
that did depend on the other order. (zip
,enumerate
, ...). - Change: Added proper error location to errors generated from
prelude or other pure Rust functions. - Change: Added recently defined variable name or key to syntax positions
for functions. This might help finding the actual function where
the error occurred easier. - Change: $q and $Q recognizes nested parenthesis now:
$q{parses { nested } stuff now! Also [}] is fine}
. - Optimization: Removed many unnecessary String allocations.
- Feature: Numerical integer and float vectors for 2D, 3D and 4D by Cedric Hutchings.
- Feature: VValUserData can now define a
call_method(...)
trait function,
that will be called when a method call is invoked on the object:obj.method[...]
. - Feature: Added
not_i64
andnot_u32
. - Feature: Added compile time constant values:
!:const X = ...
. - Feature: Added if statement
? <cond> <then> <else>
. - Feature: Added
iter <var> <list-expr> <block>
statement. - Feature: Added
std:delete
added for removing elements from maps or vectors. - Feature: Added
std:num:lerp
andstd:num:smoothstep
added. - Feature: Added pair values
$p(a, b)
. - Feature: Added
$code <expr>
string literals for creating literal strings
from (syntax checked) code snippets in WLambda. - Feature: Implemented optional values
$o(...)
and$o()
for representing
function return values that need a better distinction
between$none
and really no value. - Feature: Implemented iterator values
$iter ...
that can either be called
directly of passed toiter
. - Feature: Symbols are now fully interned strings (per thread).
- Feature: Added color functions
std:v:hex2rgba_*
. - Feature: Implemented built in regex pattern matching using the
$r(...)
syntax. - Feature: Implemented built in data structure selector using the
$S(...)
syntax. - Feature: The result vector of a regex pattern or data selector can be
accessed conveniently with the variable$\
. - Documentation: More!
Adding `$data` alias for OOP and Vector Objects
0.4.1 (2020-02-28)
- Feature: Support for method calls on vectors.
- Feature: Added
$data
shorthand for$self._data
or$self.1
to access
object member data and encourage saving member data separately from the
class methods