4 ms·
I don't understand this take. Correct and fast are absolutely not mutually exclusive, wether it apply to tests or compilation. The rust compiler is not slow bec
by oreilles 3y ago
I don't understand this take. Correct and fast are absolutely not mutually exclusive, wether it apply to tests or compilation. The rust compiler is not slow because of all the checks it performs, it's slow because of the way those checks are implemented.
> If you want short compile times, use interpreted languages
Interpreted languages are not compiled, so this sentence doesn't make sense.
- diarrhea 3y ago> Interpreted languages are not compiled, so this sentence doesn't make sense. Usually it's a moot point, but in the context of the post it isn't. Python, Lua and JavaScript are compiled to bytecode / intermediate representations. That's compilation, but usually not mentioned, as it's so fast. However, in this context, that speed is the exact point. Use interpreted languages if compilation times (or lack thereof) are a concern! The lines are blurry though. C# and Java are also interpreted languages (compiled to intermediate representation, then executed on the language runtime aka VM; possibly JITed to native machine code), but no one calls them that.
- oreilles 3y agoThere is a very clear difference between compilation and interpretation: in scripting languages, a statement does not depend on the following ones to be executed, meaning that the code can just be read through. Compilation is different because the binary produced need to include the whole program, therefore the whole code has to be read and analyzed before the bytecode can be produced. Compile litterally means "group together". So compilation time obviously only applies to compiled languages. Saying that the compilation time is not a concern to you and shouldn't be to anyone is also very short sighted. I'm pretty confident that you would consider it to be a problem if a "Hello world" took a week to compile. Maybe you meant "Compilation is fast enough for me", which is fine, but there is no reason why your speed expectation should be more legitimate that anyone else's.
- naikrovek 3y agotook the words right out of my mouth. compilation speed matters. it matters to some more than others, obviously, but it absolutely matters, and to some it matters a great deal.
- rat87 3y agoThere is not a clear differentiation. For one thing just because the primary implementation is a compiler doesn't mean you can't also have an interpreter. There is no requirement that a compiler has to produce a binary. Compilers can also produce byte code or JavaScript or C code. Also very few languages are purely interpreted. Python, Ruby, and Pearl aren't (purely) interpreted. They're compiled to bytecode, then that bytecode is interpreted. At least for primary version there's also jvm/.net versions of python and ruby and pypy(jit). Compilation happens at import/run time. Emscripten uses llvm to compile c/c++/rust into JavaScript. Java and C# are recompiled into byte code which is then interpreted or jit compiled or both.
- mikebenfield 3y ago> in scripting languages, a statement does not depend on the following ones to be executed, meaning that the code can just be read through I'm pretty sure this is nonsense and is not a consistent way to distinguish languages that are considered scripting languages and languages considered compiled languages. > Compile litterally means "group together". Maybe so, but as a technical term in computer science, it means translate from one language to another. That said, I definitely agree that compile times matter.
- dragonwriter 3y ago> There is a very clear difference between compilation and interpretation: in scripting languages, a statement does not depend on the following ones to be executed, meaning that the code can just be read through. But most scripting languages are usually compiled (even if not to always AOT and not always to native code, but instead to bytecode of some kind), so how can a difference between compilation and interpretation, even if it was a valid one, be relevant here?
- 3y ago