Most active commenters
  • esubaalew(5)

←back to thread

96 points esubaalew | 12 comments | | HN request time: 1.037s | source | bottom

Hi HN — I’m learning Rust and decided to build a universal CLI for running code in many languages. The tool, Run, aims to be a single, minimal dependency utility for: running one-off snippets (from CLI flags), running files, reading and executing piped stdin, and providing language-specific REPLs that you can switch between interactively.

I designed it to support both interpreted languages (Python, JS, Ruby, etc.) and compiled languages (Rust, Go, C/C++). It detects languages from flags or file extensions, can compile temporary files for compiled languages, and exposes a unified REPL experience with commands like :help, :lang, and :quit.

Install: cargo install run-kit (or use the platform downloads on GitHub). Source & releases: https://github.com/Esubaalew/run

I used Rust while following the official learning resources and used AI to speed up development, so I expect there are bugs and rough edges. I’d love feedback on: usability and UX of the REPL, edge cases for piping input to language runtimes, security considerations (sandboxing/resource limits), packaging and cross-platform distribution.

Thanks — I’ll try to answer questions and share design notes.

1. brandonasuncion ◴[] No.45476081[source]
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".
replies(2): >>45476224 #>>45477791 #
2. jayrhynas ◴[] No.45476224[source]
It'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?
replies(1): >>45476546 #
3. brandonasuncion ◴[] No.45476546[source]
If 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.
replies(2): >>45476931 #>>45477016 #
4. saghm ◴[] No.45476931{3}[source]
I 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.)
5. likeclockwork ◴[] No.45477016{3}[source]
"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.
replies(1): >>45477801 #
6. esubaalew ◴[] No.45477791[source]
You'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.

replies(1): >>45477907 #
7. esubaalew ◴[] No.45477801{4}[source]
You'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
8. 8n4vidtmkvmk ◴[] No.45477907[source]
This 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.
replies(2): >>45477977 #>>45480055 #
9. generalenvelope ◴[] No.45477977{3}[source]
I'm pretty sure OPs reply is direct from an LLM
replies(2): >>45478092 #>>45480060 #
10. dstanko ◴[] No.45478092{4}[source]
most of replies from OP sure sound like it.
11. esubaalew ◴[] No.45480055{3}[source]
added note on the readme
12. esubaalew ◴[] No.45480060{4}[source]
I am not good at English. but I am sure my claim is correct and it my idea not LLM's