merge: with main

This commit is contained in:
felipegchi 2022-11-30 13:44:20 -03:00
commit e593b5dfdc
8 changed files with 689 additions and 40 deletions

148
Cargo.lock generated
View File

@ -2,6 +2,12 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "anyhow"
version = "1.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6"
[[package]]
name = "arrayvec"
version = "0.7.2"
@ -14,7 +20,7 @@ version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"hermit-abi 0.1.19",
"libc",
"winapi 0.3.9",
]
@ -132,14 +138,14 @@ dependencies = [
[[package]]
name = "clap"
version = "4.0.22"
version = "4.0.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91b9970d7505127a162fdaa9b96428d28a479ba78c9ec7550a63a5d9863db682"
checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d"
dependencies = [
"atty",
"bitflags",
"clap_derive 4.0.21",
"clap_lex 0.3.0",
"is-terminal",
"once_cell",
"strsim",
"termcolor",
@ -250,9 +256,9 @@ dependencies = [
[[package]]
name = "crossbeam-epoch"
version = "0.9.12"
version = "0.9.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96bf8df95e795db1a4aca2957ad884a2df35413b24bbeb3114422f3cc21498e8"
checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a"
dependencies = [
"autocfg 1.1.0",
"cfg-if",
@ -263,9 +269,9 @@ dependencies = [
[[package]]
name = "crossbeam-queue"
version = "0.3.7"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebb3d1683412e9be6a15533314f00ec223c0762c522a3f77f048b265aab4470c"
checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add"
dependencies = [
"cfg-if",
"crossbeam-utils",
@ -273,9 +279,9 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
version = "0.8.12"
version = "0.8.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac"
checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f"
dependencies = [
"cfg-if",
]
@ -330,6 +336,33 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797"
[[package]]
name = "errno"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
dependencies = [
"errno-dragonfly",
"libc",
"winapi 0.3.9",
]
[[package]]
name = "errno-dragonfly"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "exitcode"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de853764b47027c2e862a995c34978ffa63c1501f2e15f987ba11bd4f9bba193"
[[package]]
name = "fixed-hash"
version = "0.7.0"
@ -405,6 +438,15 @@ dependencies = [
"libc",
]
[[package]]
name = "hermit-abi"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
dependencies = [
"libc",
]
[[package]]
name = "hex"
version = "0.4.3"
@ -419,8 +461,8 @@ checksum = "809e18805660d7b6b2e2b9f316a5099521b5998d5cba4dda11b5157a21aaef03"
[[package]]
name = "hvm"
version = "1.0.4-beta"
source = "git+https://github.com/Kindelia/HVM.git#169f82733a4cbfe15f3d49d45a8aef02c24de18d"
version = "1.0.5-beta"
source = "git+https://github.com/Kindelia/HVM.git#0b191cdb5f8997a7e9c257d709c522e06d331b73"
dependencies = [
"clap 3.2.23",
"crossbeam",
@ -501,6 +543,28 @@ dependencies = [
"web-sys",
]
[[package]]
name = "io-lifetimes"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
dependencies = [
"libc",
"windows-sys",
]
[[package]]
name = "is-terminal"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330"
dependencies = [
"hermit-abi 0.2.6",
"io-lifetimes",
"rustix",
"windows-sys",
]
[[package]]
name = "itertools"
version = "0.10.5"
@ -554,7 +618,9 @@ dependencies = [
name = "kind-cli"
version = "0.3.0"
dependencies = [
"clap 4.0.22",
"anyhow",
"clap 4.0.29",
"exitcode",
"kind-checker",
"kind-driver",
"kind-query",
@ -576,6 +642,7 @@ dependencies = [
name = "kind-driver"
version = "0.1.0"
dependencies = [
"anyhow",
"dashmap",
"fxhash",
"hvm",
@ -604,6 +671,7 @@ dependencies = [
name = "kind-pass"
version = "0.1.0"
dependencies = [
"anyhow",
"fxhash",
"im-rc",
"kind-derive",
@ -700,7 +768,7 @@ dependencies = [
[[package]]
name = "kindelia_common"
version = "0.1.5"
source = "git+https://github.com/developedby/Kindelia/?branch=kdl-lang-crate#5a59c6b0798c561bb1ec42a6e786a93af9151276"
source = "git+https://github.com/developedby/Kindelia/?branch=kdl-lang-crate#ff2f75e319c167cbc9d19cbc35fbe0d9a510b56a"
dependencies = [
"bit-vec",
"hex",
@ -714,7 +782,7 @@ dependencies = [
[[package]]
name = "kindelia_lang"
version = "0.1.0"
source = "git+https://github.com/developedby/Kindelia/?branch=kdl-lang-crate#5a59c6b0798c561bb1ec42a6e786a93af9151276"
source = "git+https://github.com/developedby/Kindelia/?branch=kdl-lang-crate#ff2f75e319c167cbc9d19cbc35fbe0d9a510b56a"
dependencies = [
"hex",
"kindelia_common",
@ -733,6 +801,12 @@ version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "linux-raw-sys"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f"
[[package]]
name = "lock_api"
version = "0.4.9"
@ -817,7 +891,7 @@ version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5"
dependencies = [
"hermit-abi",
"hermit-abi 0.1.19",
"libc",
]
@ -841,9 +915,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "os_str_bytes"
version = "6.3.1"
version = "6.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9"
checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
[[package]]
name = "output_vt100"
@ -882,9 +956,9 @@ dependencies = [
[[package]]
name = "parking_lot_core"
version = "0.9.4"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0"
checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba"
dependencies = [
"cfg-if",
"libc",
@ -1188,6 +1262,20 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6"
[[package]]
name = "rustix"
version = "0.36.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb93e85278e08bb5788653183213d3a60fc242b10cb9be96586f5a73dcb67c23"
dependencies = [
"bitflags",
"errno",
"io-lifetimes",
"libc",
"linux-raw-sys",
"windows-sys",
]
[[package]]
name = "same-file"
version = "1.0.6"
@ -1224,18 +1312,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.147"
version = "1.0.148"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.147"
version = "1.0.148"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c"
dependencies = [
"proc-macro2",
"quote",
@ -1284,9 +1372,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
version = "1.0.103"
version = "1.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d"
checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce"
dependencies = [
"proc-macro2",
"quote",
@ -1295,9 +1383,9 @@ dependencies = [
[[package]]
name = "sysinfo"
version = "0.26.7"
version = "0.26.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c375d5fd899e32847b8566e10598d6e9f1d9b55ec6de3cdf9e7da4bdc51371bc"
checksum = "29ddf41e393a9133c81d5f0974195366bd57082deac6e0eb02ed39b8341c2bb6"
dependencies = [
"cfg-if",
"core-foundation-sys",
@ -1400,9 +1488,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
[[package]]
name = "uint"
version = "0.9.4"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601"
checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52"
dependencies = [
"byteorder",
"crunchy",

77
FEATURES.md Normal file
View File

@ -0,0 +1,77 @@
It's a entirely new compiler in the 0.3 version. A lot of the features are just simple increments to the old ones but they really help with DX. Lets start by the lexical features:
- Identifiers cannot start with dot
- We can have numbers in a lot of formats now like:
- `0xFF`, `0XFF`, `0o17`, `0O17`, `0b10`, `0B10` and decimals.
- `0u60` and `0u120`, `0n` that describes u120 and u60 literals.
- Numbers can contain lots of underscores (just use one between digits please,
we will change it in the future) e.g `100_000_000`
- There's a distinction between Upper identifiers and Lower identifiers. Upper cased identifiers
can contain a single `'/'` between two parts, if the second part is available then the first one is the name that will be replaced by an 'use' statement.
- each string char and the char inside a char token can contain escape sequences in a looot of format. like `\x12` `\u1234` `\n` `\r` `\t` `\0` `\\` `\'` `\"`
- Comments with `/* */` that can be nested :)
The syntatic features are almost all the same with some small changes.
- Attributes are a little bit more complex and can be seen in some formats.
- Single identifier like: #inline
- With arguments like: #derive[match, open]
- With value like: #kdl_name = Joestar
- Use statements are in the format `use A as B` and they rename upper cased identifiers like `B/c` to `A.c`
- Type definitions now support indices and are in the .kind2 files! e.g:
```js
// Parameters are always in the context like `t` but `n` isnt.
type Vec (t: Type) ~ (n: Nat) {
cons <size: Nat> (x: t) (xs: Vec t size) : Vec t (Nat.succ size)
nil : Vec t Nat.zero
}
```
You can use the `match` eliminator to destruct this vec without having to pattern match on this (but you have to derive `match`).
```js
Main : U60
Main =
match Vec (Vec.cons 1 Vec.nil) {
cons xs .. => 0
nil => 1
}
```
Take a look at the section about `match patterns` in order to understand the `xs` and `..` inside the `cons` case.
- Record definitions :D
```js
record User {
constructor new
name : String
age : U60
}
```
You can use the `destruct` notation if you want to destruct a record but you have to derive `open` to make this feature work. `#derive[open]` before the record definition.
```js
// Using
Main : U60
Main = let User.new name .. = User.new "abe" 21
name
```
- Entries stay all the same, except that you cannot put repeated names because it would make the named parameter process a bit harder.
Btw, you can make something like
```js
Dio (n: U60) (i: U60) : Type
// Named parameters :sunglasses:
Main {
Dio (i = 2) (n = 4)
}
```
- All the current syntax sugars are:
- Sigma types
- Substitutions
- Do notation
- Match
- Let
- If
- Doc strings (useful for the future) using `///`

1
Pudding.kind2 Normal file
View File

@ -0,0 +1 @@
K

View File

@ -22,7 +22,7 @@ Pure functions are defined via equations, as in [Haskell](https://www.haskell.or
// Applies a function to every element of a list
map <a> <b> (list: List a) (f: a -> b) : List b
map a b Nil f = Nil
map a b (Cons head tail) f = Cons (f x) (map tail f)
map a b (Cons head tail) f = Cons (f head) (map tail f)
```
Side-effective programs are written via monadic monads, resembling [Rust](https://www.rust-lang.org/) and [TypeScript](https://www.typescriptlang.org/):

View File

@ -465,14 +465,6 @@ List.nil)
But underneath the hood, what an implicit argument actually does is automatically put holes in these places.
Moreover, single holes can be shortened as `!`. So it can also be written as:
```
List.cons!(List.cons!(1, List.cons!(2, List.nil!)),
List.cons!(List.cons!(3, List.cons!(4, List.nil!)),
List.nil!))
```
Of course, in this particular example, we can just use the list notation directly:
```

View File

@ -1,3 +1,3 @@
run {
#2
#2
}

491
flamegraph.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 483 KiB

BIN
perf.data Normal file

Binary file not shown.