elm-in-elm / compiler

Elm compiler written in Elm

Home Page:https://elm-in-elm.github.io/compiler/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reuse code from decgen

janwirth opened this issue · comments

This module here parses pretty much all types already. Why not re-use the code?

https://github.com/dkodaj/decgen

@FranzSkuffka Thanks for the link!

Seems the project uses String.split and Regex instead of parsers. I think we're pretty invested in elm/parser at this point.

Also maybe I just don't get what we should reuse from here. Can you elaborate a bit more, and/or point to specific files / regions?

I just think that reusing code would allow this project to make a big step regardless of the parsing technique used. I also do not think it would really harm to use a different parsing technique.

What are your concerns? Unfortunately I can not point to specific files but the repo is pretty small..

Well, what I mean is - what part of the code did you mean to reuse, or use it for. Parsing custom types like

type Foo
  = Bar String
  | Baz Int Bool
  | Quux

? Or records? etc. (That seems to all be in the Destructuring.elm file)

With the goal of this repo for the code to be idiomatic, "best practices" etc. I'm not sold on mixing parsing techniques (Parser vs String/Regex), sorry 🙁

I see lots of red here but maybe that's outdated.
image

Yeah that's current. There are a lots of red still. But again, reusing codebase that does things via String.split / Regex is most likely a no-go for me. We can draw inspiration for sure! But I won't copy-paste and adapt it.

I've had similar dilemma with stil4m/elm-syntax which uses elm/parser but builds its own 0.18-parser-combinators-like abstraction (IIRC) underneath so that it can use 0.18 code. If I used it I'd have all the parsers green almost without any work! But I don't want to do it since I want this codebase to have elm/parser idiomatic parsers.

So I'm sorry but I'll close this issue. I hope you understand my standpoint.

Okey, really respect appreciate the approach you are taking to this. Very cool project. Loved seeing you in paris.