From f480f6c868b78469d73d1a70cf516034e922c4af Mon Sep 17 00:00:00 2001 From: Julian Hyde Date: Sat, 7 Mar 2020 21:32:18 -0800 Subject: [PATCH] [MOREL-18] Release Morel 0.2 --- HISTORY.md | 87 +++++++++++++++++++ NOTICE | 2 +- README | 2 +- README.md | 8 +- docs/howto.md | 2 +- src/main/java/net/hydromatic/morel/Shell.java | 2 +- src/test/resources/script/blog.sml | 8 +- src/test/resources/script/blog.sml.out | 8 +- 8 files changed, 103 insertions(+), 16 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index a1bc0a95..f428e423 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -23,6 +23,93 @@ License. For a full list of releases, see github. +## 0.2 / 2020-03-10 + +The first release since smlj was renamed to Morel includes major +improvements to the type system and relational extensions. Some highlights: +* Functions and values can have polymorphic types, inferred as part of a + [Hindley-Milner type system](https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system); +* Relational expressions may now include a `group` clause, so you can + evaluate aggregate queries (similar to SQL `GROUP BY`); +* [Foreign values](https://github.com/julianhyde/morel/issues/5) allow external + data, such as the contents of a JDBC database, to be handled as if it is in + memory; +* Add built-in functions based on the + [`String`](http://sml-family.org/Basis/string.html) and + [`List`](http://sml-family.org/Basis/list.html) structures + in the Standard ML basis library; +* [Postfix field reference syntax](https://github.com/julianhyde/morel/issues/9) + makes Morel more familiar to SQL users; +* Add [Morel language reference](docs/reference.md). + +### Features + +* [MOREL-15] + Improve pretty-printing: wrap long lines, and abbreviate long lists and deep + structures +* [MOREL-12] + In `from` clause, allow initializers to reference previous variables +* In `group`, `as alias` is optional +* [MOREL-10] + Implicit labels in record expressions +* [MOREL-9] + Allow `.` as an alternative syntax for `# ` +* [MOREL-7] + Rename project from 'smlj' to 'morel' +* [SMLJ-5] + Foreign values, including record values based on the contents of a JDBC schema +* [SMLJ-6] + Add `group` clause (and `compute` sub-clause) to `from` expression, to support + aggregation and aggregate functions +* Polymorphic types +* Add `String` and `List` basis functions + +### Bug-fixes and internal improvements + +* [MOREL-16] + Ensure that types derived for REPL expressions have no free type variables +* [MOREL-14] + Tuple should equal record, and both equal `unit` when empty +* Add macros (special built-in functions that are 'called' at compile time to + generate a new AST) +* Add `interface MutableEvalEnv`, for code that wants to mutate the last + binding in an environment +* Make `EvalEnv` immutable +* Recursive functions in closures use the wrong environment +* Unit literal's `toString()` should be `()`, not `[]` +* For built-ins, add their alias to the compile-time environment +* In parallel declarations (`let` ... `and`) add variables to compilation + environment +* Refactor special type constructors (list, tuple, record) +* [SMLJ-4] + `let fun` inside `from` expression fails +* Move built-in constants and functions into new `enum BuiltIn` +* In `Shell`, fix parsing single-quote in line comments, and line endings in + multi-line statements + +### Build and tests + +* Test expressions used in documentation and blog posts +* Example of a user-defined aggregate function in a query +* Add a test with a temporary function in a query that takes a record-valued + argument +* In `ScriptTest`, only load `Dictionary` if script is `foreign.sml` +* Enable some `group` tests +* Add `Sys_env ()` function, that returns the current environment +* Upgrade maven: 3.5.4 → 3.6.3 +* Add maven wrapper jar +* Use correct `maven-javadoc-plugin` version +* Before launching repl, build test as well as main +* Convert `MainTest` to use fluent style +* In `Shell`, add optional pause, which seems to make `ShellTest` deterministic + +### Site and documentation + +* Add [Morel language reference](docs/reference.md) +* Add image to [README](README.md) +* Add [javadoc to site](http://hydromatic.net/morel/apidocs/) +* Generate an asciinema demo + ## 0.1 / 2019-07-24 Initial release features the core language (primitive types, lists, diff --git a/NOTICE b/NOTICE index 2cd6f347..6c1b7244 100644 --- a/NOTICE +++ b/NOTICE @@ -1,7 +1,7 @@ morel Standard ML interpreter, with relational extensions, implemented in Java -Copyright (C) 2019-2019 Julian Hyde +Copyright (C) 2019-2020 Julian Hyde All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/README b/README index bd0378ab..b01d51f5 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Morel release 0.1.0 +Morel release 0.2.0 This is a source or binary distribution of Morel. diff --git a/README.md b/README.md index 29603b83..28cfdb63 100644 --- a/README.md +++ b/README.md @@ -34,13 +34,13 @@ Java version 8 or higher. ### From Maven Get Morel from -Maven Central: +Maven Central: ```xml net.hydromatic - smlj - 0.1.0 + morel + 0.2.0 ``` @@ -62,7 +62,7 @@ On Windows, the last line is ```bash $ ./morel -morel version 0.1.0 (java version "11.0.4", JLine terminal, xterm-256color) +morel version 0.2.0 (java version "13", JLine terminal, xterm-256color) = "Hello, world!"; val it = "Hello, world!" : string = exit diff --git a/docs/howto.md b/docs/howto.md index e2904955..d0f77fdc 100644 --- a/docs/howto.md +++ b/docs/howto.md @@ -23,7 +23,7 @@ License. ## How to make a release (for committers) Make sure `mvn clean install`, `mvn site`, and -`mvn javadoc:javadoc javadoc:test-javadoc` pass under JDK 8 - 12. +`mvn javadoc:javadoc javadoc:test-javadoc` pass under JDK 8 - 14. Write release notes. Run the [relNotes](https://github.com/julianhyde/share/blob/master/tools/relNotes) diff --git a/src/main/java/net/hydromatic/morel/Shell.java b/src/main/java/net/hydromatic/morel/Shell.java index a09aba4b..6fcb51d6 100644 --- a/src/main/java/net/hydromatic/morel/Shell.java +++ b/src/main/java/net/hydromatic/morel/Shell.java @@ -148,7 +148,7 @@ private void printAll(List lines) { /** Generates a banner to be shown on startup. */ private String banner() { - return "morel version 0.1.0" + return "morel version 0.2.0" + " (java version \"" + System.getProperty("java.version") + "\", JRE " + System.getProperty("java.vendor.version") + " (build " + System.getProperty("java.vm.version") diff --git a/src/test/resources/script/blog.sml b/src/test/resources/script/blog.sml index 494e94e8..83f60285 100644 --- a/src/test/resources/script/blog.sml +++ b/src/test/resources/script/blog.sml @@ -90,7 +90,7 @@ end; (*) === Screen cast ================================================= -(*) Now we're in smlj's shell, for interactive commands. +(*) Now we're in morel's shell, for interactive commands. (*) First of all, we need to talk about comments. (* This is a block comment, which can span multiple lines... *) @@ -102,7 +102,7 @@ end; "a string literal"; 1 + 2; -(*) The smlj shell deduces the type of each expression, +(*) The Morel shell deduces the type of each expression, (*) and assigns it to a variable called "it". (*) We can use "it" in the next expression... it + 4; @@ -218,7 +218,7 @@ in end; (*) That's all, folks! -(*) To recap, smlj has: +(*) To recap, Morel has: (*) * expressions of int, string, boolean, float, char, list, (*) tuple and record types; (*) * lambda expressions and recursive functions; @@ -226,7 +226,7 @@ end; (*) * polymorphism and powerful type-inference; (*) * relational expressions (an extension to Standard ML). (*) -(*) Follow our progress at https://github.com/julianhyde/smlj. +(*) Follow our progress at https://github.com/julianhyde/morel. (*) This is only release 0.1, so there's more to come! (*) === 2020/02/25: Morel: A functional language for data =========== diff --git a/src/test/resources/script/blog.sml.out b/src/test/resources/script/blog.sml.out index c9ad4295..43df6f75 100644 --- a/src/test/resources/script/blog.sml.out +++ b/src/test/resources/script/blog.sml.out @@ -121,7 +121,7 @@ end; (*) === Screen cast ================================================= -(*) Now we're in smlj's shell, for interactive commands. +(*) Now we're in morel's shell, for interactive commands. (*) First of all, we need to talk about comments. (* This is a block comment, which can span multiple lines... *) @@ -137,7 +137,7 @@ val it = "a string literal" : string val it = 3 : int -(*) The smlj shell deduces the type of each expression, +(*) The Morel shell deduces the type of each expression, (*) and assigns it to a variable called "it". (*) We can use "it" in the next expression... it + 4; @@ -319,7 +319,7 @@ val it = ["Shaggy","Scooby"] : string list (*) That's all, folks! -(*) To recap, smlj has: +(*) To recap, Morel has: (*) * expressions of int, string, boolean, float, char, list, (*) tuple and record types; (*) * lambda expressions and recursive functions; @@ -327,7 +327,7 @@ val it = ["Shaggy","Scooby"] : string list (*) * polymorphism and powerful type-inference; (*) * relational expressions (an extension to Standard ML). (*) -(*) Follow our progress at https://github.com/julianhyde/smlj. +(*) Follow our progress at https://github.com/julianhyde/morel. (*) This is only release 0.1, so there's more to come! (*) === 2020/02/25: Morel: A functional language for data ===========