Channels ▼

Web Development

Mathematica 8 Review

Free-form Linguistic Input

Leveraging the technology pioneered for the website, Mathematica 8 has incorporated the linguistic processing ability to take plain English input and translate it into Mathematica functionality. For instance, the phrase "plot sin xy" will render a colorful three dimension contour sin wave map, and "temperature chicago december 2009" will generate a line graph showing the temperature fluctuations in Chicago throughout the month of December, 2009. To leverage this linguistic input engine, simply precede the linguistic query with a single equals ("=") sign. Using a double equals ("==") sign will inform Mathematica to return not just the result but all the related data comprising the result, much the way the Wolfram|Alpha website displays its output data from such queries. Not only does this new feature provide an easy interface for the laymen to interact with the power harnessed by Mathematica, but its a tremendous accelerator for developers. What would previously take dozens or even hundreds of lines of code to interpret can now be accomplished in a single query. The real "aha moment" comes when programmatically chaining multiple queries together that intersect a number of queries via a user interface built within Mathematica or externally via Wolfram Workbench to allow students, researchers, business analysts, educators and engineers to perform sophisticated real-time data transformations and mash-ups with the click, slide and/or drag of a mouse.

[Click image to view at full size]
Figure 1. Mathematica Notebooks can call upon Wolfram|Alpha curated data via the "=" and "==" functions. This screenshot also shows several tool palettes bundled with Mathematica 8.

C Code Generation

Working within the Mathematica 8 environment feels like home for those who have lived within its notebook files for years. Yet for those who prefer custom interfaces, command line interactivity or incorporation of Mathematica engine-powered results to feed into another application, the ability for Mathematica to generate the C code that hooks into the Mathematica kernel and processes results outside of the Notebook environment further extends Mathematica's capabilities beyond its original confines.

[Click image to view at full size]
Figure 2. Using the CompiledFunction[] feature, complex formula can be compiled for faster execution and more readable code.

Combining C structures with Mathematica's symbolic language equals the SymbolicC programs that can be created. C code can be generated using the CCodeGenerate function. This C code can then be compiled as a DLL or standalone executable using the CreateExecutable function that can be used in a workflow process or linked into an external custom application without touching the Mathematica user interface environment.

[Click image to view at full size]
Figure 3. Mathematica 8 can compile functions to native C code which can then be linked into an executable, all performed without leaving the Mathematica environment.

Mathematica 8 also comes bundled with MathematicaScript binary that can be used to create stand-alone shell scripts with passed arguments, pipes and other Unix script functionality. Invoking this functionality in a script file is as simple as adding "#!/usr/local/bin/MathematicaScript -script" to the first line of the file, followed by the function(s) and expressions to be processed. Calling the script works the same as any other shell, Python, Perl, Ruby, or other scripting language works from the command line, further extending Mathematica into automated workflow and data processing scenarios.

Expanded Image and Video Processing

New filtering, segmentation and shape analysis functions have been added to Mathematica 8, as well as one of my favorites, the EdgeDetect filter. Combine this with the ability to import and export Quicktime video, recognize text and detect prominent lines in the still frame images and you have some amazing power to draw upon. In fact, several examples on the Wolfram website programmatically show off these ideas, helping to fuel the imagination and innovative spirit of Wolfram's customers.

[Click image to view at full size]
Figure 4. New image processing as well as 2D and 3D graphing features have been added to Mathematica 8 including the ability to capture and manipulate video input streams.

There are also a slew of new 2D and 3D hardware-accelerated polygon fills and texture galleries, illustration capabilities of drawing, aligning and distributing objects as well as the ability to use any Mathematica expression as a texture (such as a web cam video stream). Just think of the aggregated possibilities: combine streaming images from cameras trained on specific production line processes overlaid with real-time performance metrics, changing colors based on alerts or error conditions, or supply chain data visualization dashboard overlays based on real-time or hypothetical inventory status. Mash this up with Wolfram|Alpha curated web data and the new image processing features really come into focus.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
Dr. Dobb's TV