JavaScript/DOM String Value Problem and Symbolic Languages

By Xah Lee. Date: .

Programing language, design, js/dom issue: when coding web, lots things are in string. e.g. HTML attributes. This is a major programing pain. Figure out, make a logical statement, what exactly is the problem. Find the article i may have written on this.

The problem apparently is that values are strings. Imagine a programing language, where all values must be strings. No int, no float, no num, all strings.

programing web with JavaScript/DOM is like that due to HTML/SGML attribute values needed to be quoted as string.

why HTML/SGML attribute are strings? because back then, 1980s, SGML is meant just to be a text file. Not programing language. And with invention JavaScript (1995) (an effort to make web pages interactive), came DOM (1998) as effort to standardize the js/html interaction, the string value became part of the lang.

the string problem is particularly pronounced when you have CSS 2D Transform functions [see CSS: 2D Transform] and SVG coord Transformation [see SVG: Coordinate Transformation]

when coding in JavaScript , you have pain like this

js dom string value problem 2018-11-12 f01dc
JavaScript / DOM string value problem (in TypeScript)

i think this answers a long time question i have on symbolic languages (Mathematica, lisp).

programing language can either be symbolic or not. there is no in-between.

One use of symbolic lang is that it allows syntactic transformation (via symbolic pattern matching. e.g. lisp macro do a bit)

What's other use?

Answer: it solves problems like the string value problem of JavaScript/DOM.

If you have a question, put $5 at patreon and message me.