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

Reduce noise when using ports by replacing `:` with `.` #651

Closed emil14 closed 1 month ago

emil14 commented 1 month ago

We use : to refer ports:

node:outport -> node:inport

The reason for that is that we need . to access struct fields:

node:outport.foo.bar -> ...

However, syntax for this might change with new #syntax for struct fields selection

node:outport -> .foo.bar -> node:inport

Proposal

How about this

node.outport -> .foo.bar -> node.inport

Downsides

I don't really like how self ports looks tho. But maybe that's just a habit?

.start -> .stop

Also we mix port refs with struct fields refs. However, conventional languages tend to use . for a lot of stuff too. E.g. Go uses it for both referring to package entities and struct fields

emil14 commented 1 month ago

I don't think I like it... Lol, : aren't bad at all actually. It's good to distinguish between ports and struct fields.

Go uses it for both referring to package entities and struct fields

Yeah but we going to use it for 3 things this way, which is even worse