[erlang-questions] json to map

Garrett Smith g@REDACTED
Thu Aug 27 16:01:13 CEST 2015


On Thu, Aug 27, 2015 at 6:04 AM, Roelof Wobben <r.wobben@REDACTED> wrote:
> Thanks,
>
> Can this be a way to solve the challenge :
> http://www.evanmiller.org/write-a-template-compiler-for-erlang.html

I think the challenge is to take smaller steps here...

Either solve this challenge by finding a JSON parser and using it, or
redefine the challenge to "create a simple parser".

Parsing JSON is a challenge, but I think you should define an interim
challenge first - one that's less challenging.

Strictly speaking the challenge of parsing JSON in Erlang (and
therefore being able to generate other forms) is not that challenging
as there are like half a dozen decent libraries to do that already. It
can be a challenge to find them, compile and use them - but not that
challenging. So why not just do that and cross this challenge off your
list?

Then, create a new challenge, which is to parse some simply expression
like "1 + 1" into a term in Erlang. You can then do something
interesting with that term! See hint [1]

This is a good challenge IMO because you'll learn a lot about Erlang
(your goal) and you'll also experience the empowerment of building
your own language, even if a very simple one.

What I'm really trying to say is that it's challenging to define the
right challenge. Richard said it best:

> The first thing to do with these exercises is CRITICISE them.

But don't criticize mine :)

[1] https://gist.github.com/cooldaemon/13773/6133f606a809dbd05683f290afaac21fbe7e2ce4



More information about the erlang-questions mailing list