All Projects → ivanperez-keera → Dunai

ivanperez-keera / Dunai

Licence: other
Classic and Arrowized Functional Reactive Programming, Reactive Programming, and Stream programming, all via Monadic Stream Functions

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Dunai

Ulmus
A functional-reactive style programming library for Clojure(script)
Stars: ✭ 33 (-71.3%)
Mutual labels:  frp, functional-reactive-programming, functional-programming
Kickstarter Reactiveextensions
A collection of extensions to the ReactiveSwift framework.
Stars: ✭ 183 (+59.13%)
Mutual labels:  frp, functional-reactive-programming, functional-programming
Lambda Lantern
🧙 ‎‎ A 3D game about functional programming patterns. Uses PureScript Native, C++, and Panda3D.
Stars: ✭ 122 (+6.09%)
Mutual labels:  functional-reactive-programming, game, functional-programming
Hareactive
Purely functional reactive programming library
Stars: ✭ 293 (+154.78%)
Mutual labels:  frp, functional-reactive-programming, functional-programming
Yampa
Functional Reactive Programming domain-specific language embedded in Haskell, for programming efficient hybrid (mixed discrete-time and continuous-time) systems.
Stars: ✭ 294 (+155.65%)
Mutual labels:  frp, functional-reactive-programming, game
Sodium Typescript
Typescript/Javascript implementation of Sodium FRP (Functional Reactive Programming) library
Stars: ✭ 102 (-11.3%)
Mutual labels:  frp, functional-reactive-programming, functional-programming
Fpgo
Monad, Functional Programming features for Golang
Stars: ✭ 165 (+43.48%)
Mutual labels:  monad, functional-reactive-programming, functional-programming
Android Oss
Kickstarter for Android. Bring new ideas to life, anywhere.
Stars: ✭ 5,627 (+4793.04%)
Mutual labels:  frp, functional-reactive-programming, functional-programming
Ios Oss
Kickstarter for iOS. Bring new ideas to life, anywhere.
Stars: ✭ 7,840 (+6717.39%)
Mutual labels:  frp, functional-reactive-programming, functional-programming
Taelinarena
[outdated] A moddable MOBA in Formality
Stars: ✭ 84 (-26.96%)
Mutual labels:  game, functional-programming
Spring 5 Examples
This repository is contains spring-boot 2 / spring framework 5 project examples. Using reactive programming model / paradigm and Kotlin
Stars: ✭ 87 (-24.35%)
Mutual labels:  functional-reactive-programming, functional-programming
Langaw
A sample project for following along a tutorial found on jap.alekhin.io.
Stars: ✭ 90 (-21.74%)
Mutual labels:  game, games
Titlerun
The game that only exists in your title bar
Stars: ✭ 77 (-33.04%)
Mutual labels:  game, games
Lila
♞ lichess.org: the forever free, adless and open source chess server ♞
Stars: ✭ 10,315 (+8869.57%)
Mutual labels:  game, functional-programming
Everpuzzle
Tetris Attack / Pokemon Puzzle style game written in Rust
Stars: ✭ 88 (-23.48%)
Mutual labels:  game, games
Cyclops
An advanced, but easy to use, platform for writing functional applications in Java 8.
Stars: ✭ 1,180 (+926.09%)
Mutual labels:  monad, functional-programming
Delphiarcadegames
4 FireMonkey arcade games developed with Delphi for Windows, macOS, iOS and Android
Stars: ✭ 94 (-18.26%)
Mutual labels:  game, games
Unity Solutions
Use Firebase tools to incorporate common features into your games!
Stars: ✭ 95 (-17.39%)
Mutual labels:  game, games
Igdb
Go client for the Internet Game Database API
Stars: ✭ 65 (-43.48%)
Mutual labels:  game, games
Foda
You are at FODA source code. Play now for free
Stars: ✭ 92 (-20%)
Mutual labels:  game, games

Dunai

Build Status Version on Hackage

This repository implements a generalized version of reactive programming, on top of which other variants like Yampa, Classic FRP and Reactive Values can be implemented.

Installation

$ cabal sandbox init         # Optional, but recommended
$ cabal update
$ cabal install dunai

Dependencies

Dunai currently supports GHC versions 7.6.3 to 8.8.2.

Examples

To test Dunai:

  • Use embed :: MSF m a b -> [a] -> m [b] to collect a list with the results.

  • Use embed_ :: MSF m a () -> [a] -> m () to perform side effects without collecting the results.

  • Use reactimate :: MSF m () () -> m () when data is collected/provided by the MSF itself.

ghci> import Data.MonadicStreamFunction
ghci> embed (arr (+1)) [1,2,3,4,5]
[2,3,4,5,6]
ghci> embed_ (arr (+1) >>> liftS print) [1,2,3,4,5]
2
3
4
5
6
ghci> reactimate (arrM_ getLine >>> arr reverse >>> liftS putStrLn)
Hello
olleH
Haskell is awesome
emosewa si lleksaH
^C

Further references

Reading

The best introduction to the fundamentals of Monadic Stream Functions is:

The following papers are also related to MSFs:

Video

Games

Structure and internals.

This project is split in three parts:

  • Dunai: a reactive library that combines monads and arrows.
  • BearRiver: Yampa implemented on top of Dunai.
  • Examples: ballbounce
    • sample applications that work both on traditional Yampa and BearRiver.

We need to add examples of apps written in classic FRP, reactive values, etc. A new game, in honor of Paul Hudak, has been designed to work best with this library. The game haskanoid works both with Yampa and with Bearriver/dunai.

Performance

Performance is ok, simpler games will be playable without further optimisations. This uses unaccelerated SDL 1.2. The speed is comparable to Yampa's.

2016-05-09 15:29:41 [email protected]:~/Projects/PhD/Yampa/yampa-clocks-dunai$ ./.cabal-sandbox/bin/haskanoid

Performance report :: Time per frame: 13.88ms, FPS: 72.04610951008645, Total running time: 1447
Performance report :: Time per frame: 16.46ms, FPS: 60.75334143377886, Total running time: 3093
Performance report :: Time per frame: 17.48ms, FPS: 57.20823798627002, Total running time: 4841
Performance report :: Time per frame: 19.56ms, FPS: 51.12474437627812, Total running time: 6797
Performance report :: Time per frame: 19.96ms, FPS: 50.100200400801604, Total running time: 8793
Performance report :: Time per frame: 19.44ms, FPS: 51.440329218106996, Total running time: 10737

It runs almost in constant memory, with about 50% more memory consumption than with Yampa (200k for Yampa and 300K for dunai/bearriver). There is very minor leaking, probably we can fix that with seq.

We have obtained different figures tracking different modules. In the paper, we provided figures for the whole game, but we need to run newer reliable benchmarks including every module and only things that live in FRP.Yampa, FRP.BearRiver and Data.MonadicStreamFunction.

You can try it with:

git clone https://github.com/ivanperez-keera/haskanoid.git
cd haskanoid/
cabal sandbox init
cabal install -f-wiimote -f-kinect -fbearriver haskanoid/

Related Projects

ivanperez-keera/Yampa

turion/rhine

Contributions

We follow: http://nvie.com/posts/a-successful-git-branching-model/

Feel free to open new issues. We are looking for:

  • Unexplored ways of using MSFs.
  • Other games or applications that use MSFs (including but not limited to Yampa games).
  • Fixes. The syntax and behaviour are still experimental. If something breaks/sounds strange, please open an issue.

About the name

Dunai (aka. Danube, or Дунай) is one of the main rivers in Europe, originating in Germany and touching Austria, Slovakia, Hungary, Croatia, Serbia, Romania, Bulgaria, Moldova and Ukraine.

Other FRP libraries, like Yampa, are named after rivers. Dunai has been chosen due to the authors' relation with some of the countries it passes through, and knowing that this library has helped unite otherwise very different people from different backgrounds.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].