5 ms·
> It is true that this system can be used to program arbitrary logic, it can however become a bit clunky when trying to code imperative logic that works with in
by georgewsinger 6y ago
> It is true that this system can be used to program arbitrary logic, it can however become a bit clunky when trying to code imperative logic that works with inplace references and mutable data structures. Nevertheless it is a very powerful domain tool for working in scientific computing and the number of functions related to technical domains that are surfaced in the language represents decades of meticulous expert domain expertise.
Can you explain this more? Why is (i.e.) the Wolfram Programming Language best thought of as a "domain" tool, and not a general purpose programming language? Why couldn't someone build an extraordinarily complex piece of software (say with millions of lines of code) under term-rewriting paradigm (like Wolfram) in a domain that has nothing to do with traditional mathematics/scientific computing?
BTW, my favorite Wolfram fact is that it is the most concise programming language on the Rosetta: https://blog.revolutionanalytics.com/2012/11/which-programming-language-is-the-most-concise.html https://blog.revolutionanalytics.com/2012/11/which-programmi...
- 6gvONxR4sf7o 6y agoYou could. But as one of the Mathematica devout, it works be a massive pain in the as compared to other languages better suited for it. Assuming languages are equivalently expressive (in the Turing complete sense), the difference is in what they make easy. It’s easier to make a small web API in python than assembly, even though they can do the same things. Mathematica is designed to make (symbolic) mathematics easiest. It excelled there at the expense of weirdness elsewhere. The answer unfortunately reduces to “I dunno, try it and see.”
- chubot 6y agoYeah I'm finding myself explaining the difference between shell and Python a lot: https://news.ycombinator.com/item?id=24873284 https://news.ycombinator.com/item?id=24873284 Shell is good for creating Unix systems because of the tools it provides. ... It's hard to explain, but if you work in that area, you'll very quickly see it. I think many people have learned one language, or 3 languages that are similar, and they think all languages do roughly the same thing. That's incorrect on all counts: in terms of the core data model, the operators, and the libraries. If you do a lot of work in a specific domain, you'll start to see all the differences. Shell is the best tool for bringing up machines, which happens a lot in both the cloud/web and embedded spaces. ---- Ditto for R. R makes a lot of tasks really easy, and a lot of other ones really hard (like being 10x slower than Python, or 1000x slower than C, for many tasks). That sounds horrifying, but it really helps you get a lot of work done. Another thing people have trouble appreciating is the difference between R and Matlab, and Matlab and Mathematica. Those 3 languages are drastically different because of both their core data model and who uses them.
- kmill 6y agoIt's "fine" for imperative programming if you never make a mistake: the problem is that it is extremely permissive and won't stop execution on errors. I usually add my own error checking and default cases to cause programs to halt, and these help a lot, but there are still a number of footguns. One example is what happens if you map a function f over a list lst: f /@ list. Oh, the variable was called lst and not list? Mathematica will happily evaluate this and result in list, assuming list has not been defined. This is because what /@ does is apply f to each part of the expression, and a Symbol has no parts. If Mathematica had a way to declare which global symbols can be used in local expressions, it might help prevent this class of bugs.
- BoiledCabbage 6y agoThe assembly analogy is a very faulty analogy. The reason assembly is harder is because it's a lower level language and requires significantly more code to accomplish the same. Most term re-writing languages are actually higher level than python. And so in theory would take fewer lines. The real difference is noone has created a set of libraries for the web api domain space in a term re-writing language. If they did, it'd be easy. And similar to others in this thread, I think term re-writing languages will be prominent in programming future. The same way many years back people could see functional programming over the horizon in programming future.
- dTal 6y agoI would beware of concluding too much about Wolfram Language's expressiveness from that Rosetta fact. The language is notorious for including the kitchen sink in its standard library, to the extent that many common Rosetta tasks will simply be library calls. Which is all wonderful and practical, but doesn't imply very much about the language design.