Skip to content

Commit

Permalink
Minor tweaks to the 24W release announcement.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinheghan committed Dec 16, 2024
1 parent 8b78941 commit 901079c
Show file tree
Hide file tree
Showing 26 changed files with 51 additions and 50 deletions.
25 changes: 13 additions & 12 deletions articles/161224_gren_24w.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Gren 24W: Streams, static executables and the compiler as a package"
published: "2024-12-16"
---

A new version of the Gren programming language is now available. There are some changes in syntax, an option of compiling to a static executable, a rewrite of the Stream and String modules and parts of the compiler are now available in package form.
A new version of the Gren programming language is now available. There are some changes in syntax, an option for compiling to a static executable, a rewrite of the Stream and String modules and parts of the compiler are now available in package form.

## What is this 24W thing?

Expand Down Expand Up @@ -45,7 +45,7 @@ when String.toInt "42" is

The rationale here is simply that `when is` reads better.

A change with bigger impact is that custom types are now limited to either 0 or 1 argument, where they previously could have many more.
A change with bigger impact is that custom types are now limited to either 0 or 1 parameters, where they previously could have many more.

Code like this is no longer valid:

Expand All @@ -59,13 +59,13 @@ If you want to associate multiple fields with a variant, you can use a record in
type Person = Person { name : String, age : Int }
```

The reasoning is the same that lead to the [removal of tuples](https://youtu.be/Sl9HHo1qDk0?si=wiJjSEMyl0f6HqTn). Positional arguments
leads to cryptic and brittle code where named arguments don't.
The reasoning is the same as what lead to the [removal of tuples](https://youtu.be/Sl9HHo1qDk0?si=wiJjSEMyl0f6HqTn). Positional parameters
leads to cryptic and brittle code where named parameters don't.

## Static executables

The rewrite of the compiler from Haskell to Gren continues with a slow but steady pace. In 24W the command line interface
of the compiler has rewritten in Gren. As we like to add new features while doing a rewrite, there's now a new command that gives you the
The rewrite of the compiler from Haskell to Gren continues at a slow but steady pace. In 24W the command line interface
of the compiler has been rewritten to Gren. As we like to add new features while doing a rewrite, there's now a new command that gives you the
option of compiling a Gren program to a static executable.

If you compile a program with `make-static` a couple of interesting things will happen.
Expand All @@ -74,10 +74,10 @@ First, it will compile your program to a JavaScript bundle using the `--optimize
instance you're using to run the Gren compiler, stopping just shy of invoking the main function. The in-memory representation of your
program at this point will be saved to disk as a snapshot, and then injected into a copy of the NodeJS executable.

This copy is your static executable. When run it will start up faster, as much of the costs associated with initialization -- like parsing
the JavaScript, evaluating constants etc. -- has already been done when building the snapshot.
When executed, your program will start up faster, as much of the costs associated with initialization -- like parsing
JavaScript, evaluating constants etc. -- has already been done when building the snapshot.

How much faster your static executable will run depends on the size of your program. We've seen anything from 10-25%.
How much faster your static executable will run depends on the size of your program. We've seen anything from 10-25% improvement in startup time.

Robin held a demo of this feature in [A Tour of Gren 24W](https://www.youtube.com/watch?v=eNx-2jSbejI&t=1080s).

Expand All @@ -86,7 +86,7 @@ Robin held a demo of this feature in [A Tour of Gren 24W](https://www.youtube.co
When reading a large file from the filesystem, or when retrieving a large payload over HTTP, you typically receive a couple kilobytes at a time instead of the entire thing all at once.
Streams allows you to perform operations on these chunks as they come in, instead of waiting to perform the operation until you have the entire payload, saving both time and memory.

In 24S there was a `Stream` module in `gren-lang/node`, but functionality was limited and the only available streams where the standard input streams for communicating with the terminal.
In 24S there was a `Stream` module in `gren-lang/node`, but functionality was limited to simple reads and writes and the only available streams where the standard input streams for communicating with the terminal.

For 24W the `Stream` module has been completely rewritten, giving you the possibility of defining your own streams over arbitrary types, and the option of combining several streams to a single pipeline.
The module has also moved to `gren-lang/core`, meaning you can use streams no matter which platform you're targetting.
Expand All @@ -96,7 +96,7 @@ decompression and converting between strings and bytes.

You can also use stream pairs to create a line of communication between different parts of your code.

For more information, [read the documentation of the `Stream` module](https://packages.gren-lang.org/package/gren-lang/core/version/6.0.0/module/Stream).
For more information you can [read the documentation of the `Stream` module](https://packages.gren-lang.org/package/gren-lang/core/version/6.0.0/module/Stream).

## String rewrite

Expand All @@ -116,7 +116,8 @@ renamed to `mapAndKeepJust` and `flatMap` to `mapAndFlatten`.
has been renamed to `count`.
* `Node.endWithCmd` has been replaced with `Node.endSimpleProgram`.
* The time-travelling debugger has been removed.
* The `ChildProcess` module has seen some incremental changes to fix a design mistake and to support `Stream`.
* The `ChildProcess` module has seen some incremental changes to fix a design mistake and to support streams for communication between processes.
* The `FileSystem` module now has functions for opening files as streams.
* Fixed a few sourcemapping bugs when compiling on a Windows system.

## Thank you, contributors
Expand Down
2 changes: 1 addition & 1 deletion docs/news/161224_gren_24w/content.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions docs/news/161224_gren_24w/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/220530_first_release/content.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/220530_first_release/index.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/221212_hello_nodejs/content.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/221212_hello_nodejs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/230315_testing_testing/content.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/230315_testing_testing/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/230619_sourcemaps/content.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/230619_sourcemaps/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/240321_gren_in_gren/content.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/240321_gren_in_gren/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/240624_gren_04/content.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/240624_gren_04/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/240724_announcing_core_team/content.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/240724_announcing_core_team/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/240819_upcoming_language_changes/content.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/240819_upcoming_language_changes/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/240826_gren_045/content.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/240826_gren_045/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/news/content.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/news/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<title>Gren news</title>
<description>News from the Gren core team</description>
<link>https://gren-lang.org/news</link>
<lastBuildDate>Mon, 16 Dec 2024 11:28:28 +0000</lastBuildDate>
<lastBuildDate>Mon, 16 Dec 2024 11:44:16 +0000</lastBuildDate>
<generator>elm-pages</generator>
<item>
<title>Gren 24W: Streams, static executables and the compiler as a package</title>
<description>A new version of the Gren programming language is now available. There are some changes in syntax, an option of compiling to a static executable, a rewrite of the Stream and String modules and parts of the compiler are now available in package form.</description>
<description>A new version of the Gren programming language is now available. There are some changes in syntax, an option for compiling to a static executable, a rewrite of the Stream and String modules and parts of the compiler are now available in package form.</description>
<link>https://gren-lang.org/news/161224_gren_24w</link>
<guid>https://gren-lang.org/news/161224_gren_24w</guid>
<pubDate>Mon, 16 Dec 2024 00:00:00 GMT</pubDate>
Expand Down
4 changes: 2 additions & 2 deletions docs/news/index.html

Large diffs are not rendered by default.

0 comments on commit 901079c

Please sign in to comment.