B
As quoted in the question and the official link of Mint:The programming language for writing single page applicationsIn free translation:The programming language for writing SPA applications (of a single
page)That means different from that javascript and itself typescript, which has a scope, a more comprehensive purpose, the Mint is focused on creating an application Frontend, and more specifically, an application SPA (Single Page Application).O Javascript and Typescript (as extension of Javascript) can be used to write applications Frontend that are not SPA, as well as applications backend, which already differentiates its purpose. That by itself responds to what Mint is different: it is specific for applications SPA.But for such purpose, it has what is necessary to create an application SPA?That other question What is SPA and what is different from a non SPA page?
has an answer with a simple and clear synthesis of understanding what is a SPA:A SPA (Single Page Aplication) is an application that does not recharge
page during your lifetime.That is, it’s an application (Web) that doesn’t do those page “reloads” customs when you browse or do certain actions. Because it is a web application, a SPA must use HTML and CSS, which are the basis for the browser to display the page.To control your behavior, browsers support Javascript, then language should or give full support, or generate code compatible with Javascript, to the end be supported by the browsers. As typescript, 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 compiler and a combined structure to provide a great
developer experience, allowing you to write a secure code,
legible and sustainable.Information 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 the market browsers.If we look at the code examples, we notice the presence of HTML, CSS and the logic of language, 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>
}
}