7 ms·
Little: a tcl-based c-like scripting language
- sigzero 10y agoCongrats on the release!
- nprescott 10y agoFrom the "L Programming Language" PDF: “It’s like perl without the nastiest bits.” I think that really does capture the spirit of what this language looks like. I'm not sure it will reach any kind of general applicability, but it seems like a tasteful nod to the extensible nature of Tcl either way. Curious to see the inclusion of PCRE over Tcl's ARE which I thought was pretty routinely trotted out as a better performing, more limited, RE engine.
- bch 10y ago"higher performance" depends on the specific case. I think the Tcl RE engine (Henry Spencer's[0], which is also used in PostreSQL[1][2]) does avoid some pathological cases where Perl/PCRE fall down[3], but PCRE does best Spencer's work in other areas. They also simply have a different feature list[4]. [0] http://wiki.tcl.tk/396 http://wiki.tcl.tk/396 [1] http://www.postgresql.org/docs/9.3/static/functions-matching.html http://www.postgresql.org/docs/9.3/static/functions-matching... [2] http://www.regular-expressions.info/postgresql.html http://www.regular-expressions.info/postgresql.html [3] https://swtch.com/~rsc/regexp/regexp1.html https://swtch.com/~rsc/regexp/regexp1.html [4] https://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines https://en.wikipedia.org/wiki/Comparison_of_regular_expressi...
- tclmeelmo 10y agoI really, really like that "Why?" explanation page; I feel like many projects could benefit from copying that idea. Frequently, the first thought I have when I see projects is, "okay, neat, but why does this exist?", and the answer takes some digging. It's wonderful that in this example the answer is made so obvious.
- luckydude 10y agoThanks. Given the state of the world we felt that not answering why would just get a pile of "Neat|WTF|Huh - why did you do this?"
- tclmeelmo 10y agoI should have also said in the original comment that Little, beyond the website, looks genuinely neat and I'm looking forward to exploring it further. I just finished skimming through the paper you have linked on the site and liked it quite a bit. It directly answered another question I had, which was what would it take to implement Lisp-style syntax in the same fashion as you did for C-style syntax? I'd normally talk myself out of ideas like that, but your paper is talking me into thinking about it more. Thanks for sharing all of this!
- luckydude 10y agoOur pleasure. We're around on the irc channel or the forum or someplace there is a mailing list (if not, dev@bitkeeper.com gets to all the people that are current hackers). I'm tickled pink that Little is on the front page of hacker news.
- tyingq 10y ago> I really, really like that "Why?" explanation page; Me too. Especially the comparison of tcl to their language: set x [expr {[lindex $red $i] - [lindex $blue [lindex $green $i]]}] vs x = red[i] - blue[green[i]] I had to work in Tcl early in my career...80 hours a week for a straight year, so I recognized that madness immediately.
- kevin_thibedeau 10y ago> so I recognized that madness immediately. It's just bizarro lisp without the parentheses.
- fancy_pantser 10y ago
- yumaikas 10y agoLooks like a very interesting little language, I enjoyed working with TCL a fair bit due to things like wish being so interactive. It's also interesting that they added pointers to TCL, which solves my biggest gripe with TCL.
- luckydude 10y agoTcl had them already, we're just using upvar under the covers. upvar uses the variable in the stack frame you specify. Which is clever and all but sort of a pain to use so we just did the &this_is_sort_of_a_pointer thing but it's a compiler managed upvar under the covers.
- ob 10y agoThat was actually the original prototype. Little has moved on to have a pointer object type.
- luckydude 10y agoBTW, a buried discussion here: https://news.ycombinator.com/item?id=11527154 https://news.ycombinator.com/item?id=11527154
- sea6ear 10y agoI haven't tried this yet, I've just looked at the examples in the docs. However, I think this could be pretty cool. I think the combination of the Perl influences with the possibility (which I'm interested in, but haven't proven yet) of using this with Tclkit (a statically linked version of Tcl that can just be copied over for deployment) might make this a nice cross platform replacement for the kind of things I might otherwise want to do in Awk. Tcl itself is also certainly a good cross platform Awk replacement, but heavy regex stuff seems like it might be a bit more concise with this syntax than in Tcl itself.
- luckydude 10y agoTclkit should work, we haven't tried though. The tcl folks on #tcl on freenode might be able to help. Tcl doesn't get enough love, the built ins and the libraries provide a pretty rich environment and then you toss in Tk and all the Tk extensions and you have something. And now you have it all with a C like syntax, kinda cool.
- jrapdx3 10y agoAlways nice to see Tcl/Tk get attention, it's a language I've often found quite useful. Seems like I'd heard of "L" before in connection with Tcl/Tk, but not sure it was the same thing as Little. Certainly seems it could be a good alternative, a quick look at the syntax makes me think of it like a kind of typed Javascript. The ability to tap into the underlying language, e.g., event loop, Tk UI, coroutines, should be an advantage. There probably is a way to install Little when TclTk 8.6 (and extensions) are already installed (there's a warning about trashing the pre-installed binaries), and not have problems due to moving or replacing existing libraries that applications depend on finding in established locations.
- luckydude 10y agoLittle is L, we used to call it L and got beat up because you can't google it. Supposedly googling little-lang is better. If you build it with our makefile then it will live next to tcltk 8.6. If you don't then it will want to dynamically link in some libs and it will get the wrong ones and barf.
- jrapdx3 10y agoI remember being interested in L when I read about it a few years ago, so it's great that it's open-sourced now. Should be fun to try it out. I'll give the makefile a whirl. As for the name, "L" would be hard to Google, though "C" and "Scheme" are too. While I guess "little" would be somewhat easier to search for than "L", it sure isn't as obvious as "Clojure" or "fortran". Outstanding names are hard to invent.
- luckydude 10y agoLet us know what you think. This thread will be fleeting, we are on the IRC channel as well as the forum at https://users.bitkeeper.org/c/little-language https://users.bitkeeper.org/c/little-language The IRC channel seems most active.
- grok2 10y agoIt's not very clear from the page -- does it work on Windows at all?
- kingmanaz 10y agoBanging out GUIs in Tk is a delight when contrasted with developing in whatever javascript framework is popular this hour. Tcl itself is pragmatic to an extreme; a great framework for both organizing large projects and heaping up fast primitives written in C. Anyway, great job! I hope Little's syntactic sugar gets more people exploring Tcl/Tk. Can't wait to give it a whirl.
- luckydude 10y agoYou hit the nail on the head. Tcl/Tk doesn't get enough love, it's a really useful system even after all these years, it's gotten much better in terms of looks and it was always great in terms of what it could do. All Little does is make it more approachable for the 9x% of the world that prefers C, types, etc. When people say Tk looks bad point them here: http://www.little-lang.org/gui.html http://www.little-lang.org/gui.html Tk can look just fine.
- starseeker 10y agoHave you ever had to try converting a large pile of pre-existing Tcl/Tk code to L? Wondering how much work that would be...
- luckydude 10y agoIt's a rewrite but it can be incremental, you can mix and match Tcl and Little code in the same file.
- cosarara97 10y ago> Firefox vs us on Linux That's a bit of an unfair comparison. Gtk has lots of nice themes which AFAIK Tk can't use. That dialog doesn't exist on Firefox anymore, but this is what Thunderbird's preferences look like on my machine: https://my.mixtape.moe/fggaex.png https://my.mixtape.moe/fggaex.png It's true, Tk can look okay on linux, but it will still be out of place when placed side by side with Gtk and Qt apps (Qt can use Gtk themes).
- Ericson2314 10y agoI...I...still feel like this is a joke, even after reading the "why" section.
- Ericson2314 10y agoWhat, boss didn't want to spend a day relearning syntax so many many many more man-hours get spent making a new syntax?! All for tk?!
- dang 10y agoPlease don't snarkily dismiss other people's work on HN. Thoughtful criticism is fine, but it should be grounded in respect.
- Ericson2314 10y agoThe vibe I got from reading the "why" section was "yeah we had some fun making this, and yeah we think this syntax is a bit better, but isn't it ridiculous our boss thought this was a good idea!" Like a wink at anybody who think this isn't needed. So to the extent I think its a joke, I think its intentionally a joke --- and whoever made it I respect their comedic talents.
- luckydude 10y agoI'm the boss and I wrote the why page, I was poking fun at myself. Perhaps my sense of humor needs an upgrade.
- nickpsecurity 10y agoI totally missed that the boss wrote that page. Maybe I wasn't perceptive enough but it came off to me like employees taking a crack at their boss. Not in Dilbert-style disrespect more as everyone turning an eye-rolling issue into a fun project. It was funny. I just didn't think it was you, though. Maybe sign it "The Boss" or something similar at the end to make sure the rest of us get the full joke.
- 10y ago
- c0d0r 10y agoI didn't see a LICENSE file on github. What is this code licensed under? Edit: Nevermind - it's in the README.
- wscott 10y agoFor other people reading here: It is built on Tcl and released under Tcl's license. BSDish.
- c0d0r 10y agoTrying to figure out where the code for Little lives - is it in a fork of the Tcl/Tk repo itself?
- luckydude 10y agoYes it is a fork but the core team is already trying to unfork it. We're excited about that and will try and help.
- sdsk8 10y agoWell, this is a really well designed and beautiful language, i really enjoyed it.