top | item 11925945

(no title)

yarvin9 | 9 years ago

"Constructor" already got used by C++ for something different. A Hoon mold is more like a C++ struct than a C++ constructor.

And if you saw a file of Hoon molds, in normal programmer English, you'd say, "these are type declarations." I might even say it myself.

As for the external representation -- it's a name for a file containing a Hoon mold. Actually orthogonal to serialization format, as all nouns are serialized the same way. It really is more like a MIME type, if a MIME type was a function you could run. There's no word for this.

There is a common programming term for a set of values. The word is "type." "Domain" is a little bit odd, because we usually compute the "type" (span) as the range of an expression...

Bottom line is, this stuff is hard!

discuss

order

kazinator|9 years ago

> "Constructor" already got used by C++ for something different.

Constructor was used (long) before C++! For instance, the "cons" function in Lisp stands for "construct", and speaking of which, ANSI Lisp even has "boa constructors" (by order of arguments). We are used to having terms like "constructor", "array" or "variable" have different shades in different languages. If I reach for Awk to munge some text fields, I'm not suddenly confused because its "arrays" are not like C arrays or Fortran arrays.

The same terms being used is actually helpful, because the terms form the pivots in conceptual mappings between languages, and comparisons. Even if two languages have different notions of what is a "variable", they are used in similar ways. It's easier to hang different shades of meaning on the same word than to memorize some made up new word. Even something quite different, like placeholders in pattern matching or predicate logic, can still be called "variable" without causing confusion.

Think about parameters/arguments. They can be by value, by name, by reference, or normal order (lazy). Using a different word instead of "parameter" for all these would be counterproductive, and make it harder to speak comparatively.

Bottom line, people aren't complete idiots.

"The Flunk language has flurbles, which are like C++ variables, but not exactly, so we use a different word. Unlike variables denote locations which do not have a type and can store any value." (Gee, that's just like "variables" in some existing languages that are not C++.)

kazinator|9 years ago

Maybe that's the point. If you implement, say, arrays very badly, and call them arrays, then everyone can easily criticize you in very direct terms: "Flunk has arrays, but they are broken compared to Python arrays, or even C arrays and Fortran arrays". The left-most "arrays" in that sentence can be a straightforward, blue-underlined link directly to the Flunk documentation which describes arrays. But if you call then batteries, then such a comparison gets confounded with distracting explanations. It's harder to argue that Flunk has broken arrays, when it has something called batteries that hold cells which have polarity and whatnot. First you have to argue that they really are just arrays under a different name, then you have to argue why they are bad compared to arrays, and why that still matters in the context where they are batteries. By the time you're done, you look stupider than Flunk, and more negative than the (-) end of a Flunk battery.

yarvin9|9 years ago

You're very eloquent and also learned. But for every programmer who knows what an ANSI Lisp "boa constructor" is, there are 100 who know what a C++ constructor is. And it's an 11-letter word that means something completely different in a completely different language.

But maybe it's worth it to stop the middlebrow dismissals! Our grandparents went to the moon. We complain when we have to learn a slightly new idea, and faint like Victorians contemplating legs if it has a new name.

"Argument" is another good one. Hoon is a single-argument language that favors tuples, not currying. So an add function, (add a b), is actually (add [a b]), or in Lisp (add (cons a b)).

In Hoon, you can call a and b "arguments" all day long. It's an informal word. But [a b] is "the sample." You can see the chaos that would result if we called it "the argument" or "the parameter"...