Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 4
    replit.com/languages/cpp is neither a REPL or an interpreter, unless you are using a very loose definition of REPL. Also, type safety is possible in an interpreted language just like type un-safety is possible in compiled C. Commented Jan 19, 2023 at 16:31
  • 2
    @9072997 well said! Cint / cling are proper interpreters though. And while I fully agree that type safety and compilation are in principle orthogonal, in practice strong static types do go more naturally with compiled languages, and are way more commonly used in those languages than in interpreted ones. Commented Jan 19, 2023 at 16:49
  • 5
    Most of this doesn't make sense. There is no such thing as a "compiled" or "interpreted" language. Every language can be implemented by a compiler and every language can be implemented by an interpreter. Interpretation and compilation are traits of the interpreter and compiler (duh!), not the language. If English were a typed language, the term "compiled language" would be a type error. Case in point: All current Ruby implementations are compiled, whereas interpreters for C++ exist. So, by this answer's logic, Ruby is more type-safe than C++, since there are no Ruby interpreters. Commented Jan 19, 2023 at 19:33
  • This answer does have some real problems. Compiling C++ is more than type checks these days. Technically, even C++98 was Turing-complete to compile, but modern C++ with if constexpr makes this common. Commented Jan 20, 2023 at 12:22
  • Somebody needs to do the work to make this happen. It is a more complex scenario so it is usually only done if there is nothing more useful the developers can create for the language. Commented Jan 21, 2023 at 4:00