3 ms·
If it's not encoded in the language's specification, it's not a feature of the language but just an optimization. You can't rely on optimizations for correctnes
by mort96 2mo ago
If it's not encoded in the language's specification, it's not a feature of the language but just an optimization. You can't rely on optimizations for correctness.
- throwaway_95283 2mo agoin theory, no, in practice, yes.
- pfdietz 2mo agoBy "in practice" do you mean with one-implementation languages? If there's more than one implementation, there better be a standard, and it's risky to assume any behavior not specified in the standard will be shared by all implementations. Even with one-implementation languages it becomes risky to assume behaviors will remain the same as the implementation evolves.
- throwaway_95283 2mo agoi mean the whole ecosystem, compiler, CPU, etc. I think that the compiler will produce performant code, and i think that the CPU will execute code that operates a certain way faster, and that its pretty safe to assume this. Basically, I think that in 10 years, in practice, radix sort will still be faster than quicksort, despite theory saying its slower.
- pfdietz 2mo agoTheory says radix sort on a set of strings runs in time linear in the sum of the sizes of the strings.