3 ms·
Correct me if I'm wrong, but describing core.async as "a library" isn't perfect in the context of a golang discussion. Doesn't the `go` macro rewrite the abstra
by afandian 11y ago
Correct me if I'm wrong, but describing core.async as "a library" isn't perfect in the context of a golang discussion. Doesn't the `go` macro rewrite the abstract syntax tree / JVM bytecode to make e.g. the `!<` macro co-operate with the channel?
https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/ioc_macros.clj https://github.com/clojure/core.async/blob/master/src/main/c...
That's not something that could be done with golang as far as I know.
- dgellow 11y agoI'm not sure to understand your point. Could your clarify?
- afandian 11y ago`hackcasual` was saying that certain language features can be added as a library rather than needing to be integrated into the core language > "fundamentally it's functionality other languages can provide via library support" You were saying that CSP can be added as a library, citing Clojure's core.async. All I was saying was that the way in which core.async was implemented doesn't feel like a great example of a 'library' in the sense that most people would understand in the context of a discussion about Golang. Golang is a static, compiled-to-machine-code language without macros (in the LISP or C sense) or homoiconicity. The reason core.async can be implemented as a library in Clojure is that it has these things. If you're talking about adding CSP to a language just by adding a library and without having to get into the internals of the language, core.async isn't a good example. Again, happy to be corrected.
- dgellow 11y agoWell core.async is a Clojure library so it uses features available in Clojure. I don't see how it would affect the fact that it is a library. I've also linked to js-csp, a JS library obviously not implemented using macros. I can also find other examples of implementation as libraries, but I have no experience with them: - Scala: https://github.com/rssh/scala-gopher https://github.com/rssh/scala-gopher - F#: https://github.com/Hopac/Hopac https://github.com/Hopac/Hopac - C++: http://www.cs.kent.ac.uk/projects/ofa/c++csp/ http://www.cs.kent.ac.uk/projects/ofa/c++csp/