Skip to content

v0.31.0

Latest
Compare
Choose a tag to compare
@emil14 emil14 released this 13 Feb 12:03
4d833b1

Neva is a new kind of programming language where instead of writing step-by-step instructions, you create networks where data flows between nodes as immutable messages, with everything running in parallel by default. After type-checking, your program is compiled into machine code and can be distributed as a single executable with zero dependencies.

It excels at stream processing and concurrency while remaining simple and enjoyable for general development. Future updates will add visual programming and Go interop to enable gradual adoption.

What's Changed?

This release extends standard library with new errors package plus contains some minor fixes for documentations (thanks our community). No backward incompatible changes so far.

errors package

New stdlib package errors added with 3 public components:

  • def New(data string) (res error) - creates a new error with the given text.
  • def Must<T, Y>(data T) (res Y) - converts a node that has an error outport to one that doesn't. It handles the error internally by panicking.
  • def Lift<T, Y>(data T) (res Y, err error) - converts a node that doesn't have an error outport to one that does. The error outport is fictional and will always be silent.

Example - Lift

// errors.Lift wraps handler so it behaves like a node with error outport.
def Main(start any) (stop any) {
    lift errors.Lift<any, any>{Handler}
    panic Panic
    ---
    :start -> lift
    lift:res -> :stop
    lift:err -> panic
}

// Handler doesn't have error outport.
def Handler(data any) (res any) {
    println fmt.Println<any>
    ---
    :data -> '42' -> println -> :res
}

Example - Must

// errors.Must wraps handler so it behaves like a node without error outport.
def Main(start any) (stop any) {
    println fmt.Println<any>
    must_handle errors.Must<any, any>{Handler}
    ---
    :start -> 'create_me.txt' -> must_handle -> 'success!' -> println -> :stop
}

// Handler have error outport.
def Handler(data string) (res any, err error) {
    write_all io.WriteAll?
    ---
    :data -> write_all:filename
    'Hello, io.WriteAll!' -> write_all:data
    write_all -> :res
}

Other Changes

New Contributors

Full Changelog: v0.30.2...v0.31.0

Important

This is an ambitious project maintained by a small group of enthusiasts. Your support by joining us will show interest and motivate us to continue.

Also, please give us a star ⭐️ to increase our chances of getting into GitHub's trending repositories and tell your friends about the project. The more attention Nevalang gets, the higher our chances of actually making a difference!