Not Explicit
boats.gitlab.io
Not Explicit
1–10 of 35 posts
Re: Not Explicit
#2It seems like the narrow definition of “explicit” that the author uses is equivalent to “deterministic”. If that’s true, then “explicit” could always be replaced with a more precise alternative.
Re: Not Explicit
#3Re: Not Explicit
#4What a useful breakdown! It seems like the narrow definition of “explicit” that the author uses is equivalent to “deterministic”. If that’s true, then “explicit” could always be replaced with a more precise alternative.
“In computer science, a deterministic algorithm is an algorithm which, given a particular input, will always produce the same output, with the underlying machine always passing through the same sequence of states”
In turn what the author is saying is precisely what he says, no more, no less - explicit code is code whose behavior you can understand just by reading it, with no external context, like how the runtime currently works on a particular hardware.
The examples he gives are very clear as well. For example he claims to know the stack allocations that will happen just by looking at the definitions of the data types. You can’t know this on the JVM for example because the JVM does optimizations under the hood that the programmer cannot control or reason about. This doesn’t yield non-determinism. What happens is that the developer ends up programming for a higher level machine that hides some details of the underlying hardware.
Explicit isn’t always better than implicit, an argument that the author also makes.
Overall I find the article very compelling and I’ll be sure to use it for reference, as it’s what I also think, but with better words.
Re: Not Explicit
#5Rust is explicit because you can figure out a lot about your program from the source of it.
But as long as the source code conveys the information, it is still explicit in the narrow sense I defined above.
But if the thing will happen deterministically in a manner that can be derived from the source, it is still explicit in the narrow sense that I laid out earlier.
Source code conveys everything possible about your program in any language.
The best notion of "explicit" is captured by the critique of "local." Here's some nice ways in which Rust is more "local" than C++:
1. Macros require bang!s instead of C++ surprise-insides
2. References require &s and `mut &`s instead of C++ implicit references.
3. Int -> FP conversions require a typecast
In every case, both Rust and C++ allow you to discover the runtime behavior by reading the source code. But I would argue that Rust is more explicit than C++ in every case, wouldn't you agree?
A feature of Rust that is not implicit, but also not local, is method resolution
Isn't method resolution intimately tied to Deref coercion, which allows a type to implicitly (Rust's language) implement methods of another type? So method resolution seems like one of the more implicit features within Rust.
but all of it is explicit if you look at the impl blocks for Vec.
Well, all of Ruby's monkey-patching is explicit in the sense that you can find it if you know where to look.
It's a good effort to refine the meaning but "local" IMO is the best one!
Re: Not Explicit
#6> you can figure out a lot about your program from the source of it.
How does "implicit" not satisfy this condition? I can tell a lot about a program from the source of it implicitly as well.
Re: Not Explicit
#7What a useful breakdown! It seems like the narrow definition of “explicit” that the author uses is equivalent to “deterministic”. If that’s true, then “explicit” could always be replaced with a more precise alternative.
Re: Not Explicit
#8I didn't agree with this article's definition of "explicit," which feels tautological: Rust is explicit because you can figure out a lot about your program from the source of it. But as long as the source code conveys the information, it is still explicit in the narrow sense I defined above. But if the thing will happen deterministically in a manner that can be derived from the source, it is still explicit in the nar…
I disagree with this statement. Behaviour of the program will be determined by machine instructions that the compiler generates for a given source plus the machine environment where these instructions will be run. And it is not guaranteed that the generated instructions will be same for a given source across different architectures and environments that the compiler is run (plus I guess there is generally some degree of non-determinism in the compilers as well, because of the different optimizations it can make under different conditions, which are not "explicit" from the source itself).
As far I understood, in the notion of explicitness that is defined in the article, it is defined that the language where source almost completely specifies the behaviour of program, irrespective of the compiler environments where it is compiled on, is an explicit language.
I think in the sibling comment https://news.ycombinator.com/item?id=16034541 bad_user articulates more clearly the point I was trying to make.