diff --git a/blog/3-0.4.0-released.html b/blog/3-0.4.0-released.html new file mode 100644 index 00000000..0faf7d4a --- /dev/null +++ b/blog/3-0.4.0-released.html @@ -0,0 +1,204 @@ + + + + +0.4.0 released! – Wren + + + + + + + + + +
+
+
+

wren

+

a classy little scripting language

+
+
+
+
+ + +
+

0.4.0 released!

+

8 April 2021

+
+

This post is all about the 0.4.0 release since it’s a big one! +(A separate post for 0.5.0 goals would likely come later.)

+

0.4.0 details #

+

0.4.0 contains 145 commits from 28 contributors.

+

The full release notes +link to each PR or commit, and contains a lot more details than this post.

+

Goals +As usual, let’s revisit the goals from the 0.3.0 post.

+

Most importantly - compound operators didn’t land in 0.4.0 for various reasons. +Still working on it, it’s just a fun and nuanced problem and I don’t want to +keep 0.4.0 back cos of it.

+

With that out the way, let’s see what 0.4.0 contains!

+

0.4.0 highlights #

+

Below we’ll highlight some key features, fixes and improvements from the release.

+

A lot of work came from the community, much thanks to everyone contributing!

+

You can find all the details and the contributions in the release notes.

+

Take note!. There are two minor breaking changes in the API on the release notes.

+
+

Bug fixes #

+

Several important bugs have been fixed, sneaky stack corruptions and some user +experience fixes that clarify confusing states.

+

Documentation #

+

A lot of work has gone into documentation this release, revising, fixing, adding +and closing gaps that were left. For example, Wren supports multi-line strings +but this was never mentioned anywhere!

+

New continue keyword #

+

Loops can now use continue, which is a welcome addition.

+

New as keyword #

+

You can now use import "..." for Name as OtherName to avoid name conflicts, +or to use aliases/shorthand for imported variables.

+

Raw strings #

+

Wren now supports triple quotes for a string """.

+

This type of string is only unique in how it’s parsed, the content of the +string is ignored (no interpolation or escapes are processed), which allows +complex strings to be expressed without needing to escape things.

+

A common example is json or regex, where there’s a lot of escaping that obscures +the string content and makes it hard to read and maintain.

+

If they span multiple lines, the string ignores the open and closing newlines +and whitespace and preserves anything in between.

+
+var json = """
+  {
+    "hello": "wren",
+    "from" : "json"
+  }
+"""
+
+ +

Attributes #

+

Attributes are user-defined metadata associated with a class or method that +can be used at runtime, by external tools (and potentially by Wren itself).

+
+#hidden = true
+#doc = "A simple example class"
+class Example {}
+
+ +

They can be + - a #key on it’s own + - a #key = value + - a #group(with, multiple = true, keys = “value”)

+

Example

+

Below you can one obvious use case, a wip version where attributes for docs are +parsed and sent over to vscode to display.

+ + +

Runtime access
+By default, attributes are compiled out and ignored. +For an attribute to be visible at runtime, mark it for runtime access using an +exclamation:

+
+#doc = "not runtime data"
+#!runtimeAccess = true
+#!maxIterations = 16
+
+ +

Attributes at runtime are stored on the class itself. You can access them via +YourClass.attributes. If any attributes are made available, they’ll be found here:

+ +

All the details for Attributes can be found here.

+

chained methods fixes (‘fluent interfaces’) #

+

Mentioned in the last post, you can now use this pattern in code as intended, +the same-line requirement for the . has been removed.

+
+  example
+    .some()
+    .functions()
+    .here()
+
+ +

List additions #

+

Lists are now sortable via list.sort() and list.sort {|a, b| ... }. +You can find an index of something via list.indexOf(value), and remove a value +via list.remove(value). There’s also list.swap(index0, index1) for moving +items around within a list.

+

For the API, wrenSetListElement now exists, and both set and +wrenGetListElement now accept negative indices same as the language side.

+

Num additions #

+

A few new constants:

+ +

And some new methods on a number:

+ +

Map access from the API #

+

You can now create and access maps from the API:

+ +

Till next time #

+
+ +
+
+ + + diff --git a/blog/index.html b/blog/index.html index 8ea9bc00..2a3cc146 100644 --- a/blog/index.html +++ b/blog/index.html @@ -47,7 +47,11 @@

Development blogs

-

0.3.0 released!

+

0.4.0 released!

+
+

8 April 2021 • 0.4.0 is a big release, here’s all the info!

+
+

0.3.0 released!

5 June 2020 • 0.3.0 release info! Plus some notes and goals for the next release, 0.4.0.

diff --git a/blog/rss.xml b/blog/rss.xml index 642c45fb..7bd3a3e7 100644 --- a/blog/rss.xml +++ b/blog/rss.xml @@ -3,12 +3,19 @@ https://wren.io/ The development blog of the Wren programming language. en-us + + 0.4.0 released + https://wren.io/blog/3-0.4.0-released.html + 0.4.0 is a big release, here's all the info! + https://wren.io/blog/3-0.4.0-released.html + Thu, 08 Apr 2021 00:00:00 GMT + 0.3.0 released https://wren.io/blog/2-0.3.0-released.html 0.3.0 release info! Plus some notes and goals for the next release, 0.4.0. https://wren.io/blog/2-0.3.0-released.html - Mon, 30 Sep 2019 00:00:00 GMT + Mon, 05 Jun 2020 00:00:00 GMT 0.2.0 and beyond