Try coding on iPad has fun, I downloaded the free app Wolfram Player
in App Store and found it can interact with Wolfram notebooks *.nb
or *.cdf
files locally but cannot change its code.
Then I used Manipulate
and InputField
to construct a simple Wolfram Language interpreter.(using App-in purchase)
Manipulate[
ReleaseHold@WL,
{WL, "Type the WL here!", InputField[#, Hold@Expression] &},
Initialization -> Needs["Benchmarking`"]]
(* app version 12.1.1 works fine *)
However this code has some problems:
- Some codes output blank field such as
GeoGraphics[]
(in app System Context) andBenchmarking`Benchmark[]
- It’s too simple to have no syntax highlighting, code completion and error throwing mechanism.
Could we improve the code and enjoy the coding on iPad?
Or Is there text editors app or offline services that supports Wolfram Language syntax highlighting on iPad? (such connect this app with iSh app that support Linux)
interesting things:
It's a small pocket Mathematica, only 317MB on iPad rather than 11GB desktop version almost without degradation of function numbers.
UnitConvert[
Total[FileSize /@
Select[FileNames[All, $InstallationDirectory, Infinity],
FileType[#] == File &]], "MB"]
Names["System`*"]//Length
The efficiency on iPad Pro 2020 (12.9-inch) even faster than MacBook Pro (13-inch, 2017)! (same version 12.1.1)
It seems that iPad Pro is a real productivity tool! (But Benchmarking`Benchmark[]
couldn't work for further tests)
AbsoluteTiming[CellularAutomaton[110, {{1}, 0}, 10000];]
(* Mac 2.29s iPad 0.51s, four times faster *)
Graph[Table[i -> Mod[i^2, 74], {i, 1000000}]]; // AbsoluteTiming
(* Mac 1.82s iPad 1.34s *)
AbsoluteTiming[
Table[Thread[{r, Nest[r # (1 - #) &, Range[0, 1, 0.01], 10000]}], {r,
0, 4, 0.01}];]
(* Mac 5.30s iPad 2.06s, two times faster *)
AbsoluteTiming@Total[Prime[Range[PrimePi[10^7]]]]
(* Mac 1.34s iPad 1.02s *)
newt = Compile[{{z, _Complex}, {n, _Integer}}, Module[{zn = z},
Do[zn = (2 zn + 1/zn^2)/3, {n}];
If[Re[zn] > 0, 1, If[Im[zn] > 0, 2, 3]]]];
Timing[Hash@
Table[newt[x + I y, 25], {y, -1, 1, 2./999}, {x, -1, 1, 2./999}]]
(* Mac 3.30s iPad 2.75s *)
c = Compile[{{x}}, x^2 + Sin[x^2], CompilationTarget -> "C"];
{c, c[10.5]}
(* wow, the app support C language natively and links it back in for execution *)
The Wolfram Player has a location in Files, then we can Export
the files to other apps or PCs for further processes.
Welcome any comments!
This command list all the system information,cool! SystemInformation[]
Benchmark[]
can be found inAddOns/Packages/Benchmarking/Benchmarking.m
if you want to run them manually. $\endgroup$