-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into main
* origin/master: (25 commits) AddRAN: missing fields in functionMeta record src: HaskellFrontend change package versions Passes: Access patterns, update GHC version to 9.4.6 in CI fix L1 test fix Tests: Fix L1 Typecheck case to fix CI error Fix ghc 9.6.2 build error Passes: CallGraph Passes: Support for Definition Use Chains Passes: Control Flow Graph Update devcontainers Update GHC to v9.6.2 Disable tests that build with GHC 8.6.5 and 8.4.4 Mark failing tests Allow GHC 8.6.5 and 8.4.4 to fail Use GCC11 and use ghcup to install GHC Use Ubuntu 22.04 on CI Minor tweak to the workflow file Tailrec: linked list examples and results ...
- Loading branch information
Showing
48 changed files
with
10,171 additions
and
5,128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/ubuntu/.devcontainer/base.Dockerfile | ||
# Ubuntu 22 | ||
ARG VARIANT="jammy" | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} as base | ||
ENV USERNAME=vscode | ||
|
||
# [Choice] Ubuntu version: bionic, focal | ||
ARG VARIANT="bionic" | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& sudo apt-get -y install --no-install-recommends software-properties-common \ | ||
&& sudo add-apt-repository -y ppa:plt/racket \ | ||
&& sudo add-apt-repository -y ppa:hvr/ghc \ | ||
&& sudo apt-get -y install --no-install-recommends libgc-dev libgmp-dev \ | ||
gcc-7 uthash-dev racket \ | ||
ghc-9.0.1 cabal-install-3.4 vim | ||
RUN curl -sSL https://get.haskellstack.org/ | sh | ||
ENV PATH /opt/ghc/bin:/opt/cabal/bin:$PATH | ||
RUN sudo ln -sf /usr/bin/gcc-7 /usr/bin/gcc | ||
# install dependencies | ||
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \ | ||
--mount=target=/var/cache/apt,type=cache,sharing=locked \ | ||
apt-get update && \ | ||
apt-get -y install --no-install-recommends software-properties-common && \ | ||
add-apt-repository -y ppa:plt/racket && \ | ||
apt-get -y install --no-install-recommends \ | ||
libgc-dev \ | ||
libgmp-dev \ | ||
racket \ | ||
uthash-dev \ | ||
vim | ||
|
||
# update path | ||
USER ${USERNAME} | ||
WORKDIR /home/${USERNAME} | ||
ENV PATH="/home/${USERNAME}/.local/bin:/home/${USERNAME}/.cabal/bin:/home/${USERNAME}/.ghcup/bin:$PATH" | ||
RUN echo "export PATH=${PATH}" >> /home/${USERNAME}/.profile | ||
|
||
# install ghcup | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh | ||
|
||
ARG GHC=9.0.2 | ||
ARG CABAL=3.4 | ||
ARG STACK=2.9.3 | ||
ARG HLS=recommended | ||
|
||
# install GHC, cabal and HLS | ||
RUN \ | ||
ghcup install ghc ${GHC} --set && \ | ||
ghcup install cabal ${CABAL} --set && \ | ||
ghcup install stack ${STACK} --set && \ | ||
ghcup install hls ${HLS} --set | ||
|
||
# update cabal package list | ||
RUN cabal update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
gibbon-compiler/examples/layout_benchmarks/blog_management/marmoset/Eval.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
data Ast | ||
= Val Bool | ||
| Not Ast | ||
| Or Ast Ast | ||
| And Ast Ast | ||
|
||
--eval :: Ast -> Bool | ||
--eval x = case x of | ||
-- Val b -> b | ||
-- Not e -> if eval e then False else True | ||
-- Or e1 e2 -> | ||
-- if eval e1 then True | ||
-- else eval e2 | ||
-- And e1 e2 -> | ||
-- if eval e1 then eval e2 | ||
-- else False | ||
|
||
--simplify :: Ast -> Ast | ||
--simplify x = Val (eval x) | ||
|
||
evalR :: Ast -> Bool | ||
{-# ANN evalR Or #-} | ||
{-# ANN evalR And #-} | ||
evalR x = case x of | ||
Val b -> b | ||
Not e -> if evalR e then False else True | ||
Or e1 e2 -> | ||
if evalR e2 then True | ||
else evalR e1 | ||
And e1 e2 -> | ||
if evalR e2 then evalR e1 | ||
else False | ||
|
||
simplifyR :: Ast -> Ast | ||
simplifyR x = Val (evalR x) | ||
|
||
mkRandTree :: Int -> Ast | ||
mkRandTree n = | ||
if n > 0 then | ||
let m = mod rand 3 in | ||
if m == 0 then Not (mkRandTree (n-1)) | ||
else if m == 1 then And (mkRandTree (n-1)) (mkRandTree (n-1)) | ||
else Or (mkRandTree (n-1)) (mkRandTree (n-1)) | ||
else Val (mod rand 2 == 0) |
11 changes: 11 additions & 0 deletions
11
gibbon-compiler/examples/layout_benchmarks/blog_management/marmoset/eval_bench.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Eval | ||
|
||
gibbon_main = | ||
let | ||
n = 45 | ||
t = mkRandTree n | ||
|
||
-- _ = iterate (eval t) | ||
s = iterate (evalR t) | ||
in () | ||
|
41 changes: 41 additions & 0 deletions
41
gibbon-compiler/examples/layout_benchmarks/blog_management/marmoset/layout1ListLen.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
type Text = Vector Char | ||
|
||
data Content = Str Text Content | ||
| End | ||
|
||
data List = Snoc (List) Content | ||
| Nil | ||
|
||
|
||
mkContent :: Int -> Content | ||
mkContent len = if len <= 0 then End | ||
else Str "abcdef" (mkContent (len - 1)) | ||
|
||
|
||
mkSnocList :: Int -> List | ||
mkSnocList len = if len <= 0 | ||
then Nil | ||
else let | ||
rst = mkSnocList (len - 1) | ||
val = mkContent 100 | ||
in Snoc rst val | ||
|
||
getLengthSnoc :: List -> Int | ||
{-# ANN getLengthSnoc Snoc #-} | ||
getLengthSnoc lst = case lst of | ||
Snoc rst val -> 1 + getLengthSnoc rst | ||
Nil -> 0 | ||
|
||
|
||
gibbon_main = | ||
let snocList = mkSnocList 1000000 | ||
--consList = mkConsList 100000 | ||
l1 = iterate (getLengthSnoc snocList) | ||
--l2 = getLengthCons consList | ||
_ = printsym (quote "Length Snoc: ") | ||
_ = printint l1 | ||
_ = printsym (quote "NEWLINE") | ||
--_ = printsym (quote "Length Cons: ") | ||
--_ = printint l2 | ||
--_ = printsym (quote "NEWLINE") | ||
in () |
43 changes: 43 additions & 0 deletions
43
gibbon-compiler/examples/layout_benchmarks/blog_management/marmoset/layout2ListLen.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
type Text = Vector Char | ||
|
||
data Content = Str Text Content | ||
| End | ||
|
||
data List = Cons Content (List) | ||
| Nil | ||
|
||
|
||
mkContent :: Int -> Content | ||
mkContent len = if len <= 0 then End | ||
else Str "abcdef" (mkContent (len - 1)) | ||
|
||
|
||
mkConsList :: Int -> List | ||
mkConsList len = if len <= 0 | ||
then Nil | ||
else let | ||
--val = mkContent 100 | ||
rst = mkConsList (len - 1) | ||
val = mkContent 100 | ||
in Cons val rst | ||
|
||
getLengthCons :: List -> Int | ||
{-# ANN getLengthCons Cons #-} | ||
getLengthCons lst = case lst of | ||
Cons val rst -> getLengthCons rst + 1 | ||
Nil -> 0 | ||
|
||
|
||
|
||
gibbon_main = | ||
let --snocList = mkSnocList 90000 | ||
consList = mkConsList 3000000 | ||
--l1 = getLengthSnoc snocList | ||
l2 = iterate (getLengthCons consList) | ||
--_ = printsym (quote "Length Snoc: ") | ||
--_ = printint l1 | ||
--_ = printsym (quote "NEWLINE") | ||
_ = printsym (quote "Length Cons: ") | ||
_ = printint l2 | ||
_ = printsym (quote "NEWLINE") | ||
in () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.