4 ms·
Yes, syntax matters. What is in question is why syntax has to be so tightly bound to intrinsics of a language? I think it is possible to have a meta layer above
by hzhou321 11y ago
Yes, syntax matters. What is in question is why syntax has to be so tightly bound to intrinsics of a language? I think it is possible to have a meta layer above any programming language that can bridge particular flavor of the syntax of your choice to the underlying language. In fact, I have been practicing that for the last 10 years (MyDef).
To illustrate what I mean by meta layer, the preprocessor (macros) is a (crude) example of meta layer that is (in fact) independent from the C language. In fact, M4 can and has been used on top of many independent languages. But to have a fuller syntax layer, we'll need a more sophisticated (not necessarily more complex) system than M4.
- Swizec 11y agoSyntax IS decouples from the language. Semantics are where the language is really defined. Unless you run out of symbols, any syntax can be used to express any semantics. However, since syntax is the easiest to see and understand, so too it is most often debated. Talking about a language's semantics is hard.
- tamana 11y agoThe JVM and .net have exactly the separation you are talking about
- hzhou321 11y agoNot exactly :). If we think a programming language as a person, its syntax layer is like the person's look. The person will have a look even without any clothes but the clothes can change his look (syntax matters). JVM is more like the person's bones (and muscles and other essentials beneath his skin) and Java and Clojure etc. are more like different persons with the same bone structure. Java is a programming language, JVM is not, and the meta-layer I was referring is more like clothes that we can put on the persons.
- saurik 11y agoWhile technically independent of the C language, the C pre-processor has the idea of C tokens baked into its core (such as refusing to ## together two things that would result in invalid C), which has caused some people (such as Haskell) who relied on the ability of some C pre-processors to sort of handle things that are not C, they have been burned as of late when dealing with ones that have refused to implement extra modes that allow it to process arbitrary text (such as clang). The preprocessor is essentially specified so as to be able to be efficiently implemented inside the tokenizer of a unified C compiler stack (hence why token pasting isn't textual): it isn't really "independent from the C language". In contrast, m4 is fundamentally more "independent" than the C preprocessor, in that (as far as I know... my experience with m4 is much less, and mostly with respect to amateur-level autoconf work) it doesn't assume anything about the underlying text.
- geofft 11y agoOne of the curious things about clean layers of abstraction is how often they're counterproductive in practice.
- hzhou321 11y ago>> m4...doesn't assume anything about the underlying text. I don't think there is anything wrong for the meta layer (syntax layer) to make certain assumptions/restriction for the underlying language layer; and there is nothing wrong for the meta layer to reflect certain characteristics of the underlying languages. The argument is: syntax matters, but it is not necessary to judge (or even reject) a language by its syntax, which may be remedied by a meta layer. It is not necessary to reject a person by his clothes or even how he talks. The same should go to a programming language.