Share your repls and programming experiences

← Back to all posts
TablaM: A practical relational language
mamcx (11)

P.D: The team repl is at (exact as the one here). The user interface not allow to point to this?

Is a pleasure for me (Mario) & my friend (Sebastian) to present our entry for this contest.

We are the team @TablaM

I start programming in the 1990s with FoxPro, a full-stack programming environment (at that time we don't use cool names like "full-stack") where was natural to use databases... and it was VERY productive.

You can do ALL (forms, reports, databases, utilities, etc) with a single language & environment.

Microsoft, in a very weird move, kill it together with Visual Basic (shocking because was the MOST popular lang at the time) when it try to move all to .NET. So everyone jumps off the ship and the only remanent of the idea is today represented by Access and a few other tools, nearly all proprietary, stuck in the past or in pieces of what kid this days call "NoSql/BigData", that have a higher complexity.

Now, after using more than 12+ languages and more frameworks and libraries that I can count, I wanna get back that experience: A tool tailored for data, where data is as important as code and the way to use it don't require ORMs or others tools that cause the well know impedance mismatch.

This means that were most languages are focused on low-level details or engineering at large, TablaM will be tailored with some small & big design decisions to make it enjoyable to write applications for e-commerce, finance, ERPs, and similars.

The most distinctive feature of the language is the use of the relational model as the base for its operation. This allows us to provide a set of universal and consistent operations that make it easier to manipulate data.

For example, where most languages have different methods to "query" items (sometimes called find, other times get or search or filter or ...), meaning you need to learn all different ways that change according to the context or kind of value you are using, in TablaM is just ?where, and ALL values, even files, databases, sockets, values, numbers, text, etc... can be queried with the same set of operators. And you don't need to code them, because are universally available.

A small taste of the language as planned (what work today is in the docs):

-- A column, aka: Vectors...
let qty := [10.5, 4.0, 3.0] 

-- Like APL/kdb+ operations apply to more than scalars
qty * 16.0 
-- Show: Vec[it:Dec; 168.00; 64.00; 48.00]

-- The ? (query) operator allow to do SQL-like queries to anything
let doubled := qty ?select #0 * 2.0 

-- like files!
let products := open("products.csv")

-- and is streamed, so can query big ones
for p in products ?where #price > 0.0 do

-- so, we can do joins between anything:
for p in cross(products, qty) ?limit 10 do
	print(p.products.price * p.qty)

-- No nulls, we have proper algebraic types
type Status = case Pay, NotPay end

-- Use databases:
use db.sqlite
let db :="data.db")

for sale in db.invoices ?status = Status.Pay do

So, what kind of language is TablaM?

Note: Items marked (tbd) are in the roadmap...

  • Build on the high-performance Rust language.
  • Available to major 64-bit platforms (Linux, Windows, MacOS, iOS (tbd), Android (tbd)).
  • Easy to embed in another languages, similar to Lua. (tbd)
  • Multi-paradigm, but strongly based on the relational model. Also provide functional, array & imperative capabilities.
  • Immutable values are the default, but allow mutable ones.
  • Null safe.
  • Provide decimal math as the default, instead of binary floating-point, making it better for business applications.
  • Provide date types as primitives type, instead of using some external libraries (or ugly built-in library) to operate it.
  • Provide Algebraic Data Types (tbd).
  • Provide SQL/LINQ-like experience across any relation. Like other languages say "anything is an object", in TablaM, "*anything is a relation*".
  • Built-in support for a variety of protocols, formats, and data transformation (tbd).
  • No needs for ORMs. Talk directly to major RDBMS/SQL databases (PostgreSQL, MySql, SQL Server, SQLite) (tbd).

We have prepare this material for this contest:

Oficial Site



Initial relational operators

Small standard library

Run on Relp.It

Video (in Spanish with subtitles in English, we are from Colombia :colombia: !)

TheDrone7 (1776)

Hello. This jam required you to submit a team repl. Might I enquire as to why you did not provide a team repl and a personal repl instead?

mamcx (11)

@TheDrone7 I was unaware of this. I just assume it work this way... I create one on the team but can't change it (

mamcx (11)

@TheDrone7 I try to change it and the UI not allow? I put the link in the post, can be enough?

TheDrone7 (1776)

@mamcx what are you being not allowed to do?

mamcx (11)

@TheDrone7 No, the UI only shows my personal repls. I pick the one it showed assuming it was ok... The one for the team not show at all...

TheDrone7 (1776)

@mamcx oh, yes you only need to put the link in the post, clicking on the link, embeds it automatically.

TheDrone7 (1776)

@mamcx yes it is! I'll be moving it back

drsensor (22)

FoxPro FTW!
Making this embeddable can be quite challenging. You need to carefully abstract the IO operation 🤔

mamcx (11)

@drsensor Surely. My plan is to provide a kind of "embeddable trait" where some major things need /can be replaced for implementators. Today all IO are "just" functions, so just provide alternative IO functions I think can fit the bill. I'm not sure today, but I wish to make this to run on top of WASM so can work in the browser.

drsensor (22)

@mamcx I think you also need to abstract the database protocol in a trait too and support various DB behind a feature flag to keep the dynlib and wasm module as small as possible.

mamcx (11)

but I don't want to tie the language to a specific store (that is a mistake every time somebody tries to apply the relational model: Go and add a full rdbms)

drsensor (22)

@mamcx it's not tying to a specific store. Just make a trait that is generic enough so that people can extend the language to their DB of choice by using it as a crate/library.

mamcx (11)

@drsensor Part of the prior comment gets lost!. Is a good idea, I was thinking of a trait for parts of the lang but not for the DB side, and it makes a total sense to include...