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>
}
}
I created the tag
mint-lang
due to the existence of [tag:Mint] already related to the Mint operating system.– Woss
the answer was not enough? can I put more details, just say what is not missing :)
– Ricardo Pontual
@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.
– Woss