Skip to content

Commit

Permalink
Release 0.2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Memorytaco committed Jun 13, 2024
1 parent 78e5668 commit 893a67c
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 29 deletions.
36 changes: 34 additions & 2 deletions bootstrap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,56 @@ and this project adheres to the

# Unreleased

## [0.2.0.0] - 2024-04-08
## [0.2.1.0] - 2024-04-08

### Added

#### dependencies

### Removed

### Plan

### BugFix

# Release

## [0.2.0.0] - 2024-06-13

### Added

- Graph algorithms for new Graph.Data module
- Better algorithm for transforming between graphic and syntactic type
- Add core structure of macro for language
- More tests on Graph.Data
- More tests on Unification
- Add better ui for REPL with limited completion
- Add two pass: Rename and Simplify

#### dependencies

- haskeline

### Removed

- Rename CPSTransform to LowerCPS

#### dependencies

- isocline

### Plan

- Refactor Parser for better error message and flexibility
- Refactor implementation of algebraic graph
- Language modification for better structure
- Better desugaring rule

### BugFix

# Release
- Fix an error of looking up names when transforming types to graphs
- Fix an error of unwanted desugaring process when trying to print out
types

## [0.1.0.1] - 2024-01-24

Expand Down
10 changes: 6 additions & 4 deletions bootstrap/bootstrap.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ description: Please see the README on GitHub at <https://github.com/memorytac
category: Programming Language (PL)
homepage: https://github.com/memorytaco/yo#readme
bug-reports: https://github.com/memorytaco/yo/issues
author: dunor
maintainer: dunor@dunor.dev
copyright: 2024 dunor
author: Andrew Elliot
maintainer: memorytoco@gmail.com
copyright: 2024 Andrew Elliot
license: BSD3
license-file: LICENSE
build-type: Simple
Expand Down Expand Up @@ -106,11 +106,13 @@ library
Language.Setting
Language.TH
Recursion.Morphism
Transform.CPSTransform
Transform.Desugar
Transform.GraphType
Transform.LowerCPS
Transform.LowerType
Transform.Pass
Transform.Rename
Transform.Simplify
Transform.TypeGraph
Utility.Data
Utility.Operator
Expand Down
7 changes: 3 additions & 4 deletions bootstrap/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ name: bootstrap
version: 0.2.0.0
github: "memorytaco/yo/bootstrap"
license: BSD3
author: "dunor"
maintainer: "dunor@dunor.dev"
copyright: "2024 dunor"
author: "Andrew Elliot"
maintainer: "memorytoco@gmail.com"
copyright: "2024 Andrew Elliot"
language: GHC2021

extra-source-files:
- README.md
- CHANGELOG.md

# Metadata used when publishing your package
synopsis: Compiler implementation of bootstrap compiler in Haskell.
category: Programming Language (PL)
description: Please see the README on GitHub at <https://github.com/memorytaco/yo/bootstrap#readme>
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/src/EvalLoop/Loop.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ where

import System.Console.Isocline

import Data.Text (Text, pack, dropWhileEnd, isPrefixOf, stripPrefix, unpack)
import Data.Text (Text, pack, dropWhileEnd, stripPrefix, unpack)
import qualified Data.Text.IO as Text (putStrLn)
import Control.Monad.Catch (MonadMask, MonadCatch, MonadThrow)
import Text.Megaparsec
Expand Down
16 changes: 8 additions & 8 deletions bootstrap/src/Language/Constraint/Graphic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ type instance ConstrainGraphic Apply (ExprF f name |: Hole ns Int) m nodes edges
, HasNodeCreator m
, HasOrderGraph nodes edges info
, edges :>+: '[Pht Sub, T Instance, T Sub, T (Binding name)]
, nodes :>+: '[T NodeApp, T NodeArr, T NodeBot, G]
, nodes :>+: '[T NodeArr, T NodeBot, G]
)
-- | Constraint for `Apply`
instance ConstraintGen Apply (ExprF f name |: Hole nodes Int) Int where
Expand All @@ -252,7 +252,7 @@ instance ConstraintGen Apply (ExprF f name |: Hole nodes Int) Int where
genInstance r gr to = gr <> (r -<< T (Instance 1) >>- to)

-- collect graph and generate constraint
genApp (r'a, gr'a) (r'b, gr'b) = do
genApp (g'a, gr'a) (g'b, gr'b) = do
g <- node (G 1)
arr <- node (T NodeArr)
domain <- node (T NodeBot)
Expand All @@ -263,10 +263,10 @@ instance ConstraintGen Apply (ExprF f name |: Hole nodes Int) Int where
, arr -<< T (Sub 2) >>- codomain
, g -<< T (Sub 1) >>- codomain
, Connect (link $ T (Binding Flexible $ Nothing @name))
(fromVertices [r'a, r'b, arr, domain, codomain])
(fromVertices [g'a, g'b, arr, domain, codomain])
(Vertex g)
, genInstance r'a gr'a arr
, genInstance r'b gr'b domain
, genInstance g'a gr'a arr
, genInstance g'b gr'b domain
]

type instance ConstrainGraphic
Expand All @@ -291,7 +291,7 @@ type instance ConstrainGraphic (Equation (Grp (PatSurface t)) (Prefixes name t))
, Equation (Grp (PatSurface t)) (Prefixes name t) :<: f
, edges :>+: '[T Sub, T (Binding Name), T Instance, T Unify]
, edges :>+: '[Pht Sub]
, nodes :>+: '[T NodeBot, G, T NodeArr, T NodeApp, T NodeTup, T NodeRec, T (NodeHas Label)]
, nodes :>+: '[T NodeBot, G, T NodeArr, T NodeTup, T NodeRec, T (NodeHas Label)]
, nodes :>+: '[T (NodeRef name)]
, name ~ Name, info ~ Int, ns ~ nodes
)
Expand Down Expand Up @@ -380,7 +380,7 @@ type instance ConstrainGraphic (LetGrp (PatSurface t)) (ExprF f name |: Hole ns
= ( Monad m
, edges :>+: '[T Sub, T (Binding Name), T Instance, T Unify]
, edges :>+: '[Pht Sub]
, nodes :>+: '[T NodeBot, G, T NodeArr, T NodeApp, T NodeTup, T NodeRec, T (NodeHas Label)]
, nodes :>+: '[T NodeBot, G, T NodeArr, T NodeTup, T NodeRec, T (NodeHas Label)]
, nodes :>+: '[T (NodeRef name)]
, HasNodeCreator m
, HasConstraintGenErr name m
Expand Down Expand Up @@ -555,7 +555,7 @@ genPatternConstraint
, ConstraintGen injs target Int, ConstrainGraphic injs target m nodes edges Int

, edges :>+: '[T Sub, T (Binding name), T Instance, T Unify]
, nodes :>+: '[T NodeBot, G, T NodeArr, T NodeApp, T NodeTup, T NodeRec, T (NodeHas label)]
, nodes :>+: '[T NodeBot, G, T NodeArr, T NodeTup, T NodeRec, T (NodeHas label)]
, Traversable lits, Traversable injs, HasNodeCreator m
, HasConstraintGenErr name m
, HasOrderGraph nodes edges Int
Expand Down
13 changes: 6 additions & 7 deletions bootstrap/src/Language/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,17 @@ type PatInternal typ = Pattern PatInternalLitExt (Cast typ :+: PatGroup) Label N
type PatInternalLitExt = LiteralText :+: LiteralInteger :+: LiteralNumber

type ExprInternal typ = Expr (ExprInternalExt typ)
type ExprInternalExt typ =
( Let (Binder (Name @: typ)) -- non-recursive local binding
type ExprInternalExt typ
= Let (Binder (Name @: typ)) -- non-recursive local binding
:+: Letrec (Binder (Name @: typ)) -- recursive local binding group
:+: Lambda (Binder (Prefix Name typ)) -- type lambda
:+: Lambda (Binder (Name @: typ)) -- term lambda
:+: Apply
:+: Match (PatInternal typ) -- pattern match
:+: Value (Coerce Name typ) -- evidence of type inference
:+: Cast typ -- type coercion
:+: Apply -- term application
:+: Match (PatInternal typ) -- pattern match
:+: Value (Coerce Name typ) -- evidence of type inference
:+: Cast typ -- type coercion
:+: LiteralText :+: LiteralInteger :+: LiteralNumber
:+: Tuple :+: Record Label :+: Selector Label :+: Constructor Label
)


------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions bootstrap/src/Transform/CPSTransform.hs

This file was deleted.

3 changes: 3 additions & 0 deletions bootstrap/src/Transform/LowerCPS.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Transform.LowerCPS
()
where
4 changes: 4 additions & 0 deletions bootstrap/src/Transform/Rename.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Transform.Rename

Check warning on line 1 in bootstrap/src/Transform/Rename.hs

View workflow job for this annotation

GitHub Actions / build

The export item ‘module Transform.Rename’ is missing an export list


where
3 changes: 3 additions & 0 deletions bootstrap/src/Transform/Simplify.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Transform.Simplify

Check warning on line 1 in bootstrap/src/Transform/Simplify.hs

View workflow job for this annotation

GitHub Actions / build

The export item ‘module Transform.Simplify’ is missing an export list

where

0 comments on commit 893a67c

Please sign in to comment.