Code Monkey home page Code Monkey logo

idris2-dom's Introduction

idris2-dom: Extensive DOM and Web Bindings for Idris2

This library provides extensive DOM and web bindings for writing Idris2 programs that run in the browser.

This library comes "batteries included", as quite a few utility types and functions for interacting with the unsafe world of JavaScript are provided via the JS submodules. These might eventually be moved to their own repository, but as Idris2 is still lacking an official package repository, it makes sense to keep this stuff in one package for the time being.

The sources in src/Web/Raw and src/Web/Internal have been generated automatically using the idris2-webidl package, but some additional functions have been (and will be) added manually, either for an increase in type safety or convenience or both.

A tutorial with a working example program and detailed explanations about how the different pieces in this library fit together can be found here.

Quite a bit of functionality is still missing when it comes to external types like Array or Promise, but will be added later on.

Project structure

DOM

The DOM bindings as well as the JavaScript utilities can be built by running idris2 --build dom.ipkg. Given the size of the codebase, this might take several minutes.

JavaScript utilities

The functionality provided by the submodules of JS should eventually go to its own repository. As a preparation for this change and to speed up development of JavaScript utilities (typechecking dom.ipkg is slow), package file js.ipkg is provided.

Documentation

The tutorial consists of one or more literal Idris2 files to be found at srd/Doc. It can be built by running idris2 --build doc.ipkg and tested afterwards by loading doc.html in one's favorite browser.

Tests

There is also test.ipkg running several Hedgehog property tests. This should be built and run with node, as it mainly tests the JavaScript utilities working on both JavaScript backends.

Dependencies

Packages dom.ipkg, doc.ipkg and js.ipkg depend on the following packages:

The test package test.ipkg depends on the same libraries plus the following:

Misc

This libary is still evolving - as is Idris2 itself - and I try to keep up with the latest Idris2 commits. The actual release requires Idris2, version 0.5.1.

The latest commit is daily tested to build against the current HEAD of the Idris compiler. Since Idris2 releases are happening rather infrequently at the moment, it is suggested to use a package manager like pack to install and maintain matching versions of the Idris compiler and this library. Pack will also automatically install all required dependencies.

idris2-dom's People

Contributors

stefan-hoeck avatar gergoerdi avatar falsifian avatar arsdragonfly avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.