I'm sorry but I think if you would like to implement a language not only use it, it would be better to learn lisp at first.
It is very easy to implement lisp on lisp and modify it as you like.
This is an scheme interpreter I wrote in scheme.
It's extremely short compared with other language.
There are many good textbooks, too.
http://www.scheme.com/tspl4/
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..
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.
Comments
I'm sorry but I think if you would like to implement a language not only use it, it would be better to learn lisp at first. It is very easy to implement lisp on lisp and modify it as you like. This is an scheme interpreter I wrote in scheme. It's extremely short compared with other language. There are many good textbooks, too. http://www.scheme.com/tspl4/
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.