[swift-evolution] Run Swift code at compile time

sean+swift-evolution at lsr.li sean+swift-evolution at lsr.li
Wed Dec 23 03:35:14 CST 2015


While I haven’t reviewed the videos in full I noticed a similar approach being taken in Rust where some more ambitious work is being done by the core team in libraries that use compiler plugins (https://doc.rust-lang.org/stable/book/compiler-plugins.html <https://doc.rust-lang.org/stable/book/compiler-plugins.html>) such as regular expressions (https://doc.rust-lang.org/regex/regex/index.html <https://doc.rust-lang.org/regex/regex/index.html>). In the latter case even throwing compilation errors if the source file contains an invalid regular expression.

I suppose however that this is at best a Swift 3.1 feature to expose such interfaces once the dust from Swift 3 has settled. I may also be wrong that this is not a goal for Swift in the medium term at all.

Seán

> On 22 Dec 2015, at 23:29, Matt Whiteside via swift-evolution <swift-evolution-request at swift.org <mailto:swift-evolution-request at swift.org>> wrote:
> 
> I don’t know if something like this has been done before, but I agree, the idea of the compile time version of the language being the same same as the runtime version, is very interesting. +1.
> 
> Matt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151223/0d50786c/attachment.html>


More information about the swift-evolution mailing list