days
-1
-1
hours
0
-4
minutes
0
-1
seconds
-5
-4
search
a.k.a. "Time is Space"

Tisp: There’s a new functional programming language in town

Gabriela Motroc
Tisp

© Shutterstock / Alhovik

There’s a new functional programming language in town and its name is Tisp — “Time in Space”. No, this is not Sci-Fi Monday: Tisp “wears” the MIT license and aims to be simple, canonical, and practical. Let’s see what it has to offer.

Programming languages are springing up like mushrooms after the rain: Microsoft researchers and engineers, and academic researchers at the University of California, Berkeley and Imperial College in London developed P, a programming language for modeling and specifying protocols in asynchronous event-driven applications and now there’s a new functional programming language which proudly wears the MIT license — Tisp a.k.a. “Time is Space.”

Tisp TL;DR

According to the documentation, Tisp is a functional programming language with implicit parallelism and concurrency. It aims to be simple, canonical, and practical.

  • Tisp evaluates every output of a program (such as printing a string and sending an HTTP response to a client) parallelly and concurrently by default leaving synchronization optional.
  • Tisp keeps the other part of a program pure (i.e. without any output).
  • Therefore, every program in Tisp can run parallelly and concurrently with nothing special!

Since existing programming languages are synchronous by default, it’s no wonder that many frameworks, languages and libraries featuresfor parallel, concurrent, and asynchronous programming have emerged in recent years.  This is where Tisp comes into play: “it takes the different way to deal with this problem. It lets you write programs which are asynchronous, concurrent, and parallel inherently.”

SEE ALSO: Functional programming made easy: Here comes Eta

The concept

Tisp assumes that time is space.  Since nothing changes over time, that means everything is constant.

This fact lets us write programs as functions which map their inputs to outputs.

Here is how Tisp work:

Let’s think about a program which takes input data input[t] and outputs something output[t] at every time step t. Then, every output[t] should be calculated from all inputs in the past.


input[0], input[1], ..., input[t-1] -> output[t]

This is true for any t. Therefore, a program can be represented as a function which maps its inputs to outputs.

program : input[0], ..., input[T] -> output[0], ..., output[T]

where T is infinite generally. Then, we can extract great parallelism of a program because the program as a function represents just data dependency.

Tisp evaluates the outputs concurrently and parallelly. Programmers must specify their causality using the seq primitive function if necessary.

SEE ALSO: Lux — A functional programming language in the Lisp tradition

List of features

  • Purely functional programming
    • Impure function calls in pure functions are detected and raise errors at runtime.
  • Implicit parallelism and concurrency
    • Most of the time, you don’t need to parallelize your code explicitly. Tisp does it all for you!
    • Inherently, programs written in Tisp run concurrently and can run parallelly.
  • Optional injection of parallelism and causality
    • You can also increase parallelism of your code or run functions sequentially using par or seq primitives. (paris not implemented yet.)
  • Asynchronous IO
    • Every IO can be run asynchronously by the par primitive.
  • Dynamic typing

Tisp: A hybrid of…

Tisp may rhyme with Lisp but this programming language has “borrowed” aspects from five languages:

  • Haskell
    • The concept of “Time is Space”
    • Lazy evaluation and data structures to realize it
  • Clojure
    • Everything is a value; no object system
    • The syntax and macro system
  • OCaml
    • The syntax close to pure lambda calculus and of mutual recursion
  • Python
    • The Zen (See python -c 'import this'.)
    • The syntax of function calls with positional and keyword arguments
  • Go
    • Simplicity
    • Tisp utilizes Go’s coroutine runtime.

 

Keep in mind that Tisp is still “under heavy development” but contributions are more than welcome.

asap

Author
Gabriela Motroc
Gabriela Motroc is editor of JAXenter.com and JAX Magazine. Before working at Software & Support Media Group, she studied International Communication Management at the Hague University of Applied Sciences.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of