Simple Drawings with Mathematica
leancrew.com
leancrew.com
Graphics3D[{Gray, phone, Black, Thick, xaxis, yaxis, zaxis},
This has always seemed an odd API to me, in that the arguments can alternate between "the objects being drawn" and "stylistic configuration params" which act like imperative commands setting the current state of the color or whatnot.With that said, Wolfram as a whole seems well-designed, so I wonder if I am missing something deeper, and curious to hear the rationale from Wolfram experts.
No further insights on the design rationale, but yeah, that's exactly what's going on.
But if that is the case, I'd expect all the arguments to be of some type like "Command", which is not the case here. These expected objects have types like RGBColor or Cuboid or Circle. So it's a list of heterogenous types, which are interpreted as a series of commands... odd.
Perhaps instead of thinking of this as a function, I should think of it as a mini DSL for constructing graphics.
Note that Graphics[...] is also used to 'internally' define any internal graphical object, as you can see with InputForm[Plot[...]]. And the chosen syntax seems particularly easy to parse (so as to generate a bitmap, say). So maybe it was designed primarily with that in mind rather than as an API?
According to the documentation Graphics[] has been a part of Mathematica since v1 from 1988. It is probably one of the functions that did not exist in Mathematica's predecessors (like SMP [1]) which largely focused on symbolic algebra. So it might have been up to Wolfram himself to invent a convenient syntax from scratch.
[1] See https://writings.stephenwolfram.com/2013/06/there-was-a-time... but, in typical Wolfram style, insufficient credit seems to be given to other symbolic manipulation products that existed at the time.
There's a name for that in the world of shape-grammar type things but I forget what it is.
I think that any such "self describing" set would lend itself to being translated to other self describing sets. It might even be guaranteed. A neat transform.
A software language could be like that.
We could do a subset of math that is like that.
It's eminently feasible to do a drawing system like that.
http://conal.net/talks/denotational-design-lambdajam-2015.pd...