A Class of Computer Languages: Math Lang

canvas is scum. invented by scum. The likes of C, C++, OpenGL, etc, whose tenet is: hi, my name is speed. Ever since, programing is hell. 〔➤ HTML5 Canvas vs SVG

vast majority of programers, 99%, have no idea of mathematical language. Talking to them about lang debates, is like talking to idiots.

all these langs programers are familiar with,eg C C++ java python perl ruby golang even C# and even Haskell, are non-math languages.

in the other universe, is Mathematica, matlab, APL… (and i think julia), these, are math languages. (note: haskell is NOT.)

most of these industrial programers, since they've never seen a math lang in their life, cannot conceive some points in lang debates.

thus, debating them is like talking to stone. Even you see their points, but they don't see yours, after repetition.

typically, these folks revolve around concepts like reference, pointer, memory, certain “garbage collection”, and “hi, my name is speed.”

and other stuff they are found of are like: “threads”, “float, int, long, double”, some IEEE fuck stuff, OpenGL

and, of course, they prefer 0 based index.

these langs, are like greedy algorithms. They win at outset, but lose big time in the end. As far as efficiency and speed goes.

but, commercialism is on their side. Thus the rise of C, Unix, the grand danny of all things worst. Thus born Worse Is Better.

so, there's these langs, Wolfram lang, Matlab, APL, (R, Julia), not sure if there is a label that characterize them, other than “math”

“array langs” does not capture them, because eg they all don't have concepts of memory, ref, float/int. (given or take)

the distinguishing feature is that they have little to none implementation/hardware concepts. eg ref pointer memory, bytes, bits.

instead, they focus on programer's need to deal with data. programing. numbers, string, list, file. a specific aspect of “higher level” lang

on the other hand, Haskell is a bastard. Seems mathy, seems high-level, but, filled to the brim of computer engineering by-product stuff.

another term i think capture them is “application languages”. But, this term doesn't sound good. and people will start to think excel too.

recap: the group of langs am thinking of is: Wolfram Language, APL, R, Julia, Matlab, Prolog. (please add) possibly include bash, tcl.

to get insight, its interesting to ask: wtf's a float. A boat? you end up with cpu & bits. Thus born a computer engineering side effect.

ever since, programer's minds are tainted with a world of computer engineering side effects. This crime began with C+Unix.

in real life, a inevitability, there exist real numbers. And, a representation is decimal number notation. This is not a float. it's a Real.

in math langs eg Wolfram Lang, there's no such thing as float. But, there is Real number with Machine Precision. BIG difference.

LISP, is perhaps the first lang, that started the road of math langs. But, today's Common Lispers, no understand it.

Note: this is not a bash against low level langs. But, against langs that do not separate implementation and language.

almost all industrial langs, do not separate implementation and language. Much due to C having tainted programer's brain.

C is such a virus. Because its defect, it spawn csh tcsh C++ java objc C# and basically all lang's syntax too. A snowball effect.

for all javascript's idiocies, we can actually trace it all back to C, via Java.

the End.


SVG pain. inverted y axes; text default scale is absolute

inverted y axes

the y coordinate is inverted from normal

Solution, attach all your drawing to a group, then apply transformation, like this:

gp.setAttribute("transform", xd.translate(0, 2*ymin+ywidth) + xd.scale(1,-1) );

but, the problem is, if you have text, the entire font gets inverted upside down too.

So this means, there isn't simple solution to work with “not invert” y axes. Maybe there's a attribute to make text not invert or something. Still don't have a nice solution.

the inverted y axes is a major pain, because it drains brain when you work with “normal” y-axes, such as in math plots. Either twist your brain, or, you need to remember to attach a transform to every of your drawing primitive. Or, group them and transform.

text default scale is absolute

you can use svg viewBox to specify your drawing's coordinate range. that is, xmin, xmax, ymin, ymax

this makes it convenient. For example, if your app is plotting basic math functions, you can work with coordinate x from -10 to 10, y from -10 to 10. Instead of pixels and whatever is the current width and heigh of view port

but, if you add text in your drawing, such as axies labels, the text default to font size 16px. So, you have to manually figure out what's the scaling from your view box to view port, and rescale all your text elements.

〔➤ SVG Coordinates, Viewport, viewBox