Are there any programming languages where everything is a string. For example, let's consider this Tcl snippet (comments shows the equivalent statement in C/Java) for e.g.
set x [append ab cd] ;# c = "ab" + "cd"
set m 1 ;# m = 1
set n [expr $m + 1] ;# n = m + 1
Effectively, this is reverse of what is found in languages like C or Java; here by default what we type is a literal string unless it is a "special" word or preceded by $ sign (in which case, the string succeeding $ is a variable).
Rexx (Restructured Extended Executor) and OORexx are two languages with the same philosophy:
In Rexx -- somewhat like in TCL -- to a large extent everything is a string. Having stacks and streams composed of lines gives you a simple list or array of strings. But mostly, strings simply act like other datatypes as needed. For example, a string that contains a suitable representation of a number (digits, decimal, an exponent "e", etc.) can be used in arithmetic operations. For processing reports, log files, and the like, this is exactly the behavior you want.
*nix has many such mini-languages. For example:
References
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With