Releases
grain-v0.6.0
0.6.0 (2024-03-04)
� BREAKING CHANGES
stdlib: Replace parseInt
error strings with structured error enum (#1755 )
stdlib: Move stdlib sys
modules to wasi
(#2056 )
compiler: Remove arbitrary per-file compiler flags, add acceptable options as module attributes (#1804 )
compiler: Require extension when including relative file paths (#1842 )
compiler: Update include syntax (#2043 )
stdlib: Remove sin
, cos
, tan
, gamma
, factorial
from Number
module (#2046 )
compiler: Update use syntax (#2041 )
grainfmt: Implement new formatter (#1976 )
stdlib: Use default arguments in more of stdlib (#1772 )
stdlib: Add print
suffix default argument (#1768 )
graindoc: Allow @since
and @returns
once per export (#1946 )
graindoc: Improve docgen for labeled & default arguments (#1776 )
stdlib: Replace Float64
arithmatic/comparison functions with operators (#1957 )
stdlib: Replace Float32
arithmatic/comparison functions with operators (#1954 )
stdlib: Replace Int64
arithmatic functions with operators (#1935 )
stdlib: Replace Int32
arithmatic functions with operators (#1936 )
stdlib: Switch to using records for getInternalStats
(#1898 )
cli: Ensure --use-start-section
can only be used with compile command (#1871 )
cli: Allow specifying WASI environment variables and CLI args (#1840 )
compiler: Require module
prefix on use
/provide
for modules (#1868 )
stdlib: Reorder parameters to List.insert
(#1857 )
stdlib: Handle printing of reference cycles (#1844 )
compiler: Change ->
to =>
in type signatures (#1855 )
compiler: Make types nonrecursive by default (#1826 )
compiler: Remove static runtime pointers (#1806 )
compiler: Remove memory import from _genv (#1830 )
compiler: Changed comma to and
in mutually rec types
compiler: Changed comma to and
in recursive types and bindings (#1827 )
Remove js-runner (#1585 )
stdlib: Replace Result
/Option
and
/or
functions with operators (#1821 )
compiler: Reduce size of runtime heap (#1807 )
Require node version >=18.15 for WASI support (#1612 )
stdlib: Ensure Array.fillRange
works with negative indexing & throws IndexOutOfBound (#1761 )
compiler: Disallow enum variants with parens but no types (#1809 )
stdlib: Remove extra space when converting Bytes to String (#1800 )
stdlib: Convert unsafe Wasm
functions to operators (#1734 )
stdlib: Use Array length as default end in Array.slice
function (#1762 )
compiler: Remove recursive_types and principal config (#1751 )
stdlib: Use String length as default end in String.slice
function (#1748 )
Rework preopened directories (#1656 )
stdlib: Group mutable/immutable data structures (#1652 )
compiler: Optimize type metadata loading (#1741 )
compiler: Labeled and default arguments (#1623 )
compiler: Remove built-in FileDescriptor type (#1747 )
compiler: Enable tail calls by default (#1589 )
stdlib: Replace bigint/number arithmetic functions with operators (#1742 )
stdlib: Update Operator uint
operator Names (#1738 )
stdlib: Provide empty byte array from Bytes.make (#1729 )
stdlib: Add optimization for Number.pow(Rational, Int)
(#1716 )
compiler: Custom box printing (#1713 )
stdlib: Update Buffer/Bytes to use new integer types (#1704 )
compiler: Require floats always have a digit on left & right of dot (#1703 )
compiler: Remove 32-bit numbers from Number
type (#1683 )
compiler: Short integer values (#1669 )
compiler: Supply primitive types via the compiler (#1667 )
compiler: Allocate closures only when necessary (#1660 )
stdlib: Add **
(pow) operator to Pervasives module (#1690 )
compiler: Remove Exclusive/Inclusive Ranges, provide as record via compiler (#1616 )
stdlib: Make queue and stack mutable & provide Immutable submodules (#1479 )
compiler: Disallow multiple provide
s of the same value (#1689 )
graindoc: Only use original doc blocks when re-providing (#1687 )
graindoc: Support docblocks on submodules (#1684 )
graindoc: Remove section attribute (#1681 )
compiler: Explicit abstract types (#1680 )
compiler: Add Uint32 and Uint64 types (#1531 )
stdlib: Remove cons
and empty
from Pervasives (#1657 )
stdlib: Sys/File reading and writing operate on Bytes (#1655 )
compiler: Make List a language-supplied type (#1648 )
stdlib: Use correct casing for BigInt module name
graindoc: Replace module attribute with docblock on module header (#1647 )
compiler: Apply correct rules for parsing Unicode whitespace (#1554 )
compiler: Module system (#1584 )
compiler: Change Char internal representation (#1622 )
compiler: Inline record constructors (#1586 )
stdlib: Replace Number.nan & Number.infinity constants with keywords (#1618 )
compiler: Remove support of single-argument tuples (#1608 )
compiler: Rename _grainEnv
to _genv
(#1607 )
compiler: Add yield
and macro
reserved keywords (#1471 )
compiler: Implement Infinity
and NaN
syntax (#1472 )
stdlib: List.rotate
wraparound for count > length (#1558 )
compiler: Early return (#1464 )
compiler: Include Option and Result as language-supplied types (#1591 )
stdlib: Change array rotation direction (#1552 )
stdlib: Support zipping arrays of different sizes (#1402 )
Remove --parser-debug-level (#1311 ) (#1447 )
compiler: Refactor enum constructors (#1211 )
Features
Add exception
opentype implementation to Oprint
(#1896 ) (51d53f7 )
Add Hex Exponent Decimals (8a69eb3 )
ci: Add builds for preview binaries (#1777 ) (d512c5a )
cli: Allow specifying WASI environment variables and CLI args (#1840 ) (fb8fbf2 )
cli: Improve error handling around grain run
(#1913 ) (fc9b434 )
compiler: Add magic
primitive (#1766 ) (a28ebb4 )
compiler: Add yield
and macro
reserved keywords (#1471 ) (f0e29c5 )
compiler: Add ability to match on low level wasm types (#1588 ) (0d30888 )
compiler: Add hex float syntax (#1743 ) (8a69eb3 )
compiler: Add stack allocation information to small ints (#1780 ) (6f1a1a9 )
compiler: Add Uint32 and Uint64 types (#1531 ) (42ffdc4 )
compiler: Allocate closures only when necessary (#1660 ) (c40df12 )
compiler: Allow a newline character after 'as' when aliasing (#1641 ) (2719034 )
compiler: Allow arrays to do binary operation assignment (#1928 ) (8a335ae )
compiler: Allow importing a memory (#1661 ) (3140ba2 )
compiler: Bytes literals (#1662 ) (3d8e4c5 )
compiler: Change ->
to =>
in type signatures (#1855 ) (b3d68a4 )
compiler: Change Char internal representation (#1622 ) (58c9a51 )
compiler: Changed comma to and
in mutually rec types (923625d )
compiler: Changed comma to and
in recursive types and bindings (#1827 ) (923625d )
compiler: Custom box printing (#1713 ) (3c86e45 )
compiler: Early return (#1464 ) (1bffc82 )
compiler: Enable tail calls by default (#1589 ) (f6e5b00 )
compiler: Explicit abstract types (#1680 ) (58cd224 )
compiler: Implement Infinity
and NaN
syntax (#1472 ) (74a196d )
compiler: Include Option and Result as language-supplied types (#1591 ) (bd5403f )
compiler: Inline record constructors (#1586 ) (43082f5 )
compiler: Labeled and default arguments (#1623 ) (28a38ac )
compiler: Make List a language-supplied type (#1648 ) (2ee1328 )
compiler: Make types nonrecursive by default (#1826 ) (46b8a5a )
compiler: Module system (#1584 ) (752da69 )
compiler: Propagate attribute locations to Anftree (#1642 ) (cce2821 )
compiler: Providing, including, reproviding exceptions (#1849 ) (687e747 )
compiler: Rational number type (#1603 ) (350f850 )
compiler: Reduce size of runtime heap (#1807 ) (246f894 )
compiler: Refactor enum constructors (#1211 ) (8d465b7 )
compiler: Remove 32-bit numbers from Number
type (#1683 ) (50bf8ee )
compiler: Remove arbitrary per-file compiler flags, add acceptable options as module attributes (#1804 ) (72b2139 )
compiler: Remove Exclusive/Inclusive Ranges, provide as record via compiler (#1616 ) (49a399d )
compiler: Remove Pervasives' dependency on toString when types are elided (#1664 ) (f703476 )
compiler: Remove support of single-argument tuples (#1608 ) (509cd85 )
compiler: Require module
prefix on use
/provide
for modules (#1868 ) (5efb54c )
compiler: Require extension when including relative file paths (#1842 ) (dde62d3 )
compiler: Short integer values (#1669 ) (fc4670d )
compiler: Streamlined reference counting (#1714 ) (0711868 )
compiler: Supply primitive types via the compiler (#1667 ) (b41feb7 )
compiler: Suppress warnings about using fromNumber for Int32/64 and Float32/64 tests (#1638 ) (b687e31 )
compiler: Update include syntax (#2043 ) (5f44d4e )
compiler: Update use syntax (#2041 ) (cd346ab )
graindoc: Add test harness (#1767 ) (8a93ebe )
graindoc: Allow [@since](https://github.com/since)
and [@returns](https://github.com/returns)
once per export (#1946 ) (ad977aa )
graindoc: Allow doc comments on variants and record fields (#1852 ) (53f770c )
graindoc: Improve docgen for labeled & default arguments (#1776 ) (be7ff9d )
graindoc: Only use original doc blocks when re-providing (#1687 ) (97c7ce4 )
graindoc: Refactored Graindoc parser (#1658 ) (b447ced )
graindoc: Replace module attribute with docblock on module header (#1647 ) (2ff9d9e )
graindoc: Support docblocks on submodules (#1684 ) (bc13017 )
grainfmt: Implement new formatter (#1976 ) (1568aa0 )
grainlsp: Implement goto definition (#1787 ) (3cb862a )
grainlsp: Implement inlay hints for module includes (#1793 ) (408da76 )
grainlsp: Provide hovers on use statements (#1688 ) (c5cd21f )
lsp: Add hover for submodules (#2028 ) (85d8768 )
lsp: Support goto definition on exceptions (#1895 ) (218b2f0 )
lsp: Support hover on include
statements (#1963 ) (b6e1570 )
Remove js-runner (#1585 ) (e10d612 )
Rework preopened directories (#1656 ) (7d3006d )
runtime: Allow modulo on floating point numbers (#1914 ) (f90d8af )
stdlib: List.rotate
wraparound for count > length (#1558 ) (6dd9680 )
stdlib: Add **
(pow) operator to Pervasives module (#1690 ) (b16b455 )
stdlib: Add **
operator to Int32
module (#1938 ) (32b9639 )
stdlib: Add **
operator to Int64
module (#1937 ) (48de28b )
stdlib: Add ==
operator to Queue
module (#1931 ) (3c0ea18 )
stdlib: Add addCharFromCodePoint
to Buffer module (#1883 ) (18b553a )
stdlib: Add asin
, acos
, atan
, isClose
to Number module (#1699 ) (353b544 )
stdlib: Add atan2
to the Number
module (#2016 ) (145b783 )
stdlib: Add chunk
function to Array module (#1708 ) (fba7c1d )
stdlib: Add fromArray
to Queue
module (#1932 ) (1c35a94 )
stdlib: Add isEmpty
to List
module (#1860 ) (7362189 )
stdlib: add isEmpty
to String
module (#1861 ) (e8cb932 )
stdlib: Add Json
module (#1133 ) (5a6e4c6 )
stdlib: Add linearInterpolate
, linearMap
and clamp
(#1707 ) (15842a1 )
stdlib: Add print
suffix default argument (#1768 ) (6701170 )
stdlib: Add toArray
to Queue
(#1930 ) (7c865a4 )
stdlib: Add toIntegerRatio
and fromIntegerRatio
to Rational Library (#1746 ) (008a735 )
stdlib: Add toList
and fromList
functions to Queue
module (#1866 ) (7cdcf95 )
stdlib: Add Uri
module (#1970 ) (5cf726e )
stdlib: Add ASCII utilities to String, Char (#1975 ) (f65002d )
stdlib: Add optimization for Number.pow(Rational, Int)
(#1716 ) (67bee5c )
stdlib: Change array rotation direction (#1552 ) (bbe56ad )
stdlib: Convert unsafe Wasm
functions to operators (#1734 ) (114d17b )
stdlib: Handle printing of reference cycles (#1844 ) (49c854e )
stdlib: Make queue and stack mutable & provide Immutable submodules (#1479 ) (979a20c )
stdlib: Move stdlib sys
modules to wasi
(#2056 ) (ca75e38 )
stdlib: Provide empty byte array from Bytes.make (#1729 ) (fde3064 )
stdlib: Remove parseInt dependency on Pervasives (#1649 ) (9408568 )
stdlib: Reorder parameters to List.insert
(#1857 ) (973f3f3 )
stdlib: Replace Float32
arithmatic/comparison functions with operators (#1954 ) (52cc15a )
stdlib: Replace Float64
arithmatic/comparison functions with operators (#1957 ) (dea4cb5 )
stdlib: Replace Int32
arithmatic functions with operators (#1936 ) (8a69dd3 )
stdlib: Replace Int64
arithmatic functions with operators (#1935 ) (cfb909c )
stdlib: Replace Result
/Option
and
/or
functions with operators (#1821 ) (686de7e )
stdlib: Simplify equal
using Memory.compare
(#1972 ) (dc21976 )
stdlib: Support zipping arrays of different sizes (#1402 ) (b8ae3d6 )
stdlib: Use Array length as default end in Array.slice
function (#1762 ) (a698fdc )
stdlib: Use String length as default end in String.slice
function (#1748 ) (b7c41a6 )
Bug Fixes
cli: Correct typo in printing stack (#1924 ) (a4016f1 )
cli: Ensure --use-start-section
can only be used with compile command (#1871 ) (d9227d7 )
cli: Show correct error when module traps (#2050 ) (88560f2 )
compiler: Allow early return in let bindings (#1727 ) (43adefe )
compiler: Allow providing values of types provided later (#1897 ) (1c43bd6 )
compiler: Allow reproviding from submodules (#1888 ) (97c00e1 )
compiler: Apply correct rules for parsing Unicode whitespace (#1554 ) (4f19d71 )
compiler: Correct locations for data constructor idents (#1752 ) (d015a97 )
compiler: Correct the warning suggestion for Float32 And Float64 values (#1671 ) (32e0397 )
compiler: Correctly handle and backpatch mutually recursive closure scope functions (#1808 ) (c2a0c5b )
compiler: Disallow enum variants with parens but no types (#1809 ) (25e4946 )
compiler: Disallow multiple provide
s of the same value (#1689 ) (7ab7ddc )
compiler: Ensure constant number locations are propagated correctly when parsing (#2044 ) (53a33e6 )
compiler: Ensure refcounts are maintained when tail calls use arguments multiple times (#1993 ) (86c6e12 )
compiler: Ensure reprovided types unify (#2051 ) (4c3203c )
compiler: Ensure the extension is chopped in the case of module name error (#2060 ) (5c79c84 )
compiler: Fix memory bug in universal exports (#1663 ) (87724f0 )
compiler: Inline record exception constructors (#1709 ) (ffd4d44 )
compiler: Properly apply well-formedness checks on patterns (#1989 ) (00abee8 )
compiler: Properly handle parsing return of negative number (#1611 ) (0a5a97c )
compiler: Provide appropriate error for empty char literals (#1728 ) (e4dcda8 )
compiler: Provide full module interface in intermediate wasm files (#1756 ) (683f803 )
compiler: Re-providing types (#1874 ) (6df9eb2 )
compiler: Remove number constant folding optimization (#1676 ) (181798d )
compiler: Remove static runtime pointers (#1806 ) (8d76dc9 )
compiler: Supply correct locations for attributes (#2048 ) (b19df94 )
compiler: Support deeply nested types in modules (#1673 ) (b6651bb )
compiler: Type aliasing in use
statements (#1887 ) (79ab814 )
Fix String.ReplaceAll (#1705 ) (d3af004 )
graindoc: Escape * characters that would close markdown bold incorrectly (3b6b5ca )
graindoc: Escape * chars that would close markdown bold incorrectly (#1685 ) (3b6b5ca )
graindoc: Use Markdown bold helper for each case of bolding (#1695 ) (d798433 )
lsp: Fix lsp crash when hovering on function with default arg (#1969 ) (dd25d02 )
lsp: Prevent lsp crash when module cannot be found (#2003 ) (e4b97ea )
stdlib: Ensure Array.fillRange
works with negative indexing & throws IndexOutOfBound (#1761 ) (3c3c4d9 )
stdlib: Ensure consistent marshal representation (#2045 ) (029059f )
stdlib: Error when relativeTo
used on relative source and absolute dest (#2054 ) (1626a1f )
stdlib: Fix overzealous Memory.fill in Buffer.truncate (#1781 ) (e1f24e9 )
stdlib: Properly handle extremely large integer bases in Number.(**)
(#1950 ) (84c076f )
stdlib: Properly resize empty Queue on push (#1865 ) (f7727ef )
stdlib: Properly resize empty Stack on push (#1867 ) (b90d924 )
stdlib: Remove extra space when converting Bytes to String (#1800 ) (543807b )
stdlib: Return early from Process.argv()
if length is zero (#1817 ) (8ccea28 )
stdlib: Sys/File reading and writing operate on Bytes (#1655 ) (17cb28d )
stdlib: Use correct casing for BigInt module name (2ff9d9e )
Miscellaneous Chores
compiler: Optimize type metadata loading (#1741 ) (a4519bc )
compiler: Remove built-in FileDescriptor type (#1747 ) (d40e84a )
compiler: Remove memory import from _genv (#1830 ) (c6693dd )
compiler: Remove recursive_types and principal config (#1751 ) (534bdca )
compiler: Rename _grainEnv
to _genv
(#1607 ) (73c9499 )
compiler: Require floats always have a digit on left & right of dot (#1703 ) (b657e1c )
graindoc: Remove section attribute (#1681 ) (e969ad7 )
Remove --parser-debug-level (#1311 ) (#1447 ) (f78587a )
Require node version >=18.15 for WASI support (#1612 ) (331ffc2 )
stdlib: Group mutable/immutable data structures (#1652 ) (f93afef )
stdlib: Remove cons
and empty
from Pervasives (#1657 ) (f6f02bc )
stdlib: Remove sin
, cos
, tan
, gamma
, factorial
from Number
module (#2046 ) (85c4389 )
stdlib: Replace parseInt
error strings with structured error enum (#1755 ) (ea26d18 )
stdlib: Replace bigint/number arithmetic functions with operators (#1742 ) (cbd46ee )
stdlib: Replace Number.nan & Number.infinity constants with keywords (#1618 ) (b437c13 )
stdlib: Switch to using records for getInternalStats
(#1898 ) (bdb119a )
stdlib: Update Buffer/Bytes to use new integer types (#1704 ) (d508e5a )
stdlib: Update Operator uint
operator Names (#1738 ) (decb053 )
stdlib: Use default arguments in more of stdlib (#1772 ) (f5e934f )
You can’t perform that action at this time.