Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,5 @@ chrome-mac-arm64-*
log.txt
build.zip

#haskell
dist-newstyle/
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
dist
dist-newstyle
result
all.js

miso-latest.json
nixpkgs-latest.json
16 changes: 16 additions & 0 deletions frameworks/keyed/miso-ghc-js/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.PHONY= update build

all: update build

update:
cabal update --with-ghc=javascript-unknown-ghcjs-ghc --with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg

build:
cabal build --with-ghc=javascript-unknown-ghcjs-ghc --with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg
cp -v ./dist-newstyle/build/javascript-ghcjs/ghc-9.12.2/*/x/app/build/app/app.jsexe/all.js .
rm -rf dist-bundle
cp -rv static dist-bundle
bunx --bun swc ./all.js -o dist-bundle/index.js

clean:
rm -rf dist-newstyle dist-bundle
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
# miso-1.1.0.0-keyed
# miso-ghc-js-1.9.0.0-keyed

[Miso](https://haskell-miso.org) is a tasty [Haskell](https://www.haskell.org/) front-end framework.
[miso](https://haskell-miso.org) is a tasty [Haskell](https://www.haskell.org/) front-end framework.

Benchmarks for [miso](https://haskell-miso.org) using the [GHC JS](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/js.html) backend.

## Build

```bash
$ nix develop .#ghcjs --command bash -c 'make all'
```

or

```bash
$ bun run build
```

## Installation

All needed `*.js` sources have already been generated in folder [`dist-bundle`](./dist-bundle) to avoid other dependencies of [`Haskell`](http://haskell.org/) and [`Nix`](https://nixos.org/nix/).

However, to build everything by yourself you have to use [`Nix`](https://nixos.org/nix/) to run `nix-build` from [`root` of miso-1.1.0.0.-keyed](./).

After that just run `npm run cp-js` (or `yarn cp-js`) to copy generated `*.js` sources from local Nix store to `dist-bundle` folder. This folder is used by running benchmarks.

Now you can start benchmarks by running
```
cd webdriver-ts
yarn selenium --count 3 --framework miso-1.1.0.0-keyed
yarn selenium --count 3 --framework miso-ghc-js-1.9.0.0-keyed
```
(^ see [Running a single framework with the automated benchmark driver](../README#4-running-a-single-framework-with-the-automated-benchmark-driver))

Expand All @@ -24,6 +36,3 @@ yarn interactive-results
```
(^ see [Optional 7. Building the interactive results table](../README#optional-7-building-the-interactive-results-table))

## Credit

Miso's benchmark application based mostly on [miso-non-official-v0.4.0.0-non-keyed](https://github.com/vacationlabs/js-framework-benchmark/tree/master/miso-non-official-v0.4.0.0-non-keyed) created by @vacationlabs .
31 changes: 31 additions & 0 deletions frameworks/keyed/miso-ghc-js/app.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cabal-version: 3.0
name: miso-benchmark-keyed-js
version: 0.1.0.0
synopsis: Benchmark of miso with the GHC JS backend
category: Web
build-type: Simple

common options
if arch(javascript)
ld-options:
-sEXPORTED_RUNTIME_METHODS=HEAP8
cpp-options:
-DGHCJS_BROWSER
-DJS

executable app
import:
options
main-is:
Main.hs
hs-source-dirs:
src
ghc-options:
-O2 -fspecialise-aggressively -fdicts-cheap -funbox-strict-fields
build-depends:
base < 5,
containers,
miso,
vector
default-language:
Haskell2010
12 changes: 12 additions & 0 deletions frameworks/keyed/miso-ghc-js/cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
packages:
.

allow-newer:
all:base

source-repository-package
type: git
location: https://github.com/dmjio/miso
tag: master

flags: +template-haskell
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Miso v1.4.0.0</title>
<title>miso v1.9.0.0 - GHC JS</title>
<link href="/css/currentStyle.css" rel="stylesheet"/>
<script>
window.saveGCFromClosureOverwriting = window['gc'];
</script>
</head>
<body>
<script src="all.min.js"></script>
<script src="index.js"></script>
</body>
</html>
Loading