3 ms·
This reminds me of the philosophy behind Forth, where you build up 'words' enough to express your program, but by itself it doesn't have much built in.
by snarfy 11y ago
This reminds me of the philosophy behind Forth, where you build up 'words' enough to express your program, but by itself it doesn't have much built in.
- Frondo 11y agoThat's something that always kinda bugged me about tcl, the language is pretty bare bones in itself and you end up writing some pretty basic stuff in any given project. Of course you end up building your own little standard library over time, but then you've got to import it into any given project.. Just an irritating extra bit of friction. And reading someone else's code means learning their standard library... (is it a standard library when everyone has their own?)
- mannykannot 11y agoIs this simply a consequence of Tcl not shipping with the sort of standard libraries that are expected nowadays, as opposed to being a problem that follows from having a terse language?
- Frondo 11y agoI like that question and that distinction, and I think the answer is I'd give is "yes". Tcl's flexible, to the degree of being able to define new language constructs or redefine built-ins (e.g. you can redefine the basic if-then if you want), which is great in some ways. But it always seemed to me like the language culture is so deep in the mentality of "if you need, implement it yourself," that the flexibility becomes a crutch for the language developers. What I mean is.. well, the basic data structure is the list, and you get built-ins for adding to a list (lappend), reversing a list (lreverse), but removing an element from a list (what would be 'lremove')? You've got to code it yourself. Hey, the man page for 'lreplace' even gives an example! http://www.tcl.tk/man/tcl/TclCmd/lreplace.htm http://www.tcl.tk/man/tcl/TclCmd/lreplace.htm Why isn't that built in? The common answers are, it's so simple you can code it yourself, or you might want an lremove with different behavior than me. To the second answer, realistically, if the language had a built-in lremove, most people would just express their programs to use it, and those who needed a different one could still write it. To the first, yes, it's simple, but it's just a little bit of sand in the underwear--unpleasant friction you'd like to ignore but keeps popping up. Lack of built-in OO was the same way until relatively recently in the language history. Lots of people made home-brew ones, and there were several common OO systems, but what's a newbie to do? Research all the different OO systems to make a decision first? More sand in the underwear. Run into enough of that stuff and it just drives you crazy and makes you want to stop using the language.
- mannykannot 11y agoI think a reference to Guy Steele's essay 'Building a Language' is appropriate here: http://www.cs.virginia.edu/~evans/cs655/readings/steele.pdf http://www.cs.virginia.edu/~evans/cs655/readings/steele.pdf In a commentary on the essay, Scott Rosenberg says: Plainly, Steele started out intending to show just how painful the words-of-one-syllable limit is — and, by extension, how desperately programmers need the ability to expand the vocabularies of languages that feel impoverished (“a thought that seems like a primitive in our minds turns out not to be a primitive in a programming language, and in each new program we must define it once more”). Yet what’s fascinating about “Growing a Language” is that the limits Steele imposed on his expression make the paper far more accessible, precise and clear than most computer-science writing. http://www.wordyard.com/2007/06/12/steele-growing/ http://www.wordyard.com/2007/06/12/steele-growing/