CakeML/cakeml

Implement lexer on mlstrings

開放

#353 建立於 2017年10月26日

 (3 則留言) (0 個反應) (0 位負責人)Standard ML (98 個分叉)auto 404
help wanted

倉庫指標

星標
 (1,169 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

The CakeML lexer operates on a char list. Therefore the first thing the CakeML compiler does after reading in its input string is explode the string into a list. This is wasteful: I think the lexer can easily be made to work on mlstrings.

This issue is to make the lexer operate on mlstrings and update the compiler accordingly to avoid the explode.

Extension thoughts:

  • The sexp-parsing option would still need to explode the input because the sexp parser operates on char lists in a possibly more unavoidable way. (This issue does not require avoiding the explode for sexps.)
  • For large input, we might want to be even more sophisticated and lex/parse/typecheck incrementally, to catch errors before reading in all the source code. (Obviously this issue doesn't require doing that.)

貢獻者指南