Skip to content

Releases: WeirdConstructor/WLambda

v0.8.1

05 Mar 12:06
Compare
Choose a tag to compare

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 out std:mqtt:broker:new and std:mqtt:client:new.
  • Feature: (Optional) HTTP Client API that supports GET for now. See
    std:http:client:new and std:http:get.
    And also std:http:post and std: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 and v_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

28 Jul 18:40
Compare
Choose a tag to compare

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.

v0.7.1

25 May 12:21
Compare
Choose a tag to compare

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.

See also the detailed changelog:

  • Feature: Added std:process:spawn and std:process:kill_wait.
  • Feature: Added std:process:wait and std: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 and std:net:udp:recv.
  • Feature: Added map and filter 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 and std: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 and std: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

18 Jan 18:53
Compare
Choose a tag to compare

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.

See also the detailed changelog:

  • Feature: Implemented std:sys:os and std: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 and std:bytes:unpack for handling binary data formats.
  • Feature: Added std:fs:read_dir, std:chrono:format_utc and std:chrono:format_local.
  • Feature: Added XML parsing and writing functionality std:xml:read_sax and std:xml:create_sax_writer.
  • Feature: You can customize the DefaultThreadCreator easily with a DefaultGlobalEnvCreator trait implementation which is conveniently provided by FunctionGlobalEnvCreator. 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 and std: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 and std: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

06 Aug 04:31
Compare
Choose a tag to compare

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 to std:fs:copy.
  • Incompatible Change: Renamed error_to_str to std: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

20 Jul 13:57
Compare
Choose a tag to compare

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 idiomatic std: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 and std:rand.
  • Feature: Introduced variable and field assignment
    operator syntax .x += 10 and o.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 and std:formatter.

Changed Reference Semantics

04 Jun 18:44
Compare
Choose a tag to compare
  • 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

31 May 05:33
Compare
Choose a tag to compare

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 longer a + (b ~ c) but (a + b) ~ c
    to let iter 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 and f <& 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 for match.
  • 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

21 May 18:09
Compare
Choose a tag to compare

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 and padr to pad_start and pad_end
    to make it more consistent naming to trim_start and trim_end.
  • Incompatible Change: Renamed neg to neg_i64, uneg to neg_u32.
  • Incompatible Change: Rewrote the complete threading implementation
    of WLambda.
  • Incompatible Change: Replaced while statement in prelude with while <cond> <block>.
  • Incompatible Change: zip and enumerate 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 and not_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 and std: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 to iter.
  • 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

28 Feb 07:01
Compare
Choose a tag to compare

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