HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
silentbicycle
tamale
Lua2010–2017
silentbicycle / tamale

tamale

TAble MAtching Lua Extension - An Erlang-style pattern-matching library for Lua

2Distinct people
11Mentions
1Explicit recommenders
149GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

TAble MAtching Lua Extension - An Erlang-style pattern-matching library for Lua

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

Each table (dict, hash, whatchamacallit) has a hash portion and an array portion, and contiguous integer keys are stored internally in the array. So, tables automatically adapt…

silentbicycle used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year11 dated mentions

Observed mentions: 2010-07-22 13:11:34 UTC to 2017-03-22 11:38:23 UTC.

02462010-01-01 00:00:00 UTC to 2011-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments20102011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2017

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20102010-01-01 00:00:00 UTC2011-01-01 00:00:00 UTC707
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC202
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC101
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC000
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC000
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC110

What Hacker News says

11 sources
Pattern matching is going to be a hard sell in Java, because languages based around pattern matching place a much, much higher emphasis on values rather than identity. You need good data structure literals, and to have two things with the same content be interchangeable, not just two objects that currently happen to have the same fields. In other words, I think OOP and pattern matching are inherently antagonistic language features. They can coexist in a language (OCaml also has both), but not really in the same code. I figured this out working on a library for pattern matching in Lua (https://github.com/silentbicycle/tamale); Lua is less pervasively object-oriented, and uses literal "tables" (basically, JSON) quite a bit, so it's a better fit.
In [dead]
FWIW, I wrote a pattern-matching library for Lua, Tamale (http://github.com/silentbicycle/tamale/). It was an interesting project, because almost everything I could find about implementing pattern-matching assumed the patterns could be analyzed at compile time, rather than building some kind of dispatch tree at runtime. After trying some more elaborate methods (e.g. building a decision tree via CPS), I figured out that just indexing (on the first field, by default) and then doing linear search within the index's patterns got 90% of the benefit with very little runtime analysis.
In Functional Thinking after OO
I haven't found libraries lacking, but we probably work on different things, and I don't have any problem with writing quick wrappers for existing C libraries. There's a fair bit of Lua libs that are insufficiently documented or tested, or have bit-rot (esp. due to changes in Lua itself), but the situation is getting better. For libs, I usually check http://lua-users.org/wiki/LibrariesAndBindings and http://luarocks.org/repositories/rocks/ . I've written a couple libraries, as well. See e.g. lunatest (http://github.com/silentbicycle/lunatest, an xUnit-like + randomized (QuickCheck-ish) testing library) and Tamale (http://github.com/silentbicycle/tamale, Erlang-style pattern-matching for Lua).
In In praise of Go or "Why I moved from Python and C++ to Go"
silentbicycle·Nov 8, 2010Recommendation phrase
Each table (dict, hash, whatchamacallit) has a hash portion and an array portion, and contiguous integer keys are stored internally in the array. So, tables automatically adapt their internal implementation for use as an array, a dict, or both, at runtime. They're unique to Lua, AFAIK. It also has an interesting hash table optimization (that I don't quite grok). I've been reading through the Lua code bit by bit, but haven't made it there yet. Lots of other interesting stuff, though. LuaJIT's not too shabby, either! Lua's my favorite language for quick hacks, period. I wrote a library to add fairly idiomatic pattern matching (http://github.com/silentbicycle/tamale/). Every language needs pattern matching. :) I'm still working on explaining PM to people who aren't already into Erlang or ML, but it's documented now.
In First public release of the Gosu programming language for the JVM
Well, there are plenty at LuaRocks (http://luarocks.org/repositories/rocks/). It's no CPAN, but the essentials are there. I'm working on a couple, such as Tamale (http://github.com/silentbicycle/tamale/), which adds Erlang-style pattern matching. I'll post it on LuaRocks once the docs are done. Of course, if you're embedding Lua (in a game, for example) you've already got the libraries you need, and extra libraries would just get in the way.
In Node.js Versus LUA "Hello World" HTTP Server Showdown
The major benefit with awk is that it runs as a pattern recognizing/processing filter by default, so it handles certain common problems in very little code, and fits particularly well in Unix shell pipelines. I'm also a big fan of structuring code in terms of pattern-matching. (I wrote an Erlang-style pattern matching library for Lua, btw: http://github.com/silentbicycle/tamale/ ) I write a lot of little awk scripts, but if they grow past ~5 lines, they usually get rewritten in Lua. (Perhaps eventually with inner loops in C.) Still, Awk is simple and useful enough that it's still worth knowing.
In Why you should learn at least a little bit of Awk
Same here. Unification rocks, though I think to have full unification rather than just pattern matching, the language needs logic variables first. (Right?) "Just" pattern matching is still great, though. FWIW, I'm working on a pattern-matching library for Lua. (tamale: http://github.com/silentbicycle/tamale) It uses linear search and backtracking rather than compiled decision trees at the moment, though I have the latter mostly done - there are a few failing tests for variable corner cases, though. (Maybe I'll get to them this weekend.) It allows repeating variables in patterns, too.
In Lisper's first look at Haskell

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.