notes-computer-jasper-jasperNaturalLanguageThoughts

jasper natural language toreads

assembly

what does a typical assembly instruction sound like as an English sentence?

"Subtract 3 from register 7"

imperative mood and computer programs

languages like Haskell that are all expressions, and declarative languages like SQL, may seem to be indicative mood but the catch is that they only indicate things that they know how to compute imperatively, e.g. if you say "z = x + y" this is like English "z is the sum of x and y", which is imperative, but note that "the sum of x and y" has a semantic relation to the imperative "add x and y". so semantically these aren't really that different from imperative languages with variable assignment. the reason is probably that the whole idea 'computation' restricts us to things that are computable. E.g. you don't generally see so-called declarative or expression-based languages providing constructs for indicating uncomputable 'y is the halting-ness of program P'.

languages like Prolog are more 'truly declarative'/'truly indicative mood'. Also, truly declarative stuff is embedded in imperative languages inside data. String1 = 'Bob' is truly declarative. Most languages separate 'data' and 'instructions' (indicative and imperative) but Prolog embeds instructions in data.