Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ukj
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
22 ms
·
181.
▲
by
ukj
5y ago
>But an implementation of that strategy in terms of table lookups is dynamic—it's walking a data structure to retrieve values which were specified in the runtime configuration, not at compile time. That's precisely the point. Y
182.
▲
by
ukj
5y ago
What C++, Haskell, Rust, Go etc. call "dynamic dispatch" is what a router calls "static routing". The defining characteristic is that the lookup table is pre-determined and immutable at runtime. What routers call "d
183.
▲
by
ukj
5y ago
In English there seems to be the eternal confusion between what things are and what we call them. When a router does lookups from a static table it's "static routing". When Java does lookups from a static table it's &quo
184.
▲
by
ukj
5y ago
It turns out "dynamic dispatch" is not as well established or as clear as you insist. It means at least one of five things: 0. Dynamic dispatch (as you are using it) 1. Double dispatch 2. Multiple dispatch 3. Predicate dispatch 4.
185.
▲
by
ukj
5y ago
There's also no such thing as "standard use" of terms. Your dogma has a name. Linguistic prescriptivism ( https://en.wikipedia.org/wiki/Linguistic_prescription ) If there was a "standard use" l
186.
▲
by
ukj
5y ago
Hah! No wonder you don't grok my perspective. If you derive a C++ compiler that accepts file A as valid C++. And I derive a C++ compiler that rejects file A as valid C++, then from the lens of type theory the two compilers have differe
187.
▲
by
ukj
5y ago
There is a legitimate confusion indeed and it seems to be on your part! What I am talking about when I say "dynamic dispatch" is the sort of dispatching done by R, LISP and Julia (and not by C++ or Java). Now, we can bicker about
188.
▲
by
ukj
5y ago
>Dynamic dispatch is not terribly overloaded. It's dispatching based on run-time information instead of just compile-time information. According to the above definition C++ does not have dynamic dispatch! The vtable in C++ is gene
189.
▲
by
ukj
5y ago
There is no such thing as a "standard" model of computation, and therefore no such thing as "standard definition" or use of computation. There is only the model you (and your tribe) believe is "standard" impl
190.
▲
by
ukj
5y ago
This is a commendable approach. Computation is a general, abstract and incredibly useful idea disconnected from any particular model of computation (programming language). Different languages are just different models of computation and hav
191.
▲
by
ukj
5y ago
>If you're going to reply, please explain why an organization that Bjarne Stroustrup is a director of believes that C++ supports dynamic dispatch. Because the meaning of "dynamic" is ambigous! Since you are pointing me to
192.
▲
by
ukj
5y ago
I am interested in computation. Period. Not any particular model of computation (programming language); and not merely computation with functions from N->N. Quoting from " http://math.andrej.com/2006/03/27&#
193.
▲
by
ukj
5y ago
I am using a perfectly sensible notion of "dynamic" (e.g NOT static) when I am talking about "dynamic dispatch". Registering pointers to new implementations at runtime (adding entries to the dispatch table) Unregistering
194.
▲
by
ukj
5y ago
So which textbook contains the meaning of "meaning"? Oh, that's recursive! Which is Computer Science's domain of expertise, not the public domain. We are talking about formal semantics here. What do programs (and compute
195.
▲
by
ukj
5y ago
It may be wrong in your model/interpretation of my words, but it's not wrong in my interpretation of my words.
196.
▲
by
ukj
5y ago
“Well established” doesn’t mean anything. According to who? Computer scientists talk about “well formed” not “well established”. Those are categorical definitions.
197.
▲
by
ukj
5y ago
Why not? Compilers are computable functions. If “Parsing is validation, but validation is not parsing” is true then it is also true about compilers.
198.
▲
by
ukj
5y ago
I am using a conception (NOT a definition) that is actually dynamic. If you can type-check your dispatcher at compile time then there is nothing dynamic about it. Decidable (ahead of time) means your function is fully determined. Something
199.
▲
by
ukj
5y ago
So, there is nothing dynamic about that dispatch. Because the implementation details of Foo are actually know at compile time. Which is why you are able to type-check it. You have literally declared all allowed (but not all possible) implem
200.
▲
by
ukj
5y ago
Yes this is precisely what I am talking about. Different implementations of eval() a.k.a different programming languages have different semantics. Which implicit eval() implementation does the above hold? What type system do you have in min
201.
▲
by
ukj
5y ago
No, it doesn’t. The input-data to the compiler can’t be handled by the JVM and vice versa. The JVM handles byte code as input. The compiler handles source code as input. That is two different functions with two different data domains. They
202.
▲
by
ukj
5y ago
The point is trivial. You can’t have both static type safety AND dynamic dispatch at the same time and in the same context about the same data. Choose one. Give up the other. Make a conscious trade off. The language that you are using is ma
203.
▲
by
ukj
5y ago
I certainly don’t disagree (that doesn’t mean I agree). The purpose of the conversation is to arrive at mutually acceptable interpretation.
204.
▲
by
ukj
5y ago
Perfect! Please produce a piece of code (in a language such as Coq or Agda) which proves whether any given piece of random data has the type “C++ compiler” or “C++ program”. That is the epitome of static type-checking, right?
205.
▲
by
ukj
5y ago
Are you sure you know when type-checking and when dynamic dispatching happens? Compile time is not runtime. The Java compiler is not the JVM. The compiler does type checking. The JVM does the dynamic dispatching. Neither does both.
206.
▲
by
ukj
5y ago
There is something stopping you from running the proof against your implementation! Proof-checking happens only at compile time. The implementation that you want to prove things about is only available at runtime! Non-availability (incomple
207.
▲
by
ukj
5y ago
Deciding which implementation of a function handles any given piece of data at runtime. Trivially, because you don’t have this knowledge (and therefore you can’t encode it into your type system) at compile time.
208.
▲
by
ukj
5y ago
But it doesn’t static-type-check that particular code-path. Because it can’t.
209.
▲
by
ukj
5y ago
You must be strawmanning my position to make this comment. Obviously static type systems are useful. I don't even think my point is contrary to anything you are saying. This is not being said as way of undermining any particular paradi
210.
▲
by
ukj
5y ago
>I do dynamic dispatch all the time in strongly typed languages. I believe semantics is getting in our way of communicating. You don't do dynamic dispatch ___ALL___ the time. You only do it at runtime. And you only do static type sa
More ›