Re: Language vs. Library
- To: mathgroup at smc.vnet.net
- Subject: [mg61144] Re: Language vs. Library
- From: "Steven T. Hatton" <hattons at globalsymmetry.com>
- Date: Tue, 11 Oct 2005 03:21:37 -0400 (EDT)
- References: <did316$qfd$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Bill Rowe wrote: > On 10/9/05 at 1:35 AM, hattons at globalsymmetry.com (Steven T. Hatton) > wrote: > >>If we look at compiled and byte compiled languages such as >>C,C++,Java, C#, etc., we see they typically consist of a core >>language, and standard libraries. In C, and C++ the demarcation is >>very clear. I know I've asked a similar question in the past, but >>it's something that recures to me every time I start working with >>Mathematica. Is there a core Mathematica language? If so, what >>does it consist of? > > In Mathematica, the obvious division would be the symbols in the System` > context and everything else. Things not in the System` context are loaded > using Needs or Get, analogous to using #include in either C++ or C. -- To > reply via email subtract one hundred and four That was certainly a nudge in the right direction. I don't believe that is quite the demarkation I was seeking. I'm more likely to consider System` to be analogous to the C++ std:: namespace. Also it makes more sense to me to draw an analogy between C++ namespaces and Mathematica packages, rather than header files and the use of the #include preprocessor abomination. The "core language" I'm attempting to identify seems more likely to be limited to the essential components required to make this happen: <quote url="http://documents.wolfram.com/mathematica/book/section-A.9.3"> Mathematica is fundamentally an interpreter which scans through expressions calling internal code pointed to by the symbol table entries of heads that it encounters. Any transformation rule--whether given as x -> y or in a definition--is automatically compiled into a form which allows for rapid pattern matching. Many different types of patterns are distinguished and are handled by special code. A form of hashing that takes account of blanks and other features of patterns is used in pattern matching. The internal code associated with pattern matching is approximately 250 pages long. When a large number of definitions are given for a particular symbol, a hash table is automatically built using a version of Dispatch so that appropriate rules can quickly be found. <quote> Mindyou, there is an important distinction between implementation and language which is not stressed in Mathematica since there is only one implementation. Another set of dimensions for the basis I'm attempting to identify seems to be given here: http://documents.wolfram.com/mathematica/book/section-A.1. I've described Mathematica as Lisp on steroids, and I believe that is probably a very apropos depiction. An expression is a list (in the Lisp sense) where a Lisp car is analogous to a Mathematica Head. I'm not sure if structural entities such as Module and Block qualify as foundational in Mathematica, or are derived from more fundamental components. Likewise for many of the procedural entities such as For If Goto, etc. qualify as elementary. It may well be the case that there are multiple levels of the Mathematica language. This would be analogous to the way C++ was originally implemented in C. -- "Philosophy is written in this grand book, The Universe. ... But the book cannot be understood unless one first learns to comprehend the language... in which it is written. It is written in the language of mathematics, ...; without which wanders about in a dark labyrinth." The Lion of Gaul
- Follow-Ups:
- Re: Re: Language vs. Library
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Re: Language vs. Library