Skip to content

Releases: nevalang/neva

v0.25.0

02 Jul 20:35
a298081
Compare
Choose a tag to compare

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.

v0.24.0

27 May 21:53
883a7ae
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.23.0...v0.24.0

v0.23.0

07 May 17:05
5c2f015
Compare
Choose a tag to compare

Removed net keyword

Before

component Main(start) (stop) {
    nodes { Println }
    net {
        :start -> println -> :stop
    }
}

After

component Main(start) (stop) {
    nodes { Println }
    :start -> println -> :stop
}

Motivation

While being less explicit and consistent with the rest of the language, it saves us one level of nesting which is about 2 lines per component. Also it looks more like a regular function with var block (it's nodes in our case) and "list of instructions in a body" (it's list of connections for us).

New image package in STDlib by @Catya3

New package with two public components: image.New and image.Encode. This package also have public types such as image.Image, image.Pixel and image.RGBA. This is stream-based API. Check out examples/image_png for a minimal example.

Also note that this is just the beginning. The goal is to make Neva language suitable for complex image processing. (It's still is and always will be general purpose language tho).

One-line multiple import

You are now allowed to import several packages in a single line by using ,, this is consistent with the nodes block syntax.

import { io, strconv }

However, old syntax (no ,, newline for each package) is supported and should be preferred when you have a lot of imports.

import {
    io
    lists
    strings
    strconv

    github.com/nevalang/x:foo
    github.com/nevalang/x:foo/bar
    github.com/nevalang/x:foo/bar/baz

    @:/utils
    @:/models/users
}

Rest

As usual little improvements and bug fixes in compiler here and there.

v0.22.0...v0.23.0

v0.22.0

04 May 15:45
cc76527
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.21.0...v0.22.0

v0.21.0

03 May 19:22
01ef0df
Compare
Choose a tag to compare

New Components

  • New http package with http.Get component by @Catya3
  • New List component in builtin that turns stream into list

Backward Compatibility Changes

  • x package was removed from std module
  • New strconv package was added
  • x.ParseNum was moved to strconv.ParseNum
  • x.Scanln was moved to io.Scanln
  • Reduce (decorator that allows stream processors like Add accept array-inport slots) was renamed to ReducePort
  • New strings package
  • Split and Join components were moved to strings package, they are now strings.Split and strings.Join respectfully
  • Index signature was updated to work with both lists and strings. Usage now looks like Index<list<T>> or Index<string>

Other

  • Bug fixes and improvements
  • Refactoring of internals

Full Changelog: v0.20.0...v0.21.0

v0.20.0

29 Apr 17:07
4c534e0
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.19.1...v0.20.0

v0.19.1

28 Apr 10:46
d55e088
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.19.0...v0.19.1

v0.19.0

26 Apr 16:44
dfea7f2
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.17.0...v0.19.0

v0.17.0

10 Apr 16:54
696b911
Compare
Choose a tag to compare

What's Changed

  • Runtime functions: get rid of select-hell and add few fixes by @emil14 in #548
  • Port-less connections (new syntax sugar) by @emil14 in #549
  • FileReader and FileWriter API by @Catya3 in #547
  • Refactor examples by @emil14 in #551
  • Parser: fix chained + deferred connection use-case by @emil14 in #550
  • Refactor: remove unused code in desugarer by @emil14 in #552

Port-less connections syntax sugar

Now you can omit in/out port name if there's only one port per side. E.g. instead of

42 -> println:data
println:sig -> :stop

You can now write

42 -> println
println -> :stop

This can be combined with chaining:

42 -> println -> :stop

Could be infinitely chained:

p1 -> p2 -> p3 -> ... -> pN

Deferred connections backward compatibility broken

You can't have multiple deferred connections in a single () expression anymore. E.g. you can't write code like this

:start -> (
    $l -> push:lst,
    $f -> push:data
)

But you still can (and always will be able to) write it like this

:start -> [
    ($l -> push:lst),
    ($f -> push:data)
]

Full Changelog: v0.16.0...v0.17.0

v0.16.0

07 Apr 18:44
19a19c7
Compare
Choose a tag to compare

What's Changed

  • New graphviz backend by @Catya3 in #540
  • New chained connection syntax sugar and massive renaming in stdlib by @emil14 in #533

On new syntax sugar

You can now chain connections where inport and outport has the same name. E.g. instead of

a:b -> c:d
c:d -> e:f

You can now just write

a:b -> c:d -> e:f

It's also possible to chain as many as you want

a:b -> c:d -> e:f -> g:h ...

On renaming in standard library

Basically I decided to use shorter names and ditch "er" endings, use function-like (verbs) names instead:

  • Emitter -> New
  • Destructor -> Del
  • Blocker -> Lock
  • StructBuilder -> Struct
  • StructSelector -> Field
  • Adder -> Add
  • Subtractor -> Sub
  • Multiplier -> Mul
  • Decrementor -> Decr
  • Printer -> Println
  • Fprinter -> Printf
  • PortStreamer -> PortSequencer
  • ISeqHandler -> ISeqReducer
  • PortBridge -> PortReducer
  • regexp.Submatcher -> regexp.Submatch
  • x.NumParser -> x.ParseNum
  • x.LineScanner -> x.Scanln

On Match and Mod

These two implement the same pattern, they had case array-inport and then array-outport. The outport is now also case. The reason is new "chained" syntax. Now we have a reason to name outport like inport where it's convenient.

Stream vs Sequence

Some components emit sequences of messages separated by delimiters, maybe type is used for that. The term used for that was "stream" and the thing is - it's a bad name for that. Classic FBP defines "stream" as messages that flows through connection. So streams are everywhere. The right word for that is "sequence". So stream ports were renamed to seq and word "sequence" must be used insted.

BTW the word for what is list and map is "collection". E.g. you can now find collections.neva file in stdlib module.

Handlers vs Reducers

The word for "component that takes sequence of type T and produce one value of that type T" is now reducer, now handler. Also PortBridge was renamed to PortReducer because of that. Handler was too vague term. Reducer is what is exactly is.


Full Changelog: v0.15.0...v0.16.0