Personal tools

Threepenny-gui

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Gallery)
(Gallery)
 
(17 intermediate revisions by 3 users not shown)
Line 14: Line 14:
 
Features include:
 
Features include:
 
* '''Easy installation.''' Everyone has a reasonably modern web browser installed. Just install the library from hackage and you are ready to go. The library is cross-platform.
 
* '''Easy installation.''' Everyone has a reasonably modern web browser installed. Just install the library from hackage and you are ready to go. The library is cross-platform.
* '''HTML'''. You have all capabilities of HTML at your disposal when creating user interfaces. This is a blessing, but it can also be a curse, so the library includes a few layout combinators to quickly create user interfaces without the need to deal with the mess that is CSS. A small JavaScript FFI allows you to include JS client libraries.
+
* '''HTML''' + '''JavaScript'''. You have all capabilities of HTML at your disposal when creating user interfaces. This is a blessing, but it can also be a curse, so the library includes a few layout combinators to quickly create user interfaces without the need to deal with the mess that is CSS. A foreign function interface (FFI) allows you to execute JavaScript code in the browser.
 
* [[Functional Reactive Programming]] ('''FRP''') promises to eliminate the spaghetti code that you usually get when using the traditional imperative event-based style for programming user interactions. Threepenny has an FRP library built-in, but its use is completely optional. Employ FRP when it is convenient and fall back to the traditional style when you hit an impasse.
 
* [[Functional Reactive Programming]] ('''FRP''') promises to eliminate the spaghetti code that you usually get when using the traditional imperative event-based style for programming user interactions. Threepenny has an FRP library built-in, but its use is completely optional. Employ FRP when it is convenient and fall back to the traditional style when you hit an impasse.
  
Line 21: Line 21:
 
As cool as Threepenny may be, it is ...
 
As cool as Threepenny may be, it is ...
  
* ... not a web front-end. The server is meant to be run from localhost. Latency would be too high to use it as a web app. That said, it's perfectly stuitable for implementing multi-user apps on a local network, see the [https://github.com/HeinrichApfelmus/threepenny-gui/blob/master/src/Chat.hs Chat.hs example].
+
* ... not a web front-end. The server is meant to be run from localhost. Latency would be too high to use it as a web app. That said, it's perfectly stuitable for implementing multi-user apps on a local network, see the [https://github.com/HeinrichApfelmus/threepenny-gui/blob/master/samples/Chat.hs Chat.hs example].
 
* ... not a JavaScript or HTML library. It's a GUI framework with a Haskell API and abstracts many aspects of the document object model. While some basic HTML skills are needed, no knowledge of JavaScript is required to use Threepenny, though you can include external client libraries if you really want to.
 
* ... not a JavaScript or HTML library. It's a GUI framework with a Haskell API and abstracts many aspects of the document object model. While some basic HTML skills are needed, no knowledge of JavaScript is required to use Threepenny, though you can include external client libraries if you really want to.
  
Line 30: Line 30:
 
The library is still very much in flux, significant API changes are likely in future versions. The goal is make GUI programming as simple as possible, and that just needs some experimentation.
 
The library is still very much in flux, significant API changes are likely in future versions. The goal is make GUI programming as simple as possible, and that just needs some experimentation.
  
* 7 September 2013 Release of threepenny-gui-0.3.0.0
+
* 16 September 2016 — Release of threepenny-gui-0.7.0.0
 +
* 15 May      2015 — Release of threepenny-gui-0.6.0.2
 +
*  3 May      2015 — Release of threepenny-gui-0.6.0.1
 +
*  4 October  2014 — Release of threepenny-gui-0.5.0.0
 +
* 21 November  2013 — Release of threepenny-gui-0.4.0.0
 +
7 September 2013 Release of threepenny-gui-0.3.0.0
  
 
== Gallery ==
 
== Gallery ==
Line 48: Line 53:
 
<tr>
 
<tr>
 
<td>
 
<td>
 +
[https://github.com/CarstenKoenig/Holidays2013 Carsten König's holiday project]
 +
<br>Small viewer for the Mandelbrot set.
 +
<br>[[Image:Threepenny-gui-mandelbrot.png|300px]]
 
<td>
 
<td>
 
[https://github.com/Chaddai/CurveProject Chaddai's ''CurveProject'']
 
[https://github.com/Chaddai/CurveProject Chaddai's ''CurveProject'']
 
<br>Plotting curves for math teachers.
 
<br>Plotting curves for math teachers.
 
<br>[[Image:Threepenny-gui-curveproject.jpg|386px]]
 
<br>[[Image:Threepenny-gui-curveproject.jpg|386px]]
 +
<tr>
 +
<td>
 +
<td>
 +
[https://wiki.haskell.org/Hoed Maarten Faddegon's ''Hoed'']
 +
<br>A lightweight tracer and algorithmic debugger for Haskell
 +
<br>[[Image:HoedExplore.png|386px]]
 
</table>
 
</table>
  
Line 59: Line 73:
 
* <span id="documentation">Documentation</span>
 
* <span id="documentation">Documentation</span>
 
** [http://hackage.haskell.org/package/threepenny-gui API reference]
 
** [http://hackage.haskell.org/package/threepenny-gui API reference]
** '''[https://github.com/HeinrichApfelmus/threepenny-gui#examples Examples]'''
+
** '''[https://github.com/HeinrichApfelmus/threepenny-gui/tree/master/samples#readme Examples]'''
 
** [http://apfelmus.nfshost.com/blog.html#gui-programming Developer Blog]
 
** [http://apfelmus.nfshost.com/blog.html#gui-programming Developer Blog]
 +
** [https://github.com/yuvallanger/threepenny-gui/blob/tutorial/samples/BarTab.lhs A work in progress tutorial] by [https://github.com/yuvallanger Yuval Langer] - help will be dearly appreciated.
 
* <span id="feedback">Feedback</span> and Contact
 
* <span id="feedback">Feedback</span> and Contact
** Maintainer: [http://apfelmus.nfshost.com/ Heinrich Apfelmus] <apfelmus at quantentunnel de>
+
** Maintainer: [http://apfelmus.nfshost.com/ Heinrich Apfelmus]
 
** Bugs and feature requests? [https://github.com/HeinrichApfelmus/threepenny-gui/issues?sort=created&direction=desc&state=open Issue Tracker!]
 
** Bugs and feature requests? [https://github.com/HeinrichApfelmus/threepenny-gui/issues?sort=created&direction=desc&state=open Issue Tracker!]
 +
** Questions? [http://stackoverflow.com/questions/ask?tags=haskell+threepenny-gui+gui Ask on StackOverflow!]
 +
** More questions? [mailto:apfelmus%20at%20quantentunnel%20de Email] or [https://hackhands.com/apfelmus live help]!
 
* Source code on github
 
* Source code on github
** [https://github.com/HeinrichApfelmus/threepenny-gui/tree/develop/ threepenny-gui] development branch
+
** [https://github.com/HeinrichApfelmus/threepenny-gui/tree/master/ threepenny-gui] master branch
  
  

Latest revision as of 18:56, 16 September 2016

Contents

[edit] 1 What is it?

Und der Haifisch, der hat Zähne
Und die trägt er im Gesicht
Und Macheath, der hat ein Messer
Doch das Messer sieht man nicht.

Bertold Brecht - The Threepenny Opera

Threepenny-gui is a GUI framework that uses the web browser as a display.

Features include:

  • Easy installation. Everyone has a reasonably modern web browser installed. Just install the library from hackage and you are ready to go. The library is cross-platform.
  • HTML + JavaScript. You have all capabilities of HTML at your disposal when creating user interfaces. This is a blessing, but it can also be a curse, so the library includes a few layout combinators to quickly create user interfaces without the need to deal with the mess that is CSS. A foreign function interface (FFI) allows you to execute JavaScript code in the browser.
  • Functional Reactive Programming (FRP) promises to eliminate the spaghetti code that you usually get when using the traditional imperative event-based style for programming user interactions. Threepenny has an FRP library built-in, but its use is completely optional. Employ FRP when it is convenient and fall back to the traditional style when you hit an impasse.

[edit] 2 What is it not?

As cool as Threepenny may be, it is ...

  • ... not a web front-end. The server is meant to be run from localhost. Latency would be too high to use it as a web app. That said, it's perfectly stuitable for implementing multi-user apps on a local network, see the Chat.hs example.
  • ... not a JavaScript or HTML library. It's a GUI framework with a Haskell API and abstracts many aspects of the document object model. While some basic HTML skills are needed, no knowledge of JavaScript is required to use Threepenny, though you can include external client libraries if you really want to.

If you want to write a web app, have a look at projects like Fay, GHCJS and Haste. That said, the Threepenny API may be ported to some of these projects as well in the future, but that is not the focus right now.

[edit] 3 Status

The library is still very much in flux, significant API changes are likely in future versions. The goal is make GUI programming as simple as possible, and that just needs some experimentation.

  • 16 September 2016 — Release of threepenny-gui-0.7.0.0
  • 15 May 2015 — Release of threepenny-gui-0.6.0.2
  • 3 May 2015 — Release of threepenny-gui-0.6.0.1
  • 4 October 2014 — Release of threepenny-gui-0.5.0.0
  • 21 November 2013 — Release of threepenny-gui-0.4.0.0
  • 7 September 2013 — Release of threepenny-gui-0.3.0.0

[edit] 4 Gallery

Applications written with Threepenny.

Daniel Austin's FNIStash
Editor for Torchlight 2 inventories.
Threepenny-gui-fnistash.png

Daniel Mlot's Stunts Cartography Track Viewer
Map viewer for the Stunts racing game.
Threepenny-gui-stunts.png

Carsten König's holiday project
Small viewer for the Mandelbrot set.
Threepenny-gui-mandelbrot.png

Chaddai's CurveProject
Plotting curves for math teachers.
Threepenny-gui-curveproject.jpg

Maarten Faddegon's Hoed
A lightweight tracer and algorithmic debugger for Haskell
HoedExplore.png

[edit] 5 Releases and Resources