Skip to content

Commit f159f8d

Browse files
initial commit
1 parent 53b19b9 commit f159f8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+100623
-0
lines changed

.github/workflows/haskell.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Haskell stack project Github Actions template
2+
# https://gist.github.com/mstksg/11f753d891cee5980326a8ea8c865233
3+
#
4+
# To use, mainly change the list in 'plans' and modify 'include' for
5+
# any OS package manager deps.
6+
#
7+
# Currently not working for cabal-install >= 3
8+
#
9+
# Based on https://raw.githubusercontent.com/commercialhaskell/stack/stable/doc/travis-complex.yml
10+
#
11+
# TODO:
12+
# * cache (https://github.com/actions/cache)
13+
# but this is too small. native cacheing will come soon
14+
# https://github.community/t5/GitHub-Actions/Caching-files-between-GitHub-Action-executions/m-p/30974/highlight/true#M630
15+
# so we can wait for then.
16+
# * support for cabal-install >= 3
17+
18+
name: Tests CI
19+
20+
on:
21+
push:
22+
schedule:
23+
- cron: "0 0 * * 1"
24+
25+
jobs:
26+
build:
27+
strategy:
28+
matrix:
29+
os: [ubuntu-latest, macOS-latest]
30+
# use this to specify what resolvers and ghc to use
31+
plan:
32+
- { build: stack, resolver: "--resolver lts-9" } # ghc-8.0.2
33+
- { build: stack, resolver: "--resolver lts-11" } # ghc-8.2.2
34+
- { build: stack, resolver: "--resolver lts-12" } # ghc-8.4.4
35+
# - { build: stack, resolver: "--resolver lts-13" } redundant because lts-14 checks ghc-8.6 already
36+
- { build: stack, resolver: "--resolver lts-14" } # ghc-8.6.5
37+
- { build: stack, resolver: "--resolver nightly" }
38+
- { build: stack, resolver: "" }
39+
- { build: cabal, ghc: 8.0.2, cabal-install: "2.0" } # setup-haskell only supports cabal-install 2.0 and higher
40+
- { build: cabal, ghc: 8.2.2, cabal-install: "2.0" }
41+
- { build: cabal, ghc: 8.4.4, cabal-install: "2.2" }
42+
- { build: cabal, ghc: 8.6.5, cabal-install: "2.4" }
43+
- { build: cabal, ghc: 8.8.1, cabal-install: "2.4" } # currently not working for >= 3.0
44+
# use this to include any dependencies from OS package managers
45+
include: []
46+
# - os: macOS-latest
47+
# brew: anybrewdeps
48+
# - os: ubuntu-latest
49+
# apt-get: happy libblas-dev liblapack-dev
50+
51+
exclude:
52+
- os: macOS-latest
53+
plan:
54+
build: cabal
55+
56+
runs-on: ${{ matrix.os }}
57+
steps:
58+
- name: Install OS Packages
59+
uses: mstksg/get-package@v1
60+
with:
61+
apt-get: ${{ matrix.apt-get }}
62+
brew: ${{ matrix.brew }}
63+
- uses: actions/checkout@v1
64+
65+
- name: Setup stack
66+
uses: mstksg/setup-stack@v1
67+
68+
- name: Setup cabal-install
69+
uses: actions/setup-haskell@v1
70+
with:
71+
ghc-version: ${{ matrix.plan.ghc }}
72+
cabal-version: ${{ matrix.plan.cabal-install }}
73+
if: matrix.plan.build == 'cabal'
74+
75+
- name: Install dependencies
76+
run: |
77+
set -ex
78+
case "$BUILD" in
79+
stack)
80+
stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies
81+
;;
82+
cabal)
83+
cabal --version
84+
cabal update
85+
PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
86+
cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
87+
;;
88+
esac
89+
set +ex
90+
env:
91+
ARGS: ${{ matrix.plan.resolver }}
92+
BUILD: ${{ matrix.plan.build }}
93+
94+
- name: Build
95+
run: |
96+
set -ex
97+
case "$BUILD" in
98+
stack)
99+
stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
100+
;;
101+
cabal)
102+
PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
103+
cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
104+
ORIGDIR=$(pwd)
105+
for dir in $PACKAGES
106+
do
107+
cd $dir
108+
cabal check || [ "$CABALVER" == "1.16" ]
109+
cabal sdist
110+
PKGVER=$(cabal info . | awk '{print $2;exit}')
111+
SRC_TGZ=$PKGVER.tar.gz
112+
cd dist
113+
tar zxfv "$SRC_TGZ"
114+
cd "$PKGVER"
115+
cabal configure --enable-tests --ghc-options -O0
116+
cabal build
117+
if [ "$CABALVER" = "1.16" ] || [ "$CABALVER" = "1.18" ]; then
118+
cabal test
119+
else
120+
cabal test --show-details=streaming --log=/dev/stdout
121+
fi
122+
cd $ORIGDIR
123+
done
124+
;;
125+
esac
126+
set +ex
127+
env:
128+
ARGS: ${{ matrix.plan.resolver }}
129+
BUILD: ${{ matrix.plan.build }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ cabal.project.local
2121
cabal.project.local~
2222
.HTF/
2323
.ghc.environment.*
24+
.stack-work/
25+
*~

Setup.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Distribution.Simple
2+
main = defaultMain

quickjs-hs.cabal

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
cabal-version: 1.12
2+
name: quickjs-hs
3+
version: 0.1
4+
description: Please see the README on GitHub at <https://github.com/goodlyrottenapple/quickjs-hs#readme>
5+
homepage: https://github.com/goodlyrottenapple/quickjs-hs#readme
6+
bug-reports: https://github.com/goodlyrottenapple/quickjs-hs/issues
7+
author: Sam Balco
8+
maintainer: goodlyrottenapple@gmail.com
9+
copyright: 2020 Sam Balco
10+
license: MIT
11+
license-file: LICENSE
12+
build-type: Simple
13+
extra-source-files:
14+
README.md
15+
ChangeLog.md
16+
category: Javascript
17+
synopsis: Bindings for the QuickJS library
18+
-- description:
19+
20+
source-repository head
21+
type: git
22+
location: https://github.com/goodlyrottenapple/quickjs-hs
23+
24+
library
25+
exposed-modules:
26+
Quickjs, Quickjs.Types, Quickjs.Error
27+
other-modules:
28+
Paths_quickjs_hs
29+
hs-source-dirs:
30+
src
31+
build-depends:
32+
base >=4.7 && <5
33+
, aeson
34+
, bytestring
35+
, containers
36+
, exceptions
37+
, inline-c
38+
, mtl
39+
, scientific
40+
, string-conv
41+
, template-haskell
42+
, text
43+
, time
44+
, transformers
45+
, unordered-containers
46+
, vector
47+
default-language: Haskell2010
48+
Include-dirs: quickjs
49+
-- Order matters for dynamic linking, see GHC#12152.
50+
-- To make both `cabal repl` and `stack ghci` work, we have to
51+
-- make "a.cpp" come alphabetically before "main.cpp".
52+
C-sources:
53+
quickjs/cutils.c
54+
, quickjs/libbf.c
55+
, quickjs/libregexp.c
56+
, quickjs/libunicode.c
57+
, quickjs/quickjs.h
58+
, quickjs/quickjs.c
59+
, quickjs/quickjs-libc.h
60+
, quickjs/quickjs-libc.c
61+
cc-options:
62+
-static -D_GNU_SOURCE
63+
-DCONFIG_VERSION="2020-07-05"
64+
-DCONFIG_BIGNUM
65+
66+
test-suite quickjs-hs-test
67+
type: exitcode-stdio-1.0
68+
main-is: Spec.hs
69+
other-modules:
70+
Paths_quickjs_hs
71+
hs-source-dirs:
72+
test
73+
ghc-options: -threaded -rtsopts -with-rtsopts=-N
74+
build-depends:
75+
base >=4.7 && <5
76+
, quickjs-hs
77+
, aeson
78+
, exceptions
79+
, HUnit
80+
, QuickCheck
81+
, tasty
82+
, tasty-hunit
83+
, tasty-quickcheck
84+
, text
85+
, unordered-containers
86+
, vector
87+
default-language: Haskell2010

quickjs/Changelog

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
2020-07-05:
2+
3+
- modified JS_GetPrototype() to return a live value
4+
- REPL: support unicode characters larger than 16 bits
5+
- added os.Worker
6+
- improved object serialization
7+
- added std.parseExtJSON
8+
- misc bug fixes
9+
10+
2020-04-12:
11+
12+
- added cross realm support
13+
- added AggregateError and Promise.any
14+
- added env, uid and gid options in os.exec()
15+
- misc bug fixes
16+
17+
2020-03-16:
18+
19+
- reworked error handling in std and os libraries: suppressed I/O
20+
exceptions in std FILE functions and return a positive errno value
21+
when it is explicit
22+
- output exception messages to stderr
23+
- added std.loadFile(), std.strerror(), std.FILE.prototype.tello()
24+
- added JS_GetRuntimeOpaque(), JS_SetRuntimeOpaque(), JS_NewUint32()
25+
- updated to Unicode 13.0.0
26+
- misc bug fixes
27+
28+
2020-01-19:
29+
30+
- keep CONFIG_BIGNUM in the makefile
31+
- added os.chdir()
32+
- qjs: added -I option
33+
- more memory checks in the bignum operations
34+
- modified operator overloading semantics to be closer to the TC39
35+
proposal
36+
- suppressed "use bigint" mode. Simplified "use math" mode
37+
- BigDecimal: changed suffix from 'd' to 'm'
38+
- misc bug fixes
39+
40+
2020-01-05:
41+
42+
- always compile the bignum code. Added '--bignum' option to qjs.
43+
- added BigDecimal
44+
- added String.prototype.replaceAll
45+
- misc bug fixes
46+
47+
2019-12-21:
48+
49+
- added nullish coalescing operator (ES2020)
50+
- added optional chaining (ES2020)
51+
- removed recursions in garbage collector
52+
- test stack overflow in the parser
53+
- improved backtrace logic
54+
- added JS_SetHostPromiseRejectionTracker()
55+
- allow exotic constructors
56+
- improved c++ compatibility
57+
- misc bug fixes
58+
59+
2019-10-27:
60+
61+
- added example of C class in a module (examples/test_point.js)
62+
- added JS_GetTypedArrayBuffer()
63+
- misc bug fixes
64+
65+
2019-09-18:
66+
67+
- added os.exec and other system calls
68+
- exported JS_ValueToAtom()
69+
- qjsc: added 'qjsc_' prefix to the generated C identifiers
70+
- added cross-compilation support
71+
- misc bug fixes
72+
73+
2019-09-01:
74+
75+
- added globalThis
76+
- documented JS_EVAL_FLAG_COMPILE_ONLY
77+
- added import.meta.url and import.meta.main
78+
- added 'debugger' statement
79+
- misc bug fixes
80+
81+
2019-08-18:
82+
83+
- added os.realpath, os.getcwd, os.mkdir, os.stat, os.lstat,
84+
os.readlink, os.readdir, os.utimes, std.popen
85+
- module autodetection
86+
- added import.meta
87+
- misc bug fixes
88+
89+
2019-08-10:
90+
91+
- added public class fields and private class fields, methods and
92+
accessors (TC39 proposal)
93+
- changed JS_ToCStringLen() prototype
94+
- qjsc: handle '-' in module names and modules with the same filename
95+
- added std.urlGet
96+
- exported JS_GetOwnPropertyNames() and JS_GetOwnProperty()
97+
- exported some bigint C functions
98+
- added support for eshost in run-test262
99+
- misc bug fixes
100+
101+
2019-07-28:
102+
103+
- added dynamic import
104+
- added Promise.allSettled
105+
- added String.prototype.matchAll
106+
- added Object.fromEntries
107+
- reduced number of ticks in await
108+
- added BigInt support in Atomics
109+
- exported JS_NewPromiseCapability()
110+
- misc async function and async generator fixes
111+
- enabled hashbang support by default
112+
113+
2019-07-21:
114+
115+
- updated test262 tests
116+
- updated to Unicode version 12.1.0
117+
- fixed missing Date object in qjsc
118+
- fixed multi-context creation
119+
- misc ES2020 related fixes
120+
- simplified power and division operators in bignum extension
121+
- fixed several crash conditions
122+
123+
2019-07-09:
124+
125+
- first public release

0 commit comments

Comments
 (0)