Skip to content

Comment on Egison – Pattern-matching-oriented Programming Languageparent

Comments

I understand that a lispy language make some stuff about building a language easier, but still is very common to use a imperative one to build them, and in imperatives I'm skilled...

So the question are really 2, to make them more clear:

1- What are the baby steps to make pattern matching?

I could follow a functional language if the explanation is clear, but if the code requiere skills in them I could get lost. So, I ask if exist this kind of resource, if possible. If not, then anything else is ok and them I know I need to devote some time in learn other kind of skills.

2- Is pattern matching more problematic if the language is not functional, inmutable? If is a mix (like with swift), what is the sweet spot (if exist?) or what is needed to make it work easily/better?. So for example, lets imagine that if the language is not statically typed it become harder to implement..

I wrote my answer.

1- I'm sorry but I don't know materials for the baby steps to implement pattern matching. However, I think it is not so difficult to compile ordinary pattern matching expression into many nested if expressions, if you have a small language you can manage completely.

2- I think difficulty to implement a pattern matching mechanism is not different for each language. I think writing a parser may be the hardest work.

By the way, I forgot to paste URL for my interpreter I wrote in the past. https://github.com/egisatoshi/scheme-meta-interpreter/blob/m... Lisp is easy to write a parser, and it's because I recommended lisp.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.