Skip to content

Releases: dgkf/R

v0.4.0

06 Aug 22:36
aee4c8f
Compare
Choose a tag to compare

"Wonder Where We Land"

Note

see the release blog post with interactive examples

New ✨: docs pages, with interactive code - see paste()
As Always: a live repl in your browser to test out the release

Changes

  • Improved vector internals: Will not internally avoid copies when possible, leaning on mutable views for in-place modification
  • Localized keywords: The parser can now perform in-place translation of language keywords
  • Metaprogramming updates: Now with eval, quote and substitute, and in the process stress-testing of the non-standard evaluation model

Usability Enhancements

  • The console REPL and browser REPL both now do syntax highlighting and input validation
  • The browser REPL can accept flags using url query parameters and encode snippets in urls for sharing
  • _ can be included in numerics for readability

Notable Bug Fixes

  • Parser fixes to allow whitespace between some more operators
  • Promises will get masked by materialized values upon modification
  • Nested promises will now evaluate lingering tail calls upon evaluation
  • Negation operator (!) now implemented, after getting overlooked

and many more in the full changelog: v0.3.1...v0.4.0

New Contributors

v0.3.2

12 Oct 03:53
Compare
Choose a tag to compare

"Eurydice"

Changes

  • tracebacks added to output upon error

Notable Bug Fixes

  • Many control flow keywords (repeat, while, for) now properly handle internal Tail return types introduced to handle tail recursion. They will now properly be evaluated within the keyword block.
  • if-else blocks now will correctly parse trailing newlines as the start of a new branch expression when no else clause is provided.

Internals

  • Many internal panic!s have been further moved to captured errors.
  • Closures of Symbols (an approximation for Promises) will now evaluate a bit more quickly by avoiding adding frames to the call stack.
  • Closures that propegate to a nested call will no longer introduce a new wrapping Closure, instead propegating the existing Closure value and avoiding the extra layer of indirection.

Development Updates

  • Binary builds are now incorporated into the PR actions (and hopefully, if all goes as planned, they'll also be published for this release). Special thanks to @eitsupi for the help getting these set up.

Full Changelog: v0.3.1...v0.3.2


edit: Sorry for floating this tag forward a few commits. It was the easiest way to get the release binary publishing working. It is not the intention of this project to have a culture of moving release tags regularly, so hopefully now that releases are being published this is the last time.

v0.3.1

10 Oct 00:09
Compare
Choose a tag to compare

"Art Smock"

Major Changes

  • License was changed to be GPL-3. The contributor license agreement (CLA) used in the development repository will remain in place with a grace period for comment. With it comes a copyright and warranty disclaimer as recommended in the GPL, which should make long-time R users feel right at home.

  • Added simplest-case destructuring assignment.

    (x, y) <- list(a = 1, b = 2)
    x
    # [1] 1
    y
    # [1] 2
  • return keyword introduced (this is unlike R's return() primitive, and this might change back to using a return() primitive in the future)

Experiments

This release introduces "experiments", which are feature-gated behaviors. This release introduces two to start:

  • tail-call-optimization, when enabled, will handle tail calls without extending the call stack, but with the possibly unexpected behavior of eagerly evaluating arguments to the call.

  • rest-args, when enabled, introduces the ability to name ellipsis arguments and to unpack lists into function calls.

Notable Bugs Addressed

  • for loop off-by-one error corrected.

Internals

  • Many panic!s where replaced with proper errors.

  • Introduced the start of destructuring assignment.

  • Added Tail and Return Signal variants, which are used to raise returns back to the calling frame (the calling function). Return is used to return values and Tail is used to return the tail expression for potential tail call optimization.

v0.3.0

29 Sep 20:21
4e60cd9
Compare
Choose a tag to compare

As always, you can try out the latest development release online.

"Days of Abandon"

Major Changes

  • Vector indexed assignment (x[1:3] <- 10) is now supported! What's more,
    it avoids intermediate replications of the vector by keeping track of the
    indexing operation as a "view" of the vector.

    x <- 1:10
    x[2:8][2:5][[2]] <- 1000
    x
    # [1]    1    2    3 1000    5    6    7    8    9   10
  • Mutating assignment implemented for Lists, including by named index.

    x <- list(a = 1, b = 2, c = 3, d = 4, e = 5)
    x[2:3][[1]] <- 200
    x[1:4][c("d", "c")] <- 1000
    x
    # list(a = 1, b = 200, c = 1000, d = 1000, e = 5)

Internals

  • "altreps" are now supported internally, though currently only a "Subset"
    (used for indexed assignment) is implemented.

  • Lists were reworked to use a HashMap of named values, allowing for
    more immediate access to named values without repeated traversals of a
    vector of pairs.

v0.2.0

26 Aug 20:56
63a50ac
Compare
Choose a tag to compare

"In Bloom"

Major Changes

  • Primitives are now more consistently handled, allowing them to be reassigned like any other function object. Prior to these enhancements, primitives would only be used for calls to specifically named symbols.

    f <- paste
    f("a", c("b", "c"))
    # [1] "a b" "a c"
  • A call stack with proper call frames is now added, paving the way for improved error messages and the implementation of R's metaprogramming tools.

    You can view the call stack by introducing a callstack() call:

    f <- function(...) list(..., callstack())
    f("Hello, World!")
    # [[1]]
    # [1] "Hello, World!"
    # 
    # [[2]]
    # [[2]][[1]]
    # f("Hello, World!")
    # 
    # [[2]][[2]]
    # list(..., callstack())
    # 
    # [[2]][[3]]
    # callstack()
  • Even more primitives now implemented! This release brings paste() and callstack() (akin to R's sys.calls())

Behind the Scenes

  • Primitives are now all implemented as dyn Primitive objects, implementing a Callable trait. They still don't have a proper standard library namespace, and are discovered only if not found in the environment (or its parents), but this paves the way for treating primitives more like user-defined functions.

Thanks to our new contributors!

@armenic (#16)