nevalang / neva

🌊 Dataflow 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

Start port type #225

Closed emil14 closed 9 months ago

emil14 commented 1 year ago

First idea was to have Main<T> (start T) (exit int) but then in turns out that using of type-parameters makes no sense there because there's only one use-case always - runtime sends nil (or maybe something else) as a signal to kick execution. Runtime doesn't sends this value further. In other words - it would be easy to use to have simple fixed type for start port.

emil14 commented 1 year ago

Configurable start port

Add startMessage parameter and assume there will be start inport that will be triggered by the runtime but instead of sending pointless empty record or nil let it sends the message you want. It will make programming a little bit easier. E.g. - you don't have to use triggers and static ports to implement dreadful "program that does nothing". The same goes for "Hello world"

emil14 commented 1 year ago

Empty record

If we won't implement https://github.com/emil14/neva/issues/225#issuecomment-1483939203 or #143 then {} seems to be a good choice

emil14 commented 1 year ago

Any

143

emil14 commented 1 year ago

Configurable start ports

Same as https://github.com/nevalang/neva/issues/225#issuecomment-1483939203 but for any amount of ports

emil14 commented 1 year ago

Configurable ports via sugar

Implement https://github.com/nevalang/neva/issues/225#issuecomment-1613275228 but with the sugar stage. Desugar it into "root -> wrapper with constants -> actual logic"

emil14 commented 1 year ago

Do not implement

Just do same as de sugaring but manually - use const