-1

For a programming language, certain keywords are reserved; i.e., these tokens can't be used in any other context while programming in that particular language.

Here is a list of C language keywords with some exciting C23 additions coming up.

The name Wolfram Language suggests that it is a language. Can someone please post a link to the keywords for the Wolfram language? I have searched this forum and the docs and I can't find this information.

Can it be called a language, if it doesn't have keywords? For instance, If I can Unprotect[Goto] then that can't be a keyword (or at least that is my understanding). Can someone (ever, sufficiently, convincingly) claim to have learned a language whose keywords are not defined?

On a side note, why is the "wolfram-language" tag not present?

Michael E2
  • 235,386
  • 17
  • 334
  • 747
Syed
  • 52,495
  • 4
  • 30
  • 85

1 Answers1

6

The list of "keywords" in Wolfram Language can only really refer to the list of all of the defined symbols, which you can get by evaluating ?*.

I think this is a somewhat narrow view of the implementation of programming languages. Not all languages have keywords in the sense that C-type languages do, and it's also important to define exactly what you mean by "keywords". An example could be Lisp, which, like Mathematica, doesn't have any reserved words, but defined symbols which can be redefined, and in some cases forms that have special treatment within the interpreter - but the interpreter itself can be modified by the user as well. Other languages worth looking at are things like APL (and other Array Programming languages), Forth, TCL, Smalltalk.

Can it be called a language, if it doesn't have keywords? For instance, If I can Unprotect[Goto] then that can't be a keyword (or at least that is my understanding). Can someone (ever, sufficiently, convincingly) claim to have learned a language whose keywords are not defined?

I think this part of the question is out of scope for this site, but I've written the following now anyway, so:

Consider a normal spoken language like English. Words change meaning - for example, "awesome", which used to mean "terrifying" (Unprotect[Awesome]; Awesome := "terrifying"). There are many, many people who have learned English who may not know what the word "affine" means, for instance, but if they needed to know what it meant, they might look it up in a dictionary. In my opinion, it is essentially the same thing with Wolfram Language - I know how most of the symbols I normally use work, and if I am learning about a new area, I will read the documentation about the symbols defined in that area.

Carl Lange
  • 13,065
  • 1
  • 36
  • 70
  • If ?* is the list of "keywords" for WL then it is nearly identical to Mathematica and Mathematica is not a language. If it were, another one wouldn't be needed. Thanks for the response. – Syed Aug 26 '21 at 19:09
  • 2
    I think you may be confused about the distinction between WL and Mathematica (it's certainly a muddy distinction). WL is the programming language used within the Mathematica package, and is also used by Wolfram Alpha, the wolframscript interpreter, Wolfram Desktop, Wolfram Finance Platform, and presumably others. Each of those interpreters might have slightly different sets of defined symbols. Note that the language was only given a name in 2013, and prior to that, Mathematica was used as the name for the language as well as the Mathematica package. – Carl Lange Aug 26 '21 at 19:48
  • So WL has no keywords (or no listing of them in one place and no use for them) and yet has ~8000 keywords on Mma alone that morph as needed in space and over time. Not only that, WL morphs from product to product and perhaps from platform to platform. Interesting. And my post has been closed due to the lack of focus and perhaps "confusion" on my part? – Syed Aug 27 '21 at 09:52
  • 1
    You'll note that I and other users have done our best to help you out here. I didn't vote for your question to be closed, although "Can someone claim to have learned a language whose keywords are not defined" is surely out of scope for a Mathematica-specific site. Rohit's responses in the comments and my answer should hopefully be enough to show you that your preconceptions may not apply neatly to WL. I'm not sure that I can help you further but I hope you find an understanding that works for you. – Carl Lange Aug 27 '21 at 10:42
  • I also didn't vote to close it but I agree that this post seems off-topic and is not asking a focused question. I commend CarlLange for the willingness to tackle seriously what seems to be a series of open questions and matters of personal opinion. – rhermans Aug 27 '21 at 11:59
  • I sincerely thank Carl Lange (for posting the only reply) and rhermans for the comment above. I understand that no one cares if A or B can or wants to learn tools C or D. I am reacquainting myself with Mma after some time as the tool has its advantages and it has expanded considerably in the past years. I think someone could have edited the post for clarity. Other learners, and new CS students with no prior knowledge of Mma might not be able to understand why asking for the list of keywords for a language is off-topic or closure-worthy. Thanks for your time. I have more questions to post. – Syed Aug 27 '21 at 13:18
  • @Syed Would you call SK combinators, tag systems, lambda calculus, Markov algorithm... programming languages? They are Turing complete. – Rohit Namjoshi Aug 28 '21 at 18:12
  • @RohitNamjoshi: I wish I was that math-saavy. For me PL means, C, C++, Java, Python, JS etc. I am currently learning functional ext. for these and for mma to improve skills. My (crude/limited) defn of a PL is something that is limited vocab. based machinery with no data. You ask about research topics that few programmers would know well, but compiler designers must learn. So commercially these aren't useful for avg. users. except that lambdas have now become mainstream. TC-ness doesn't confer usability. Brain____ is TC but the name lives up to its E[X]. Thanks for the links above. – Syed Aug 28 '21 at 18:50
  • 1
    @Syed Most programming languages have a core that has a specification defining syntax, reserved words, basic constructs, etc., and libraries/packages that implement additional functionality e.g. Python numpy. In WL the distinction is not well defined. It is also homoiconic so there is no distinction between code and data. Everything input and every output is an expression and an expression is either an atom or of the form h[exp1, exp2, ... expn] (normal expression) where h is the head and the exp are either atoms or normal expressions. The head can be an atom or a normal expression. – Rohit Namjoshi Aug 28 '21 at 20:00
  • WRI has open-sourced a parser for the language that you might want to take a look at. – Rohit Namjoshi Aug 28 '21 at 20:04
  • @RohitNamjoshi: Thanks, when I have sufficient knowledge to take a look at the parser, I will investigate it further. – Syed Aug 28 '21 at 20:22