TIL: Tcl-inspired command language on top of D
til-lang.github.io
TIL: Tcl-inspired command language on top of D
1–10 of 26 posts
Re: TIL: Tcl-inspired command language on top of D
#2Re: TIL: Tcl-inspired command language on top of D
#3>The number of spaces does count. Not counting indentation, it should always be one.
is the silliest "opinion" I've ever seen.
Re: TIL: Tcl-inspired command language on top of D
#4Now make a TIL/Tk and I'm sold!
Re: TIL: Tcl-inspired command language on top of D
#5TIL is opinionated, all right, but this >The number of spaces does count. Not counting indentation, it should always be one. is the silliest "opinion" I've ever seen.
Re: TIL: Tcl-inspired command language on top of D
#6TIL is opinionated, all right, but this >The number of spaces does count. Not counting indentation, it should always be one. is the silliest "opinion" I've ever seen.
Fair enough. I'm willing to know about use cases for more than one space - and I'm completely sincere. The language is just born, we have time to adjust all these details.
Indifferent is the default: it means you only need whitespace when tokens would otherwise parse wrong, like `symbol1234` vs. `symbol 1234`. Also, you can add as much as you want, the parser doesn't care.
Significant means that whitespace is semantic, meaningful. This almost always means depth of indentation, although I've encountered other semantic whitespaces in the wild.
Sometimes lining things up just looks nicer. Here's an example of how I like to construct a literal Lua table:
local colors = { black = 0x000000,
white = 0xffffff,
red = 0xff0000,
blue = 0x0000ff,
green = 0x00ff00, }
Lots of whitespace! Two spaces on either side of the longest equals, for the longest symbol, and left-alignment on the keys.I don't like this nearly so much:
local colors = { black = 0x000000,
white = 0xffffff,
red = 0xff0000,
blue = 0x0000ff,
green = 0x00ff00, }
The hex values are all over the place, it makes it harder to read them and see the pattern. Consider a collection of binary flags as another example where you really want the right column to line up.You could choose to right-align the left column, so that the equals are in the same place and the right column lines up, but why should you? Then you miss the semantic indentation. They're columns, I want to column align them.
I support no tabs, though :D we share religion on that one.
Re: TIL: Tcl-inspired command language on top of D
#7TIL is opinionated, all right, but this >The number of spaces does count. Not counting indentation, it should always be one. is the silliest "opinion" I've ever seen.
Fair enough. I'm willing to know about use cases for more than one space - and I'm completely sincere. The language is just born, we have time to adjust all these details.
Re: TIL: Tcl-inspired command language on top of D
#8Kudos to the TIL's author for trailblazing this idea based on TCL. It will be very beneficial and handy for scripting commands and shell like behaviors. Just wondering is this type based TCL like language similar to Little? [2] Will it eventually support compilation similar to Emacs Lisp? [3]
Personally I'd love to have superset language in D for data science. It should be also easily embeddable and support prototyping like Lua. On top of that it should have excellent support for array, ndarray and dataframe like R [4]. Since it is based on D, then it can fulfil the the requirements for both type A and B data scientists [5].
[1]https://news.ycombinator.com/item?id=27102584
[2]https://wiki.tcl-lang.org/page/Little
[3]https://arxiv.org/abs/2004.02504
[4]http://adv-r.had.co.nz/Data-structures.html
[5]https://www.quora.com/What-is-data-science/answer/Michael-Ho...
Re: TIL: Tcl-inspired command language on top of D
#9TIL is opinionated, all right, but this >The number of spaces does count. Not counting indentation, it should always be one. is the silliest "opinion" I've ever seen.
Fair enough. I'm willing to know about use cases for more than one space - and I'm completely sincere. The language is just born, we have time to adjust all these details.
Re: TIL: Tcl-inspired command language on top of D
#10Earlier quoted context omitted.
Fair enough. I'm willing to know about use cases for more than one space - and I'm completely sincere. The language is just born, we have time to adjust all these details.
People expect whitespace to be either 'indifferent' or 'significant'. Indifferent is the default: it means you only need whitespace when tokens would otherwise parse wrong, like `symbol1234` vs. `symbol 1234`. Also, you can add as much as you want, the parser doesn't care. Significant means that whitespace is semantic, meaningful. This almost always means depth of indentation, although I've encountered other semantic…
Now I'm thinking about math, also. The assignment with "=" is not a thing on Tcl-like languages in general, but maybe some "formulas" would benefit from more spacing, like
set x 1 + 2 + 3
set y 1000 + 2000 + 3000
(or something like that. YMMV)Okay. I'm changing that as soon as I can. Thank you very much.