Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Laya the open source version of Jev(convaiinnovations.com ↗)
    34comments
  2. Human brain is two separate organs, Stanford Medicine-led research finds(stanford.edu ↗)
    147comments
  3. AI-generated posters don’t have to be horrible(john.hartnup.uk ↗)
    298comments
  4. “The Secret Life of Circuits” is here(coredump.cx ↗)
    31comments
  5. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    500comments
  6. GPT-6 Astra Solves a WWI German Radio Cipher(prinzai.com ↗)
    104comments
  7. San Francisco Onion Futures Company(onionfutures.com ↗)
    88comments
  8. If math is more than proof, we need to better celebrate the rest of it(terrytao.wordpress.com ↗)
    139comments
  9. Communication by means of modulated Johnson noise(pnas.org ↗)
    12comments
  10. Cloudflare Quick Tunnels(cloudflare.com ↗)
    294comments
  11. From Stonemasons to Carpenters(thelastsoftwareengineer.substack.com ↗)
    3comments
  12. How to Write with an LLM(sockpuppet.org ↗)
    353comments
  13. You can run Git on object storage if you re-make packfiles(tigrisdata.com ↗)
    21comments
  14. SDCC – Small Device C Compiler(sourceforge.net ↗)
    20comments
  15. Saving another 100TB of RAM(cloudflare.com ↗)
    86comments
  16. Ray Ozzie and the Optimism of Being Early(reproof.app ↗)
    2comments
  17. Science Is Open Software(jepedersen.dk ↗)
    45comments
  18. Why building a Rust LSP is hard(rust-glancer.github.io ↗)
    42comments
  19. How OpenAI Used Its Own LLMs to Design Its Jalapeño Chip(ieee.org ↗)
    105comments
  20. NASA-IBM Lunar Foundation open-Source Geospatial AI Model(usra.edu ↗)
    5comments
  21. Ctenophores: Wonders of Biology(quantamagazine.org ↗)
    6comments
  22. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    113comments
  23. OpenJev(openjev.com ↗)
    273comments
  24. Goroutine Leak Profiles(go.dev ↗)
    6comments
  25. Show HN: I wrote a custom assembler for CHIP-8 in C++(github.com/tackx ↗)
    4comments
  26. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    89comments
  27. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    76comments
  28. Veronese's Dogs(publicdomainreview.org ↗)
    2comments
  29. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    94comments
  30. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    16comments

The Little Programming Language

101 pointsby 10y agolittle-lang.org
58 comments
10y agoHN ↗

From 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.

10y agoHN ↗

"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

[1] http://www.postgresql.org/docs/9.3/static/functions-matching...

[2] http://www.regular-expressions.info/postgresql.html

[3] https://swtch.com/~rsc/regexp/regexp1.html

[4] https://en.wikipedia.org/wiki/Comparison_of_regular_expressi...

10y agoHN ↗

I 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.

10y agoHN ↗

Thanks. 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?"

10y agoHN ↗

I 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!

10y agoHN ↗

Our 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.

10y agoHN ↗

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.

10y agoHN ↗

so I recognized that madness immediately.

It's just bizarro lisp without the parentheses.

10y agoHN ↗

It combines the power of Visual Basic with the readability of PostScript.

10y agoHN ↗

Keep in mind that this example was (presumably intentionally) cherry-picked to show off the worst of Tcl's syntax. It's not really representative of how expressive the language can be in the right context, and it doesn't show the benefits that you can get from having a very simple, regularized syntax with little added sugar.

On the topic of expr, though, it can be avoided if desired in favor of Lisp-style prefix operators: http://www.tcl.tk/man/tcl8.5/TclCmd/mathop.htm

10y agoHN ↗

There are things to like about tcl, but lists aren't really one of them.

Not cherry picked, an "official" page describing lindex: http://wiki.tcl.tk/1481 Objectively compare that with most any other language's docs for lists/arrays/whatever. "Everything is a string" does have some downfalls.

10y agoHN ↗

I think you might have misinterpreted my point. When I said it was cherry-picked, I did not mean that it wasn't a legitimate example or that lindex is not a real, standard Tcl function. It's a completely fair example and is something that is liable to happen in practice.

All I meant is that it was clear from the context that an example was chosen showing a weakness of the language (relative to standard C-like syntax) and that it's not quite fair to judge the whole language based on that one example.

Tcl's incredibly simple syntax and lack of syntactic sugar are what lead to situations like that example. But those same things are also responsible for making the language Lisp-like and fairly homoiconic. You can do incredible things in Tcl thanks to its simple syntax which is amenable to macros and code generation.

10y agoHN ↗

That example was contrived but it wasn't designed to show off the worst of Tcl's syntax. There is worse out there.

Little wasn't a slam on Tcl, if you think that then you miss the point. Little is trying to bring people to Tcl. The Tcl ecosystem has a boatload of good stuff, people should check it out.

But many people are put off by Tcl's syntax, it's fine for glue, which is what Ousterhout intended, but it sucks for 300,000 lines of code. If you want to write big programs then perhaps some type checking could help you. And perhaps some familiar syntax might help. Little is for people that have to maintain a pile of code.

10y agoHN ↗

Tcl is fine for big projects. Use OO as does Tk. Use namespaces. And type checking isn't exactly difficult in the language. Some combo of catch {} and scan usually does it for me.

10y agoHN ↗

SQLiteStudio developer here. I think it's a project which could be considered big. Version 2.x.x was written entirely in Tcl and the main problem was memory sharing with threads. There's none. Threads can communicate only by messages. Worse than that - each thread has to load very same packages and same procedure definitions (into separate memory segment) for each thread that wants to use them. Threads in Tcl are like processes that can communicate through pipe. It's a major pitfall of this language in context of more complex projects. Besides that it is a very nice language to use and read. Gives quick results with little effort. I still use it almost every day, just not for complex projects.

I'm aware of tsv package (shared variable), but this is just sharing scalar variables or arrays. You cannot share objects, procedures, namespaces, resources, etc - and that is the major reason for sharing memory across threads.

10y agoHN ↗

Message passing without memory sharing. Isn't that what Erlang processes are? Is it because having to load the packages into the thread makes it too large? Just curious.

10y agoHN ↗

Tcl just totally wants to be event driven and single-threaded. I agree wholeheartedly with your assessment of threading in Tcl - the standard Tcl ideology is "don't use threads." It was a pretty deliberate decision as I recall.

10y agoHN ↗

Whats the best resource for Tcl ecosystem and getting its main benefits?

10y agoHN ↗

It's really important to use reduction of strength for lindex references:

set j [ lindex $red $i ]

set k [ lindex $green $i ]

set m [ lindex $blue $k ]

set x [ expr $j - $m ]

10y agoHN ↗

We (BitKeeper folks) did our GUI interfaces in Tcl/Tk years ago because it meant we could have one gui person and get the same gui tools on Windows, Mac, Unix, and Linux. Yes, somewhat clunky (less so over the years), but as a small start up it was great not having to have a developer for each platform, both for initial coding and for ongoing maintenance.

hey, that describes my very first development job! i wrote a cross-platform tcl-based installer for a desktop application at the first company (a small startup) i ever worked for. it was really easy to write (i was literally 17 years old) and there were fairly solid libraries for doing windows-y registry-ish things and unixey install things too. one of the senior guys on the team took my code and integrated it into their cross-compiled build system and it spat out a very decent product that helped our users install the program on i think 3 or 4 different platforms (win95, linux/X, and solaris, possibly HPUX or some other weird platform). that was my very first significant contribution to any software project.

i seem to remember that at the time the shrinkwrapped installer licenses cost $10's of thousands for commercial use. it probably took about 60-80 hours of my time at $17.50 an hour... clearly a bargain.

10y agoHN ↗

We (BitKeeper folks) did our GUI interfaces in Tcl/Tk years ago because it meant we could have one gui person and get the same gui tools on Windows, Mac, Unix, and Linux.

Ok, sounds reasonable. Except... now you have to hire another person to do language development/maintenance :)

10y agoHN ↗

Now that's a valid point. So it's 2/3rds instead of 1/3rd but the guy doing the language is a languages/compiler guy (used to be professor at Brown) and he loves this stuff. So not a big money win but definitely a big karma win, he's having fun.

10y agoHN ↗

Looks 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.

10y agoHN ↗

Tcl 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.

10y agoHN ↗

That was actually the original prototype. Little has moved on to have a pointer object type.

10y agoHN ↗

I 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.

10y agoHN ↗

Tclkit 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.

10y agoHN ↗

Always 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.

10y agoHN ↗

Little 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.

10y agoHN ↗

I 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.

10y agoHN ↗

It's not very clear from the page -- does it work on Windows at all?

10y agoHN ↗

It has for years when built as part of BitKeeper, I think there are some issues in how we open sourced it. It's being discussed over on the forum, you might look there.

10y agoHN ↗

That's a shame, since I program in J, and I've tried the free K version. L would have made my PL list quite funny! I'll take a look at it, since I have used tcl/tk in the past.

10y agoHN ↗

Banging 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.

10y agoHN ↗

You 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

Tk can look just fine.

10y agoHN ↗

Have you ever had to try converting a large pile of pre-existing Tcl/Tk code to L?

Wondering how much work that would be...

10y agoHN ↗

It's a rewrite but it can be incremental, you can mix and match Tcl and Little code in the same file.

10y agoHN ↗

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

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).

10y agoHN ↗

Yup, that's the price you pay for having it cross platform and avoiding C++. If I were making that choice today, might lean towards Qt, but I'm not sure. Tk's widgets are really pleasant to use, the last time I looked at Qt it was a lot lower level (may have gotten better, it's been a while).

10y agoHN ↗

I...I...still feel like this is a joke, even after reading the "why" section.

10y agoHN ↗

Please don't snarkily dismiss other people's work on HN.

Thoughtful criticism is fine, but it should be grounded in respect.

10y agoHN ↗

The 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.

10y agoHN ↗

I'm the boss and I wrote the why page, I was poking fun at myself. Perhaps my sense of humor needs an upgrade.

10y agoHN ↗

I 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 agoHN ↗

Oh interesting. Like the above commenter, I didn't think of this at all. Your humor is definitely up to date :).

10y agoHN ↗

I didn't see a LICENSE file on github. What is this code licensed under?

Edit: Nevermind - it's in the README.

10y agoHN ↗

For other people reading here: It is built on Tcl and released under Tcl's license. BSDish.

10y agoHN ↗

Trying to figure out where the code for Little lives - is it in a fork of the Tcl/Tk repo itself?

10y agoHN ↗

Yes it is a fork but the core team is already trying to unfork it. We're excited about that and will try and help.

10y agoHN ↗

Well, this is a really well designed and beautiful language, i really enjoyed it.

10y agoHN ↗

This is the kind of stuff I come to HN for; a cool language I knew nothing about.