←back to thread

82 points jacobx | 4 comments | | HN request time: 0.2s | source
1. jgbuddy ◴[] No.45130570[source]
Swift can already be used in REPL mode, not sure if it's accurate to say Swift is a strictly compiled language that a interpreter was developed for (see 'swift' command line executable). Seems misleading that this is not mentioned anywhere in the article.
replies(3): >>45130633 #>>45130663 #>>45130724 #
2. firloop ◴[] No.45130633[source]
++ had the same reaction as you. When I was picking up Swift, the interpreter was invaluable to check my understanding (although I nearly always needed to begin with `import Foundation` to have my code actually work).
3. jgbuddy ◴[] No.45130663[source]
I suppose you could argue the repl is not a true interpreter (parsing and executing from an AST)
4. lanza ◴[] No.45130724[source]
That's a JIT. It uses the same compiler infrastructure but swaps out the AoT backend and replaces it with the JIT backend in LLVM. Notably, this blog post is targeting on-device usage which a custom JIT is not allowed. You can only interpret.