3 ms·
I agree with the conclusion, that what we call homoiconicity is a scalar, not a boolean. And I agree both in this case and in general that people should talk ab
by delish 7y ago
I agree with the conclusion, that what we call homoiconicity is a scalar, not a boolean. And I agree both in this case and in general that people should talk about languages more directly (“the syntax is easy to parse”, “the semantics of the language are completely defined on the single page of a book”) rather than label them as homoiconic or not.
If you'd like good argument for writing in languages that call themselves homoiconic, you can see Bawden's Quasiquotation in Lisp. Its section 2.1 compares writing a program that generates programs in C, versus Lisp, first without quasiquotation, then with.
https://3e8.org/pub/scheme/doc/Quasiquotation%20in%20Lisp%20(Bawden).pdf https://3e8.org/pub/scheme/doc/Quasiquotation%20in%20Lisp%20...
- reikonomusha 7y agoNitpick, but booleans are perfectly ordinary scalars. Maybe the author (and you) might prefer something like “homoiconicity falls on a spectrum” or “homoiconicity isn’t a binary property” or some other ordinary way to make this statement. I quite liked your link. Instead of deciding what the word “homoiconic” ought to mean, it just showed what you can do in a homoiconic language with quasiquote syntax. Delightful and to-the-point!
- deleted 7y ago[deleted]
- JadeNB 7y ago> Nitpick, but booleans are perfectly ordinary scalars. I think most people use 'scalar' to mean something like "real number" (maybe "complex number", or maybe "real number in a specified interval"). In this context, a Boolean is not a perfectly ordinary scalar. That is to say, it is certainly easy to coerce a Boolean to a real scalar in [0, 1]; but this is a transformation, and not the identity—the Boolean True is not the scalar 1, nor is the Boolean False the scalar 0. As evidence for this, I'd point out that there is no reason that we couldn't coerce the Boolean True to the scalar 0, and the Boolean False to the scalar 1. But, you'd point out, I'm wrong; with these coercions, the nice identities x AND y = xy and x OR y = x + y - xy would fail. I agree! But these nice identities show once again that Booleans, even once coerced, aren't scalars, because the algebraic operations on them differ from the algebraic operations on real scalars. (Or maybe your point was that Booleans are perfectly ordinary scalars in the field with 2 elements. I guess I can't argue with that, except to say that I don't think that most people envision "perfectly ordinary" scalars living there.)
- burke 7y agoYeah—technically, a scalar is just whatever type can be used to multiplicatively scale a vector in some given vector space but, at least in computing, it’s pretty clear that people just mean “some kind of integer or real number, definitely not a collection/enumerator type”
- r-w 7y agoWasn’t clear to me at all. A scalar is any kind of singleton number, but it doesn’t exist in contrast to boolean values; rather, it includes them. “Exists on a spectrum/scale” or “is a real number” would be universally understood ways of communicating that particular meaning. The notion of “fuzzy logic” is especially relevant: https://en.wikipedia.org/wiki/Fuzzy_logic https://en.wikipedia.org/wiki/Fuzzy_logic
- JadeNB 7y ago> A scalar is any kind of singleton number, but it doesn’t exist in contrast to boolean values; rather, it includes them. But this was exactly my point: scalars, regarded as 'singleton number's, don't include Booleans, because Booleans aren't numbers, singleton or otherwise. (Unless, again, you wish to regard them as belonging to the field with two elements.) Booleans can be coerced to numbers, but the way to do so, even if we agree that the two numbers are 0 and 1, is arbitrary—unless we require that certain algebraic identities hold, identities that indicate that the (usual) algebra of Booleans is not the (usual) algebra of real numbers. It is a nitpick, to be sure; but (a) part of the point of types is to facilitate, and even automate, exactly this sort of nitpicking, and (b) it was in response to a nitpick, too. > The notion of “fuzzy logic” is especially relevant: https://en.wikipedia.org/wiki/Fuzzy_logic https://en.wikipedia.org/wiki/Fuzzy_logic Agreed! It indicates that coercing Booleans to numbers suggests fruitful analogies, but, again, says to me that they are not actually numbers. (Once again, I point to their operators, which, from a computer-science as well as a mathematics point of view, are part of what a scalar, Boolean, or whatever is: https://en.wikipedia.org/wiki/Fuzzy_logic#Fuzzy_logic_operators https://en.wikipedia.org/wiki/Fuzzy_logic#Fuzzy_logic_operat... .) These indicate that perhaps one should think of Booleans as belonging to a continuum of values coming from a tropical-type structure (https://en.wikipedia.org/wiki/Tropical_geometry https://en.wikipedia.org/wiki/Tropical_geometry) rather than from a field as 'usual' scalars do.