nevalang / neva

🌊 Flow-based programming language with static types and implicit parallelism. Compiles to native code and Go
https://nevalang.org
MIT License
85 stars 7 forks source link

Alternative syntax for outports #639

Open emil14 opened 1 month ago

emil14 commented 1 month ago

Before

:data -> if
if:then -> ('true' -> println)
if:else -> ('false' -> println)
println -> :sig

After

:data -> if -> {
    :then -> ('true' -> println)
    :else -> ('false' -> println)
}
println -> :sig

TODO think about this a lot more, about downsides

emil14 commented 1 month ago

Probably only for cases where you use (send?) node (if in this case) only once

emil14 commented 1 month ago

Obv downside is that we have 2 different ways to do the same thing (again)

However, it could be handled by formatter

emil14 commented 1 month ago

Corner Case (Shadowing)

Beware of cases where you overwrite existing ports with childern's

:start -> foo -> { :start -> ... }