Inferred gates? #66
Replies: 1 comment
-
The concurrency part of the specification was drafted initially and left as a rough outline until we refined some of the more foundational language syntax. Gates came after I wrote the concurrency documents. Initially I wanted to have the I am thinking of dropping manual queue management and using a built-in concurrency method akin to Goroutines, spawned off a keyword and managed with What I am currently thinking about is breaking the convention set by other languages with This would disconnect function main() {
async function(){
console.log('Hello World')
}()
await time.sleep(time.Duration.Second * 5)
} An alternative I was thinking about was using function main() {
async console.log('Hello World')
yield time.sleep(time.Duration.Second * 5)
} At this point I am mentally examining how this would fit in with the But yes callbacks, concurrent or not, will need to explicitly declare their gates to consume variables from an outer scope. function main() {
const foo = 'foo'
async function()[read foo]{
console.log(foo)
}()
await time.sleep(time.Duration.Second * 5)
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It's not instantly clear from the README why imported utilities or references, such as
queue
tasks don't require gates, but lamdas do for user defined, not imported, variables.As I believe this idea would be better off with zero globals around, wouldn't be easier to have outer-scope references infeered, hence with automatic gates around?
The possibilities to discuss would then be:
console.log
everywhere, even in lambdas/arrows, but I need explicit gates around other values?Thanks in advance for any kind of clarification/discussion/outcome 👋
Beta Was this translation helpful? Give feedback.
All reactions