A meditation on computable notebooks
and miscellaneous thoughts

John Fultz, Wolfram Research

Join the Conversation #WolframTechConf

So, we released an iOS version this year

({{, }})

...and I spent some time talking about it

tornEdge=With[{img=},Module[{step=10,if,n=2 Total[ImageDimensions[img]],k=0},if=Interpolation[Transpose[{Accumulate[Prepend[RandomInteger[{step,2 step},n],0]],RandomReal[1,n+1]}],InterpolationOrder->1];
ImageEffect[img,{"Frame",if[++k]&,15,{Right,Bottom}}]]];
shadowOffset=10;
shadowBlur=5;
shadowTone=.5;
boundaryLigntness=.4;

Print@ImageCompose[SetAlphaChannel[ColorNegate@#,#]&@Blur[ImageMultiply[ImagePad[AlphaChannel[tornEdge],{{shadowOffset,shadowBlur/2},{shadowBlur/2,shadowOffset}}],shadowTone],shadowBlur],ImagePad[ImageMultiply[tornEdge,ColorNegate@ImageMultiply[MorphologicalPerimeter@AlphaChannel[tornEdge],boundaryLigntness]],{{0,shadowOffset+shadowBlur/2},{shadowOffset+shadowBlur/2,0}}]]

tornEdge=With[{img=},Module[{step=10,if,n=2 Total[ImageDimensions[img]],k=0},if=Interpolation[Transpose[{Accumulate[Prepend[RandomInteger[{step,2 step},n],0]],RandomReal[1,n+1]}],InterpolationOrder->1];
ImageEffect[img,{"Frame",if[++k]&,15,{Right,Bottom}}]]];
shadowOffset=10;
shadowBlur=5;
shadowTone=.5;
boundaryLigntness=.4;

Print@ImageCompose[SetAlphaChannel[ColorNegate@#,#]&@Blur[ImageMultiply[ImagePad[AlphaChannel[tornEdge],{{shadowOffset,shadowBlur/2},{shadowBlur/2,shadowOffset}}],shadowTone],shadowBlur],ImagePad[ImageMultiply[tornEdge,ColorNegate@ImageMultiply[MorphologicalPerimeter@AlphaChannel[tornEdge],boundaryLigntness]],{{0,shadowOffset+shadowBlur/2},{shadowOffset+shadowBlur/2,0}}]]

...and a curious thing happened

I spent a lot of time talking about notebooks in those posts

And a lot of time thinking about the nature of notebook interfaces

Imitation === Flattery?

People seem to agree we had a good idea...

Imitation === Flattery?

People seem to agree we had a good idea...

...29 years ago

Imitation === Flattery?

People seem to agree we had a good idea...

...29 years ago

Let’s dig more into what notebooks have been to understand what they should be

What is a notebook?

A Read-Evaluate-Print Loop – i.e., inputs and outputs

Text and code in a document, typically delineated by cells

Support for graphics, typesetting, and more recently, interfaces

We made a notebook system in 1988

Magnify[TimelinePlot[List/@{Interval[{LinguisticAssistant,Now}]},PlotStyle->{Blue},PlotLayout->"Overlapped",PlotLegends->Placed[{"Wolfram notebooks","Other math notebooks","Other computation notebooks"},Bottom],Spacings->{1,1,1}],1.5]

Some competitors came soon after

Magnify[TimelinePlot[List/@{Interval[{LinguisticAssistant,Now}],Interval[{LinguisticAssistant,Now}]},PlotStyle->{Blue,Gray,Orange},PlotLayout->"Overlapped",PlotLegends->Placed[{"Wolfram notebooks","Other math notebooks","Other computation notebooks"},Bottom],Spacings->{1,1,1}],1.5]

...but they missed something

Some competitors came soon after

Magnify[TimelinePlot[List/@{Interval[{LinguisticAssistant,Now}],Interval[{LinguisticAssistant,Now}]},PlotStyle->{Blue,Gray,Orange},PlotLayout->"Overlapped",PlotLegends->Placed[{"Wolfram notebooks","Other math notebooks","Other computation notebooks"},Bottom],Spacings->{1,1,1}],1.5]

...but they missed something

⋮
• Text and code in a document, typically delineated by cells
	⋮

Code, not just math

So this is what we tried to communicate...

Computation, not just “math”, are what notebooks are about

We demonstrated this vividly with Manipulate

And we even rebranded notebooks as “computable documents”

And the world finally started to better understand notebooks

Magnify[TimelinePlot[List/@{Interval[{LinguisticAssistant,Now}],Interval[{LinguisticAssistant,Now}],Interval[{LinguisticAssistant,Now}]},PlotStyle->{Blue,Gray,Orange},PlotLayout->"Overlapped",PlotLegends->Placed[{"Wolfram notebooks","Other math notebooks","Other computation notebooks"},Bottom],Spacings->{1,1,1}],1.5]

But that was only part of what we meant by “computable”

Support computation in the document

Support computation of the document

What does a computable document enable?

Document generation

Document transformation

Non-traditional documents

Outputs easily transformed to inputs

"Example 1"

"Example 2"

Or, of course, the report generation features

All old news for us, but we’re still learning...

Easily embed data sets into your notebook

Iconize[WordList["Noun"],"list of nouns"]

Histogram[StringLength/@]

...and learning

Init

Needs["GitLink`"]

extractFileFromRepo[repo_GitRepo, file_String, sha_String] :=
Module[{props, currentBranch, sourceFile, copiedFile},
	props = GitProperties[repo];
	currentBranch = If[StringQ[props["HeadBranch"]], props["HeadBranch"], GitSHA[repo, "HEAD"]];
	sourceFile = FileNameJoin[{props["WorkingDirectory"], file}];
	copiedFile = FileBaseName[file] <> "-" <> sha <> "." <> FileExtension[file];
	copiedFile = FileNameJoin[{$TemporaryDirectory, copiedFile}];
	If[FileType[copiedFile] === File, DeleteFile[copiedFile]];

	GitCheckoutReference[repo, sha];
	CopyFile[sourceFile, copiedFile];
	GitCheckoutReference[repo, currentBranch];

	If[FileType[copiedFile] === File, copiedFile, $Failed]
]

compareFilesFromRepo[repo_GitRepo, file_String, sha1_String, sha2_String] :=
	Module[{old, new, obj},
		old = extractFileFromRepo[repo, file, sha1];
		new = extractFileFromRepo[repo, file, sha2];
		obj = FindChanges[File[old], File[new],
				IgnoreChanges -> {"CellOptions" -> ExpressionUUID}]
	]

Computing the difference of a notebook changed in git

r=GitOpen["~/wolfram/git/GitLink"];
compareFilesFromRepo[r,"GitLink/Documentation/English/ReferencePages/Symbols/GitReset.nb","29c1dca35be","45dae69b40"]

ViewChanges[%];

Yet more examples in the pipeline

Simple document transformations lead to new interfaces

CreateLightbox["It is raining. Clear skies are required for that operation."];

Much more advanced transformations enable features like

Presentation Tools

Chat system

Your tools here...

So, that’s a computable document system

Hope the rest of the world catches up soon...

So, that’s a computable document system

Hope the rest of the world catches up soon...

Magnify[TimelinePlot[List/@{Interval[{LinguisticAssistant,LinguisticAssistant}],Interval[{LinguisticAssistant,Now}],Interval[{LinguisticAssistant,Now}],Interval[{LinguisticAssistant,Now}]},PlotStyle->{Blue,Green,Gray,Orange},PlotLayout->"Overlapped",PlotLegends->Placed[{"Wolfram notebooks","Wolfram computable notebooks","Other math notebooks","Other computation notebooks"},Bottom],Spacings->{1,0,1,1}],1.5]

...but it’s been only 21 years since we introduced it, so give them time.

A few random feature highlights...

WLS file support

Really, just like the package editor, but with shebang support

Also, sets/preserves appropriate permissions in Unix-land

Example (note green shebang header)

Headless FE support under Linux

Editor improvements

Auto-times improvements (some here, some coming)

{Interval[{LinguisticAssistant,LinguisticAssistant}],Interval[{LinguisticAssistant,Now}]Interval[{LinguisticAssistant,Now}],Interval[{LinguisticAssistant,Now}]}

We’re beginning to codify how users should add completions and function templates

And a number of other things coming soon

FE feature deployment is a bit thin this year...

A lot of time spent on infrastructure

Laying the groundwork for...

...the upcoming 64-bit Cocoa front end for Mac

...the upcoming support for high-res displays on Windows

Some other FE talks

Today

1pm	Wolfram Player for iOS, Rob Raguet-Schofield

1:30pm	Authoring Content for Wolfram Player for iOS, Jason Harris

5pm	New in 3D graphics, Yuzhu Lu

Tomorrow

10am	CDF News/Update, Andre Kuzniarek

10:30am	The Power of Typesetting, Itai Seggev

11am	Typesetting Workshop, Jason Harris

Friday

1pm	Math Typesetting Roundtable, Yihe Dong, John Fultz, Jason Harris

1:30pm	Cloud Notebooks, Jan Poeschko

2:30pm	Using the Cloud on Mobile Devices, Nick Zitzmann

4pm	Building Maintainable Dynamic Interfaces, Lou D’Andria