~jojo/Carth

f5e09e914464afd2dd4440c5f203ac11f7a69ca6 — JoJo 2 months ago 4787862
misc
3 files changed, 20 insertions(+), 22 deletions(-)

M TODO.org
D brittany.yaml
M src/Misc.hs
M TODO.org => TODO.org +18 -0
@@ 899,6 899,24 @@ Features and other stuff to do/implement in/around Carth.
   general sibling call optimization when supported. LLVM can do
   sibling calls, for example.

   Thinking about non-recursive tail calls. What is it that makes them
   difficult to optimize exactly I wonder. If we want to support stuff
   like continuation-passing style, general TCO would be quite
   necessary. Wiki sort of explains it: "However, for language
   implementations which store function arguments and local variables
   on a call stack (which is the default implementation for many
   languages, at least on systems with a hardware stack, such as the
   x86), implementing generalized tail call optimization (including
   mutual tail recursion) presents an issue: if the size of the
   callee's activation record is different from that of the caller,
   then additional cleanup or resizing of the stack frame may be
   required. For these cases, optimizing tail recursion remains
   trivial, but general tail call optimization may be harder to
   implement efficiently.". "As a result, functional languages such as
   Scala that target the JVM can efficiently implement direct tail
   recursion, but not mutual tail recursion.". If Scala can't do it,
   maybe it's fine if we can't either?

   http://web.eecs.umich.edu/~mahlke/courses/483f06/lectures/483L17.pdf

   I think I'll start with a very simplified version of Monomorphic,

D brittany.yaml => brittany.yaml +0 -20
@@ 1,20 0,0 @@
conf_version: 1
conf_layout:
  lconfig_reformatModulePreamble: false
  lconfig_altChooser:
    tag: AltChooserBoundedSearch
    contents: 5
  lconfig_allowSingleLineExportList: true
  lconfig_importColumn: 50
  lconfig_hangingTypeSignature: false
  lconfig_importAsColumn: 50
  lconfig_alignmentLimit: 0
  lconfig_allowHangingQuasiQuotes: true
  lconfig_indentListSpecial: true
  lconfig_indentAmount: 4
  lconfig_alignmentBreakOnMultiline: true
  lconfig_cols: 90
  lconfig_indentPolicy: IndentPolicyFree
  lconfig_indentWhereSpecial: true
  lconfig_columnAlignMode:
    tag: ColumnAlignModeDisabled

M src/Misc.hs => src/Misc.hs +2 -2
@@ 85,8 85,8 @@ splitOn sep = fromMaybe [] . Mega.parseMaybe splitOn'
  where
    splitOn' :: Parsec Void String [String]
    splitOn' = do
        as <- many (try (manyTill anySingle (try (string sep))))
        a <- many anySingle
        as <- Mega.many (try (manyTill anySingle (try (string sep))))
        a <- Mega.many anySingle
        pure $ (as ++) $ if not (null a) then [a] else []

parse' :: Parsec Void String a -> FilePath -> Source -> Either String a