7 ms·
Swift is not an interpreted language, AFAIK. So you mostly need an LLVM backend for your microcontroller. It might even exist already. That has almost nothing
by Tomte 11y ago
Swift is not an interpreted language, AFAIK.
So you mostly need an LLVM backend for your microcontroller. It might even exist already.
That has almost nothing in common with the MicroPython situation.
- schappim 11y agoSwift can be interpreted in it's repl.[1] [1] https://developer.apple.com/swift/blog/?id=18 https://developer.apple.com/swift/blog/?id=18
- sklogic 11y agoREPL is not an "interpreter" in any way. These are orthogonal concepts.
- schappim 11y agoNot that orthogonal... Like Python, Swift's interpreter is also it's repl. See: http://dev.iachieved.it/iachievedit/using-swift-as-a-scripting-language/ http://dev.iachieved.it/iachievedit/using-swift-as-a-scripti...
- sklogic 11y agoREPL is not an interpreter. 'E' in REPL does not imply any particular execution mode. It can be anything - direct interpretation, mixed mode (compilation + VM interpretation), native compilation - whatever. And, also, the notion of 'scripting' is orthogonal to these two. It got nothing to do with both a REPL functionality and interpretation. Scripting is a mode of using a language, not a runtime semantics.
- schappim 11y agoAll I'm saying is the same binary is acting as the interpreter and REPL for swift and Python, this is different to other languages. A good example is Ruby which has it's repl as a seperate binary 'irb'.
- sklogic 11y agoThere is no interpreter for Swift. At least not yet.
- schappim 11y agoAm I missing something from this article: https://medium.com/swift-programming/1-learn-swift-by-running-scripts-73fdf8507f4b#.1utumj3wa https://medium.com/swift-programming/1-learn-swift-by-runnin...
- sklogic 11y agoYes, unfortunately, there are far too many people who do not care about using correct terminology.
- schappim 11y agoIf /usr/bin/swiftc is the "swift compiler" what would you call the binary: /usr/bin/swift ?
- sklogic 11y agoIt is a Swift REPL. Do not confuse REPL with an interpreter.
- schappim 11y agoTo answer my own question: "swift" or "swiftc" w/o -frontend invokes the driver, which launches both the -frontend and other tools like ld. The Swift REPL (Read-Eval-Print-Loop) acts like an interpreter. Valid statements, expressions, and declarations are immediately compiled and executed.
- schappim 11y agoAlso just so I know I'm not going mad: https://www.google.com/#q=%22the+swift+interpreter%22 https://www.google.com/#q=%22the+swift+interpreter%22
- schappim 11y agosklogic is right.