pinto

Last updated:

0 purchases

pinto Image
pinto Images
Add to Cart

Description:

pinto

The pint° (/pĩntʊ/) programming language.

Warning
The pinto° programming language is still in very early development stage, and
is not recommended for use in production software. Use at your own risk.

The pint° programming language is a language that compiles to Dart.
It has the following objectives:

Have seamless interoperability with stable Dart;
Consider Flutter as first-class;
Generate legible Dart code that can be used as is
Be terser and more expressive than Dart;
Provide a powerful macro system with great ergonomy.

Currently, the language is in very early-development, and only supports a single
feature, which is data clases generation.

How to use pint° #
Requirements #
You need the latest stable version of Dart installed on your machine.
Installation #
Install the pinto executable with pub.
dart pub global activate pinto
copied to clipboard
The pinto_server executable will be also available for a LSP implementation.
The current LSP implementation is only supported by the
VSCode extenstion.
Compiling with the pinto executable #
With the pinto executable you can compile a pint° file.
pinto your_file.pinto
copied to clipboard
The compiled Dart file will me printed in you stdout. This means that, if you
want to redirect it to a file, you may use >, like the following example.
pinto your_file.pinto > your_file.dart
copied to clipboard
Language overview #
Imports #
You may import Dart SDK packages by prefixing @ in your imports, and regular
packages by not prexing anything. Regular imports depends on the packages
available in your package_config.json.
import @async // Imports `dart:async`
import flutter_bloc // Imports `package:flutter_bloc/flutter_bloc.dart`
import flutter/widgets // Imports `package:flutter/widgets.dart`
copied to clipboard
Currently, there's no support for relative imports, neither modifiers (as,
show, hide, if).
Types definition #
You can define types with the type keyword. Each constructor variant is
separated by a +. Type parameters are also supported.
type Id = Id(int id)

type Option(T) = Some(T value) + None

type Either(L, R) = Left(L value) + Right(R value)
copied to clipboard
If you need to use the top type, in pint° it's identifier by ⊤. On the other
side, the bottom type is identified by ⊥.
Pinto introduces some syntax sugar for type identifiers:

[T] for List(T);
{T} for Set(T);
{K: V} for Map(K, V);
T? for Option(T).

The following is a valid pint° program:
import @async

type Complex(T) = Complex(
[⊤] listOfAny,
[T] listOfT,
{T} set,
{T: T} map,
T? maybeT,
Future(T) futureOfT,
int aSimpleInt,
{{T?} : [Future(T)]} aMonster
)
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.