Skip to content

v0.25.0

Latest
Compare
Choose a tag to compare
@emil14 emil14 released this 02 Jul 20:35
· 125 commits to main since this release
a298081

It was almost a month after we've released the last version of the language. All this time we've been doing some heavy-lifting. We still need to do it, but bright future is closed day by day. So, what was going on?

Behold, this is the biggest Nevalang release so far!

New Runtime Implementation

In order to fix out-of-order delivery issue with fan-in connections we've completely changed the way runtime operates.

New algorithm properly handles fan-in messages thanks to atomic counter that is used to mark each message when it's sent. With this approach we can serialize messages and deliver them in the same order they was sent. However, out-of-order might still happen in more complex cases. Please see #689 for more details.

New Runtime Functions API

With massive runtime rewrite we've also changed how runtime functions interact with the runtime. New API is much simpler and safe than the old one. You don't have to handle context cancelation manually or iterate over array port slots. No more interactions with the raw go channels. Checkout how runtime functions look now, it's about x1.5 less code!

Fan-Out Connections are now Syntax Sugar

With new design runtime can properly handle fan-in connections but can't handle fan-out. Thankfully this is solved by removing fan-out from low-level program representation completely. Fan-out connections now only exist as syntax sugar in high level representation. Compiler desugarer transforms fan-out connections to regular pipelines with new FanOut component in standard library. This component has the following signature:

pub flow FanOut(data any) ([data] any)

Graph Reduction Optimization (WIP)

Implemented algorithm that can turn IR (low-level program representation) graph into much smaller but functionally equal one. It is disabled now and needs a little bit more testing. We will enable it by default or under feature flag in next releases.

Performance Boost

Last, but not least - with new runtime Nevalang v0.25 is faster than v0.24 by approximately two orders of magnitude. I didn't do any benchmarks but examples/99_bottles runs x200 times faster that before... And this is without graph reduction enabled!

Crazy thing about this is that this improvement is accidental! Our goal was to me it correct, not fast. However, performance improvement can be seen by naked eye.

Another funny thing is that now, when runtime works so fast, it's possible to spot new issues that cannot occur when program works slowly. New issues are described in #689.