Download
The projects below provide Finitio implementations in various host languages. Contact us or fork this page on github to add your own binding to this list!
Both implementations cover the Finitio 0.4 language: the type system, imports and the standard library. They differ on a handful of points, each flagged in the reference where it applies.
Ruby
The finitio ruby gem provides a mature implementation in Ruby. You'll also find the source code on github:
gem install finitio
require 'finitio'
require 'json'
system = Finitio.system <<~FIO
@import finitio/data
{ name: String( s | s.length > 0 ), at: Date }
FIO
system.dress(JSON.parse('{ "name": "Finitio", "at": "2014-03-01" }'))
# => {name: "Finitio", at: #<Date: 2014-03-01 ...>}
Tuples are represented as Ruby hashes with symbol keys, and constraint expressions are Ruby code — see constraint expressions.
JavaScript
The finitio package brings Finitio to Node and to the browser. The source code is available on github:
npm install finitio
import Finitio from 'finitio'
const system = Finitio.system(`
@import finitio/data
{ name: String( s | s.length > 0 ), at: Date }
`)
system.dress({ name: 'Finitio', at: '2014-03-01' })
// => { name: 'Finitio', at: 2014-03-01T00:00:00.000Z }
It ships TypeScript definitions, a finitio command line for validating
documents and bundling schemas, and — as the playground on this site
demonstrates — runs entirely in the browser.