
WolframScript enables Wolfram Language code to be run from any terminal - tomerbd
https://www.wolfram.com/wolframscript/
======
dang
Ongoing related thread ("Mathematica v12.1"):

[https://news.ycombinator.com/item?id=22625370](https://news.ycombinator.com/item?id=22625370)

Probably too different to merge the submissions.

------
joeberon
I used this recently to speed up some symbolic manipulation. I was using SymPy
but its simplify is really quite slow and the documentation basically just
says "work out exactly which simplifications you need and apply them", however
in my case I needed something completely general. Now I check whether
wolframscript is installed and then just call it in the command line. It's
much faster for complicated simplifications, but also much slower for simple
stuff (I guess it has a long start up time)

SymPy has a built-in converter to/from Mathematica (although it can't convert
from Mathematica lists yet), so that's helpful

(Here's the project I used it in for interested people
[https://github.com/joebentley/simba](https://github.com/joebentley/simba))

------
qubex
I’m a Mathematica addict and (as I have remarked elsewhere) rely predominantly
on iPads as my platform of choice. Sure, Wolfram Online works fine when a
network connection is available, but I’m really, really, really hoping that
sooner rather than later they’ll release a fully fledged notebook & back-end
kernel version of Mathematica for the iPad.

This shows some flexibility on their behalf, but it’s moving in the wrong
direction (as far as I’m concerned, at least).

~~~
akjssdk
I would say that porting Mathematica to the iPad would require them to be able
to run the Mathematica engine on iPadOS. And with the strict rules Apple has
around arbitrary code execution I would highly doubt that is going to happen.

~~~
qubex
That’s actually a misconception: Apple has allowed interpreted languages (e.g.
Python, as in Pythonista) to tun on iOS/iPadOS for several years now. The
Wolfram Language is definitely an interpreted language and therefore would not
fall afoul of their rules.

~~~
7thaccount
It's also a multi-gigabyte installation full of Java, C, and Wolfram code. It
is huge....so I'm sure there are some difficulties.

~~~
jxy
I have been using the engine for almost a year since they announced it.
Without the notebook interface, it's only 1.6 GB.

    
    
        $ du -h -d3 pkg/Wolfram/
        3.1M    pkg/Wolfram/WolframScript/bin
        3.1M    pkg/Wolfram/WolframScript
        5.0K    pkg/Wolfram/man/man1
        5.5K    pkg/Wolfram/man
         13K    pkg/Wolfram/doc/wolframscript
         14K    pkg/Wolfram/doc
         40K    pkg/Wolfram/WolframEngine/12.0/Executables
         30M    pkg/Wolfram/WolframEngine/12.0/AddOns
        1.6G    pkg/Wolfram/WolframEngine/12.0/SystemFiles
         10K    pkg/Wolfram/WolframEngine/12.0/Configuration
        1.6G    pkg/Wolfram/WolframEngine/12.0
        1.6G    pkg/Wolfram/WolframEngine
        1.6G    pkg/Wolfram/

~~~
7thaccount
Other people below are showing 6-8 GB on their systems, so it's lower than
what I recall, but still higher than your figure I would normally bet. Are you
only counting 1.6 once?

~~~
jxy
What do you mean? Should I count 1.6 multiple times?

I just realized that this number is after ZFS compression. Here is the
apparent size,

    
    
        $ du -h -A -d3 pkg/Wolfram/
        5.0M pkg/Wolfram/WolframScript/bin
        5.0M pkg/Wolfram/WolframScript
        8.5K pkg/Wolfram/man/man1
        9.0K pkg/Wolfram/man
         16K pkg/Wolfram/doc/wolframscript
         16K pkg/Wolfram/doc
         30K pkg/Wolfram/WolframEngine/12.0/Executables
         46M pkg/Wolfram/WolframEngine/12.0/AddOns
        2.9G pkg/Wolfram/WolframEngine/12.0/SystemFiles
        2.0K pkg/Wolfram/WolframEngine/12.0/Configuration
        3.0G pkg/Wolfram/WolframEngine/12.0
        3.0G pkg/Wolfram/WolframEngine
        3.0G pkg/Wolfram/
    

Actually the downloaded file is a little over 1 GB,

    
    
        $ stat -f "%z %N"  Downloads/WolframEngine_12.0.0_LINUX.sh   
        1177035547 Downloads/WolframEngine_12.0.0_LINUX.sh

------
georgewsinger
Wolfram Language is _insanely_ great. I've been using wolframscript as (i) a
shell replacement and (ii) a piping/glue language for larger projects.

Wolframscript makes this hard though for the following two reasons: (i)
wolframscript requires users to login before any script can be ran; (ii) only
1 wolframscript REPL can be open at a time.

(i) makes it impossible to export wolframscripts to users who don't know what
wolframscript is. For example, if I'm using wolframscript as a build tool for
a larger Haskell project, and some user downloads my software, they'll first
have to login to Wolfram Cloud before the wolframscript is able to run.
There's no way I'm going to force people to do that, so it hinders the growth
of the language.

(ii) makes it hard to use wolframscript as a complete terminal replacement.
People often use multiple terminals at once, at different locations in the
file system. Wolframscript only allows once at a time.

Wolfram Language is insanely good. It should be more popular than Python. I
think fixing some of these licensing/login issues could help it grow.

~~~
tome
> Wolfram Language is insanely great

That sounds exciting. Can you explain more?

~~~
vtail
It's hard to come up with a short answer to explain the greatness of the
tightly integrated system with tons of functionality and highly sophisticated
function/rule based programming style, but let me give you a quick taste of
it: the following code

    
    
        CloudDeploy[
          FormFunction[{"a" -> "Number", "b" -> "Number", "c" ->    "Number"}, 
          Plot[#a x^2 + #b x + #c, {x, -10, 10}] &],
            Permissions -> "Public"]
    

will create and deploy a publicly accessible web form that asks for 3
coefficients and plots a parabola. How many lines of code / external libraries
would you need to do the same thing in python?

[https://www.wolframcloud.com/obj/e0b275e6-49a2-4901-a806-e36...](https://www.wolframcloud.com/obj/e0b275e6-49a2-4901-a806-e3622fa1906c)

~~~
tome
Cool! Is it because the Wolfram libraries and infrastructure are great, or is
there something in the semantics of the language that makes this so nice?

~~~
vtail
For me, it’s a combination of many many convenient built-in functions, and
high level constructs for functional and rule-based programming. I recently
played with the language to get functionality similar to what R’s dplyr
provides - it can give a sense of what kind of advanced “meta-programming” is
possible.

[https://community.wolfram.com/groups/-/m/t/1901462](https://community.wolfram.com/groups/-/m/t/1901462)

------
reikonomusha
In my opinion, while Mathematica is the world’s best general purpose
calculator, it does more harm than good in producing reproducible and
explainable science and math. The topic of math software being closed source
has been beat to death (by me and others), so I’ll veer into a different path.

As a tiny anecdote, a colleague of mine recently published a paper in quantum
computation and computed a representation of some mathematical object,
specifically the exact value of an angle which modulates a particular quantum
gate. In the paper was this bizarre continued fraction along with arctans and
pi’s that no experimental physicist in their right mind would have derived
themselves.

“Where in the world did _this_ come from?” I asked, while reviewing the paper.

“Oh, it’s just what Mathematica gives,” he responded. “I don’t even fully
understand it. But I do use it as proof that the angle is an irrational number
and thus breaks its inclusion in some known finite group.”

You might call out this otherwise accomplished physicist for what appears to
be misusing the tool—taking results at face value without understanding
them—but I guarantee scientists and engineers are doing this stuff daily, in
more consequential places than abstract quantum physics papers.

Wolfram and his team have built something amazing, and built an incredibly
successful business, but I hope he uses his business acumen to find a way to
contribute to the “greater good” while he continues to enjoy running a company
and making money.

~~~
nikofeyn
what is the alternative? using some open source project that has no clear
steward and nearly zero incentive (financial or otherwise) for tracking down
esoteric bugs?

mathematica is built by a company that seems to take a lot of pride in
quality. they are also clearly incentivized by keeping the company afloat and
thus by addressing major issues.

i hear people barking incessantly about open source software in mathematics
and science, but i just don't see what would actually be successful. in most
people's daily jobs in engineering and even in large science projects,
proprietary code is used everywhere. it's the only way to get things done in
many cases. in my experience, getting a bug acknowledged, prioritized, and
then fixed in open source software is like pulling teeth. what are you going
to do with open source mathematics or scientific software where only like a
person or two understand the bug? your story could easily have replaced
mathematica with sage, and the story wouldn't be changed at all. okay fine,
sage is open source. but what's more likely to be successful: (1) you are
going to look through the likely millions of lines of code that makes up sage
and find what's happening, or (2) you call up wolfram and ask what's going on
since you have support for a product that you paid for?

how is open source software supposedly inherently better for math and science
research?

~~~
reikonomusha
Open source software first and foremost means reproducibility. With open
software, anybody on earth with the right equipment can easily and trivially
reproduce a result at no additional cost or hindering contractual terms.
Reproducibility is paramount, and sits at the very core of science. Results
that cannot be reconstructed hardly count as new knowledge.

(As a funny story, even Wolfram-the-company can’t run SMP, the predecessor of
Mathematica. Why? They can’t decrypt it or unlock it, and can’t figure out how
to work around it.)

Every major tech company on earth uses open source software at the heart of
their business. So we know something sustainable is possible.

Open source, one-size-fits-all math software is a tough nut to crack. I think
most people could get most of their algebra and calculus done with existing
open packages like wxMaxima or Sage. Specialized computations, such as those
in group theory, already have open source implementations that exceed any
closed competitor.

As for the construction of a competing CAS, some organization would have to
employ a team. That costs money, and so far no company (that I know!) sees it
as either a worthwhile investment or charitable cause. If folks do know of a
company, I’d love to know.

~~~
nikofeyn
> Open source software first and foremost means reproducibility. With open
> software, anybody on earth with the right equipment can easily and trivially
> reproduce a result at no additional cost or hindering contractual terms.

why? why is proprietary software less reproducible? aside from cost, i might
even argue that proprietary software is more reproducible. open source
software often has dependency hell. how are you sure that the dependencies and
software installation is the same between two computers?

how are results not able to be reconstructed with proprietary software, aside
from cost (which is not your argument)? if someone has a result found in
mathematica, then couldn't that same method be reconstructed in other software
to compare results? if it can't, then mathematica provides some feature not
found in other software.

and plenty of science operates by not being fully reproducible by independent
parties due to cost and available equipment. that's often mitigated by people
reproducing the experiments or results with different equipment and even
methods. and even then, every regular joe still can't reproduce the results
due to massive costs.

~~~
reikonomusha
> why is proprietary software less reproducible?

Proprietary software is less reproducible because the software artifacts
literally cannot be reproduced in different environments. That's why I
mentioned SMP as an example; even the vendors of the software can't reproduce
their own artifact. Moreover, vendors rarely provide access to previously
released versions, because "newer is always better". And nobody, except the
vendor, is allowed to host or publish old/different versions. The availability
of the source code does not also somehow prohibit binaries from being
published.

> how are results not able to be reconstructed with proprietary software
> [...]?

Cost, legal viability, availability, shareability, etc. Cost is just one
aspect. I also can't provide my copy of Mathematica along with my code that
produces my results to you; I'm contractually obliged to _not_ copy the
software, and so even if I _wanted_ to allow you to reproduce my results, I
have no power to do so.

> and plenty of science operates by not being fully reproducible [...]

This doesn't mean we should be driving away from reproducibility just because
it's lacking in some areas of science.

~~~
nikofeyn
i feel like you're beating around the bush with a definition of reproducible
that fits your preferences. and i have no idea what you mean by "artifacts".

here's a quote from the NSF: _" reproducibility refers to the ability of a
researcher to duplicate the results of a prior study using the same materials
as were used by the original investigator. That is, a second researcher might
use the same raw data to build the same analysis files and implement the same
statistical analysis in an attempt to yield the same results…. Reproducibility
is a minimum necessary condition for a finding to be believable and
informative"_.

[https://stm.sciencemag.org/content/8/341/341ps12.full](https://stm.sciencemag.org/content/8/341/341ps12.full)

let's say someone has some data and a method to process that data. if they
implement it in mathematica, then someone else can do the same implementation
in mathematica and attempt to reproduce the results. so what if they had to
pay for it? that doesn't affect the reproducibility. it's a barrier maybe, and
a small one, but it doesn't make it inherently less reproducible. someone else
could take the data and method and implement it in something else, say matlab,
sage, octave, or whatever, and attempt to reproduce the results. i know of a
researcher who does this very thing. he likes mathematica, but his graduate
students use a range of software to do their own work and produce results. he
takes their methods and investigates and implements them in mathematica to see
if they are reproducible. this is good mathematics and good science. just
because mathematica is involved doesn't all of the sudden make everything un-
reproducible and bad science.

if you're thinking, but oh, if it's open source, i could crawl through and
understand everything the code is doing. but nobody does that. it isn't even
feasible in anything but the simplest of simple cases.

> This doesn't mean we should be driving away from reproducibility just
> because it's lacking in some areas of science.

i didn't say we should. but in all the comments sections of big physics
announcements, we don't see people whining about reproducibility. i can't go
and reproduce the LIGO experiment in my backyard because it takes huge amounts
of money, equipment, and engineering expertise. that's why many things don't
compete that well with mathematica. it takes a lot of time, money, and
expertise to develop such a software package. the opposing model (open source
software) just barely drags along and could disappear at any time as
maintainers come and go.

------
enriquto
I was a heavy user of mathematica 20 years ago, on a 486 with MS-DOS. Of
course, it was inside a terminal. Has the ability to run mathematica textually
been lost in the meantime?

~~~
mrpippy
I hope not, historically you've always been able to run the MathKernel from a
terminal and interact with it that way. Maybe this is the same thing, just
more targeted to use as an interpreter.

------
giggly_gopher
This seems like they just polished some rough edges off of the existing
command line version of Mathematica. I wish they would not call it Wolfram
Language. His ego/talent ratio is already so high it's NKS level buffoonery.

~~~
eigenvalue
Why do people feel the need to denigrate Wolfram at every turn? He is
obviously a genius of the highest caliber, who has dedicated his life to
making useful tools to advance science and engineering. He has made a
tremendous positive impact. People should focus more on making their own
positive impact instead of trying to tear Wolfram down for his awkward but
ultimately harmless lack of self awareness.

~~~
mistrial9
.. because when I met him personally at a hack event in the 1980s, he was
obviously in the "dominant and loud" mode, and directly commanded anyone
within earshot, at most opportunities.. later, it turned out he forked his
company and left the people who built Mathematica out of future profits.
Silicon Valley bred people like that .. it is still common in some
environments.

~~~
jjtheblunt
My grad math advisor was one of the folks who wrote significant parts in
Urbana of the symbolic core; the behind the scenes team got legal settlements
after that strange move. He's not from Silicon Valley; I think he'd done some
early prototyping and coding himself while at CalTech (in Lisp if i recall)
then came to Urbana-Champaign as a research prof, and got the team of several
to build it out. [ I've been using it since 1988, and love it. ]

------
praptak
It's proprietary. Do we need another Flash?

~~~
simonh
If you don't need it, don't use it.

~~~
praptak
I'm just pointing out that proprietary languages tend to die outside
proprietary environments.

~~~
unlinked_dll
Matlab and Java seem to be doing alright

~~~
qchris
Both of them certainly have their uses, but especially for MATLAB, are they?
I'm working as an engineer in academia right now, and even with all the legacy
holdover of MATLAB, many people I know (including almost every undergrad
project I've helped with) are either using R or Python, and I know I don't go
for it unless I'm absolutely forced. And that's nothing to say for the
researchers whose eyes light up upon hearing of Julia.

Few of those people seem like they'll be advocates for buying expensive seat
licenses if they become PIs down the line or join industry 5-10 years from
now.

Mathematica seems a little different because I don't believe there's currently
a viable alternative, let alone a commonly used one.

~~~
Archit3ch
In my experience, the engineers who don't specialize in programming prefer
MATLAB. Programmers will be comfortable in it, but will sooner reach for
python etc.

Much like Excel, it's easier to get people to program if you can convince them
it's not programming.

~~~
qchris
I definitely agree in this about Excel (some things I've seen some 'people who
don't like programming' do in Excel are positive mind-blowing), but just
haven't seen that same thing in MATLAB. That could definitely be just because
of a limit of my own experience, though, and your point makes a lot of sense.

