Skip to content

Concurrency as first-class citizen #2312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tinganho opened this issue Mar 12, 2015 · 5 comments
Closed

Concurrency as first-class citizen #2312

tinganho opened this issue Mar 12, 2015 · 5 comments
Labels
Out of Scope This idea sits outside of the TypeScript language design constraints Question An issue which isn't directly actionable in code Suggestion An idea for TypeScript

Comments

@tinganho
Copy link
Contributor

I'm just interested if you got any plans of implementing concurrency to TypeScript?

@DanielRosenwasser DanielRosenwasser added the Question An issue which isn't directly actionable in code label Mar 12, 2015
@DanielRosenwasser
Copy link
Member

any plans of implementing concurrency

That can mean a lot of things - you mean like #1664?

@tinganho
Copy link
Contributor Author

@DanielRosenwasser I was more meaning multi-threading, to be able to spawn processes directly without requiring any library.

@tinganho
Copy link
Contributor Author

@DanielRosenwasser and also have an effective way of message passing. Ala go style.

package main

import "fmt"

func main() {

    // Create a new channel with `make(chan val-type)`.
    // Channels are typed by the values they convey.
    messages := make(chan string)

    // _Send_ a value into a channel using the `channel <-`
    // syntax. Here we send `"ping"`  to the `messages`
    // channel we made above, from a new goroutine.
    go func() { messages <- "ping" }()

    // The `<-channel` syntax _receives_ a value from the
    // channel. Here we'll receive the `"ping"` message
    // we sent above and print it out.
    msg := <-messages
    fmt.Println(msg)
}

@tinganho
Copy link
Contributor Author

This is how spider lang (a compile to JS lang) have implemented their channels http://spiderlang.org/#channels

@DanielRosenwasser
Copy link
Member

See my answer on #1686.

In general, I don't think anything has changed since then. We don't really try to supply a facility to extend runtime capabilities, so things like that generally fall out of scope.

@DanielRosenwasser DanielRosenwasser added the Out of Scope This idea sits outside of the TypeScript language design constraints label Mar 12, 2015
@RyanCavanaugh RyanCavanaugh added the Suggestion An idea for TypeScript label Mar 17, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Out of Scope This idea sits outside of the TypeScript language design constraints Question An issue which isn't directly actionable in code Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants