4 ms·
Seems cool in general. I like their point about "locality of behavior". Some of the syntax give me unfortunate flashbacks to AppleScript. Expressions like "the
by goto11 6y ago
Seems cool in general. I like their point about "locality of behavior".
Some of the syntax give me unfortunate flashbacks to AppleScript. Expressions like "the location of window" looks cool at first glance, but in reality "window.location" is easier to both read and write, especially when you start to compose more complex expressions.
- klibertp 6y ago> but in reality "window.location" is easier to both read and write No, it's not easier to read. Really. You think it is, but that's only because you're used to it. If you take a step back and look at the "window.location" expression objectively, while forgetting all that you know about programming (but retaining your knowledge of English), you won't be able to tell what is it about, not with any kind of certainty. Or, if you have experience with some other programming languages, you might read it as "a composition of function window and function location". On the other hand, "the location of window", even if it's not 100% correct English, tells you all that you need to know to understand what is happening. It is easier to write, but only because it has less characters. The docs state pretty clearly that they are optimizing for ease of reading, not writing, so this is expected.
- kayodelycaon 6y agoNatural-language programming comes up from time to time and it rarely sticks around. For myself, I can't parse them without my brain trying to read it as actual English. Having programming languages look distinctly different from human communication keeps my mental overhead low. I find Applescript impossible to use. NLP also has a major issue with rapid comprehension. It's far harder to see the structure of code at a glance if everything is just keywords. While this is an issue with every type of communication, NLP has a significantly lower upper limit to almost every other language I work in. SQL is a middle ground. If you format it properly, it's really easy to scan and see what's happening. Applescript? Not so much.
- recursivedoubts 6y agoI agree, applescript is a warning to anyone going down the hypertalk-derived road I am adding things like CSS literals: https://hyperscript.org/expressions/#css https://hyperscript.org/expressions/#css in the hope that we can increase the expressiveness (and distinctness between different elements) that we don't fall into the wall-of-text nature of applescript. It's a speculative project, we'll see how it works out.
- goto11 6y agoBut I am a programmer, and this code is going to be written and read by programmers. The experience from AppleScript shows IMO that a more English-like syntax does not actually make the language simpler to use, it just obscures the underlying semantics, making it harder to learn.
- klibertp 6y agoI don't disagree, but "simpler to use" and "easier to read" are almost orthogonal things :)
- goto11 6y agoI guess programmers can mean different things with "easy to read", but to me it means "easy to understand by reading". This in turn has two aspects: How complex the meaning is, and how clearly the syntax express this underlying meaning. The fallacy of AppleScript is to think that a syntax which looks familiar on the surface makes the semantics esier to understand. But since the underlying semantics are those of a programming language, not human-to-human communication, the syntax obscures the meaning. So to me "easier to read" and "simpler to use" both depends on the ergonomics of the programming model and the syntax used.
- deniz-a 6y agoHow about `the window's location`?
- rsfinn 6y ago... which syntax HyperTalk originally supported as a sugaring of `the location of window` ...
- recursivedoubts 6y agooh, we support that too :) set the location of the window to 'https://hyperscript.org`