What is the Mint language?

Asked

Viewed 217 times

7

When dealing with Javascript frameworks we realize that there are a multitude of options, with new ones popping up all the time. Angular, Vue, React, Svelte, Stencil and others I can’t even remember. Some self-designated frameworks, others clearly say they are not framework, just a set of tools, others say they are pre-compilers, etc.

More recently I realized the existence of Mint, who I believe is the first to call himself programming language.

The Programming language for writing single page Applications.

In this context, it is easy to remember the existence of Typescript, which is a superset of Javascript itself, but this does not seem to be the intention of Mint.

So what makes Mint a programming language for SPA development? What does it differ from Typescript?

  • 2

    I created the tag mint-lang due to the existence of [tag:Mint] already related to the Mint operating system.

  • the answer was not enough? can I put more details, just say what is not missing :)

  • 1

    @Ricardopunctual It was good, but as the reward is to attract more attention to the question, I’m letting it roll until the end of the reward.

2 answers

5


As quoted in the question and the official link to Mint:

The Programming language for writing single page Applications

In free translation:

The programming language for writing SPA applications (from a single page)

That means that, unlike javascript and of the typescript, which has a scope, a broader purpose, the Mint is focused on creating an application frontend, and more specifically, an application SPA (Single Page Application).

The Javascript and the Typescript (as an extension of Javascript) can be used to write applications frontend other than spa, as well as applications backend, what already differentiates its purpose. This itself responds in what the Mint is different: it is specific to SPA applications.

But for such a purpose, he has what it takes to create an application SPA?

That other question What is SPA and what is different from a non-SAP page? has an answer with a simple and clear understanding of what a SPA:

A SPA (Single Page Application) is an application that does not recharge the page during your lifetime.

That is, it is an application (Web) that does not make those customary page "reloads" when browsing or doing certain actions. As this is a web application, a SPA should use HTML and CSS, which are the basis for the browser to display the page.

To control their behavior, browsers support the Javascript, so the language should either give full support, or generate code compatible with Javascript, to be finally supported by browsers. As well as typescript, the Mint is compiled:

It is a Compiler and a framework Combined to provide Great Developer Experience while allowing to write safe, readable and maintainable code.

In free translation:

It is a combined compiler and structure to provide an optimal developer experience, allowing writing secure code, readable and sustainable.

Information taken from here: https://www.mint-lang.com/guide

That is, the language has what it takes to develop a SPA application, which will work in market browsers.

If we look at the examples of code, we notice the presence of HTML, CSS and language logic, to support states, routes, etc., essential elements for a web application and a SPA application:

component Counter {
  state counter = 0

  fun increment {
    next { counter = counter + 1 }
  }

  fun decrement {
    next { counter = counter - 1 }
  }

  fun render {
    <div>
      <button onClick={decrement}>
        "Decrement"
      </button>

      <span>
        <{ Number.toString(counter) }>
      </span>

      <button onClick={increment}>
        "Increment"
      </button>
    </div>
  }
}

component TodoItem {
  property color = "#333"
  property label = ""
  property done = false

  style base {
    align-items: center;
    display: flex;
  }

  style label {
    font-weight: bold;
    color: #{color};
    flex: 1;

    if (done) {
      text-decoration: line-through;
    }
  }

  fun render {
    <div::base>
      <span::label>
        <{ label }>
      </span>

      <Icon.Checkmark/>
      <Icon.Trash/>
    </div>
  }
}

0

Complementing what has been said, Mint aims to be more cognitive to allow a more product-oriented development environment. This can be seen in the author’s own comments.

gdotdesign on Feb 5, 2020 | Parent | Favorite | on: Mint: A Programming language for writing single pa...

Author of the language here, I think it is a major Advantage for several reasons:

  • the Documentation is in one place Instead of several Places

  • the dependencies of a Mint project is usually a few megabytes Since Everything is included Instead of hundreds of megabytes (I have a Production app that does not have any dependencies at all)

  • only need to Learn one (Compact) Thing, Instead of Many Complex Things (Complex Since there is no Compiler to make it simple)

  • only need to update the code Once there is a new version of the language not Every time there is a new version of a dependency

On top of the Libraries mentioned the language also includes a Formatter, package manager, Builder/dev server and testing Environment, also for which you would need to add dependencies.

All of These add up to Less Cognitive load so I can Focus on building the product Instead of Managing the Development Environment.

Source: Article

Browser other questions tagged

You are not signed in. Login or sign up in order to post.