nine months of coastal living: coastML status report for November 2022
Today marks nine months of coastal living; let’s checkout the running burndown chart:
✓ assignments
✓ functions
✓
case
forms✓ thread assignments into
case
forms (e.g.a = case x …
becomescase x | … { a = … }
)✓
case
forms within other forms, such as function calls
✓
type
forms✓ Python generation
✓ decomposition in
case
forms✓ including pattern matching
❏ array pattern matching
❏ string pattern matching (this could get interesting…)
✓ accessors (both variables and lambdas) for
type
❏
gn
forms❏
fc
forms❏
mod
forms✓ an analog to SML’s
op
, using backticks❏
sig
forms❏
impl
forms❏ basis library (stubbed out, need to actually compile)
✓ basic basis stubs: some members of
array-*
,string-*
have been stubbed out✓ array-length
✓ array-get
✓ array-set!
✓ array-make
✓ array-init
✓ array-make-matrix
✓ array-append
✓ array-append!
❏ array-concat
❏ array-concat!
✓ array-sub
✓ array-copy
❏ array-fill!
❏ array-blit!
❏ array→list
❏ list→array
✓ array-iter
✓ array-map
✓ array-iter-index
✓ array-map-index
❏ array-foldl
❏ array-foldr
❏ array-sort
✓ array-sort!
❏ array-stable-sort
❏ array-fast-sort
✓ string-length
✓ string-get
❏ string-make
❏ string-init
✓ string-split
✓ string-append
❏ string-join
❏ string-contains
❏ string-concat
❏ string-copy
❏ string→array
✓ string-iter
✓ string-map
✓ string-iter-index
❏ string-map-index
❏ string-foldl
❏ string-foldr
✓ string-sort
❏ compare
❏ char-code
❏ char-chr
❏ char-escaped
❏ char-lowercase
❏ char-uppercase
❏ char-compare
❏ random-choice
❏ random-int
❏ random-float
❏ random-byte
❏ random-string
❏ random
More of the OS interaction stuff out of the Pervasives API
❏ basis library modules (modular forms, e.g.
array-get
becomesArray::get
)
✓ support for the
is
form❏
coastline
files (analog tomli
files)❏ code generation
❏ C
❏ C++
❏ C#
❏ Java
❏ Go
✓ Python
✓ JavaScript
❏ Reason/OCaml
❏ Haskell
❏ F#
❏ Rust
❏ type inference
❏ refinement types
❏ a compiler
❏ lambda lifter
❏ closure conversion
❏
pragma
to control certain aspects of compilation❏ checking of accessors prior to compilation
❏ value restriction for
ref
types✓ checking that functions exist prior to compilation
✓ checking that
case
forms use correct constructors❏ self-tail call rewriting
bugs fixed
✓ nested arrays
[[[1] [2]] [[3] [4]]]
✓ missing
/
character in identifier/operator character sets✓ floating point numbers with two integral digits (e.g.
0.12
and1.12
worked but not10.12
)this was noticed when attempting to write some software to generate Julian dates
✓
return
logic❏ there’s more work to be done here at the top level…
✓ indentation of blocks
✓ missing
bool
type✓ parsing
type
definitions that have other complex types in them✓ munging idents (ex:
julian-date
becomesjulian_date
)✓ stripping comments prior to output
really need to handle these so that we can output them into the compiled language, but for now this suffices
✓
return
prepended to forms that are rewritten tofor
loops✓ fix spacing between
class
forms in Python output✓ fixed bugs with parsing & displaying characters
❏
case
forms at the start of a(call)
form are assumed to be functions instead of evaluated for a lambda(case … | 10 { " " } | _ { "nope" } esac …)
is assumed to be a lambda already… whoops
✓
case
forms in a function call in assignment clobbers the assignmentex:
a = string-split-char ':' case (OS::getenv "PATH") | (Result.Some s) { s } | (Result.None) { "" } esac;
produces
a = res1 = …
which is obviously in correct
✓
case
forms that destructuretype
forms don’t indent correctly and don’t nestif-elif-else
correctly✓
case
forms that bind a function call do not indent the initialif
correctly✓ destructuring binds didn’t actually apply a
.format
correctly✓ indentation more generally is handled better
✓ ability to call Tags and Modules
✓ instantiate the classes we define
✓ fixed bug wherein two
if
blocks were generated and one was not indented correctlybasically, the
case
generator uses a counter, and one arm of the tests didn’t update the counter
✓
()
(aka unit) wasn’t being detected as a simple type✓
()
was producing an incorrect lexing:[(), )]
Type handling burndown:
❏ parse coastline files
❏ load basis & pervasives coastline files
✓ parse
\`op\`
forms correctly❏ parse
impl
correctly (for type classes)❏ parse
sig
correctly❏ support new function signatures with type class information (e.g.
add is function[[Num[A]] A A A]
)❏ type check
❏ type infer
❏ refinements
coast works
This month, I’ve fixed a few bugs in the handling of unit (()
), gotten the self-TCO rewriting system up to snuff, and added support for StandardML-style operator literals (which use backticks). I’ve also started working on the type system, which you can see above. Next month, I’ll be focusing primarily on getting the type system up to the point where I can support type classes; I’m really keen on getting output to other typed languages going, especially Go (mostly so I can stop writing Go myself).