4 ms·
As a small note, Swift is a compiled language. It uses LLVM as a backend, same as Rust and Clang (C/C++/ObjC). It's currently listed under "Web & typed scriptin
by brandonasuncion 1y ago
As a small note, Swift is a compiled language. It uses LLVM as a backend, same as Rust and Clang (C/C++/ObjC). It's currently listed under "Web & typed scripting".
- jayrhynas 1y agoIt's definitely a blurry line, this `run` tool invokes your Swift file with `swift file.swift` which runs it in immediate mode. Technically it is compiling your code to memory and and immediately executing it, but is it that different from JIT in Python or Node scripting?
- brandonasuncion 1y agoIf you look at it that way, I agree. But then the same thing is done for executing Go, which is listed with the other compiled languages.
- saghm 1y agoI wonder if the mistake might stem from Go using a subcommand (i.e. `go run`, which might appear resemble `cargo run` or `dotnet run` at a glance) compared to providing the ability to run a "script" as a top-level command, which tends to be more common with interpreted languages (`node`, `python`, `irb`, `bash`, `lua`, etc.)
- likeclockwork 1y ago"compiled" isn't a property of a language. I think the distinction that both you and the author of the tool are making is always going to be messy. It seems to me that you're talking about the language itself via an imprecise description of a particular implementation.
- esubaalew 1y agoYou're right—Kotlin can be used as Kotlin/JS for web development, and as a compiled language when we're talking about Android development. Context matters
- esubaalew 1y agoYou're right—and the same applies to Kotlin. Swift is more like Rust, C, and C++ in that it compiles directly to machine code. So yes, Swift is currently listed under the wrong category. As for Kotlin, it could reasonably be placed under either "Web & scripting" or "Compiled," depending on how it's used. Since Kotlin can also compile to JavaScript, its classification depends on the context. If we're talking about Android development, then Kotlin is clearly a compiled systems language. To clarify: Swift is a compiled, statically typed systems language, much like Rust, C++, or Go. Its core toolchain (swiftc) compiles code into native binaries.
- 8n4vidtmkvmk 1y agoThis is a quirky response. Kotlin might be able to compile to JS the same way C++ can compile to WASM but I don't think that's it's primary purpose. Either put them in their idiomatic category or don't bother categorizing at all.
- generalenvelope 1y agoI'm pretty sure OPs reply is direct from an LLM
- esubaalew 1y agoadded note on the readme