Working with TML: Examples

in #tauchain5 years ago

Now that the TML Bot has been released I can show some examples of what TML looks like and some code. TML syntax resembles closely to Prolog. For those who know nothing about Prolog it works under a completely different paradigm from proceduralor even functional programming languages. Prolog is a declarative programming language which means you have to describe your program in a way which resembles how an artist might sketch. TML is closely aligned to the syntax so I'll explain a bit about Prolog and then go into specifics of TML.

Prolog inner workings

The inner workings of Prolog include:

  • Predicates (including some built in)
  • Clauses (FACTS+RULES)
  • Unification
  • Queries

A famous example of a Prolog program:

man(socrates).
mortal(X) :- man(X).

Which means of course socrates is a man = FACT.
Which means also all man are moral = RULE.
So if you were to type: mortal(socrates). Prolog should return "Yes" or "True".

TML Bot Basics

In TML for example you can input:
year_month_days(2019 December 31).

This will add as a fact the current date into the database. You can also add rules using +RULE or delete rules using -RULE.

TML also has the feature called intersection. If you want the full list of commands:

<mr_tau> # Commands: help, list, clear, add, del, db, rules, try, run, slot, list_slots, select, unselect, load, intersect, version. Use '.help(COMMAND).' to get help for the COMMAND.
<mr_tau> # Input prefixes: . (REPL), + and - (add/del rule), : (selecting slot), < << or <<< (load), ? (intersect). Use '.help("PREFIX").' to get help for the PREFIX.

Currently one problem is we do not have enough builtins. Certain features available in Prolog just are not yet offered by TML. We also do not have full use of arithmetic as far as I know. Most important for programmers we do not have full input/output builtins to allow for read and write but this will be doable soon.

If we can have enough useful builtins it may be possible soon to translate from TML to C++, from Prolog to TML, and so on. Once we can translate in this manner we will see the development process dramatically speed up but there are still some unknowns from my perspective.

We may get for example second order logic but will it be fast? Ohad is confident he can deliver second order logic and have it be efficient. We also do not yet have the full use of arithmetic nor do we have operators. We can improve the syntax by allowing basic operators programmers are used to such as greater than, less than, and so on.

The current level of the TML Bot is at the earliest most basic level yet it is still sufficient to create TML programs. This means Tauchain development can start at any moment.

Sort:  

Seems there is still missing a lot.
Where is the team? Is Ohad a One-man show? Is there an accident-scenario? Will TAU collapse, if that genius would be gone?
Any why doesn´t show Coincap the market cap for AGRS?
However I will give it a try and buy a few AGRS tokens. Lets see.

There are over 6 programmers now and more join all the time. The more sophisticated the Tau Bot becomes the easier it will be for programmers to join in.

Some of that other stuff you mention is legal/political. I don't know about that stuff.

To listen to the audio version of this article click on the play image.

Brought to you by @tts. If you find it useful please consider upvoting this reply.

Coin Marketplace

STEEM 0.23
TRX 0.21
JST 0.036
BTC 97780.60
ETH 3397.25
USDT 1.00
SBD 3.25