Live data from Hacker News

Mal – Make a Lisp

github.com

1–10 of 41 posts

Re: Mal – Make a Lisp

#3
One interesting thing about this project is the extensive use of Make. Not only is the test suite Make based, there is also a Mal implementation in Make

Re: Mal – Make a Lisp

#4
I attempted this a few years back, didn't get far before I got hung up on the regular expression(s) required for parsing. Silly to get stopped there, but there was just enough friction between the specified expression, the language I was using (Erlang), and my understanding of the subtleties that I punted.

I think with Regex101 in my back pocket I'll give it another try.

https://regex101.com

Re: Mal – Make a Lisp

#5
post #4

I attempted this a few years back, didn't get far before I got hung up on the regular expression(s) required for parsing. Silly to get stopped there, but there was just enough friction between the specified expression, the language I was using (Erlang), and my understanding of the subtleties that I punted. I think with Regex101 in my back pocket I'll give it another try. https://regex101.com

Regex to parse lisp expressions?

Re: Mal – Make a Lisp

#6
post #5
post #4

I attempted this a few years back, didn't get far before I got hung up on the regular expression(s) required for parsing. Silly to get stopped there, but there was just enough friction between the specified expression, the language I was using (Erlang), and my understanding of the subtleties that I punted. I think with Regex101 in my back pocket I'll give it another try. https://regex101.com

Regex to parse lisp expressions?

Regexes are at least useful for parsing numbers and symbols.

But yeah, that shouldn't be where you get stuck.

Re: Mal – Make a Lisp

#7
post #4

I attempted this a few years back, didn't get far before I got hung up on the regular expression(s) required for parsing. Silly to get stopped there, but there was just enough friction between the specified expression, the language I was using (Erlang), and my understanding of the subtleties that I punted. I think with Regex101 in my back pocket I'll give it another try. https://regex101.com

If you are using erlang you should be using pattern matching not regex. Erlang/Elixir are one of the easiest languages to build parsers in with their binary string pattern matching.

Re: Mal – Make a Lisp

#8
post #4

I attempted this a few years back, didn't get far before I got hung up on the regular expression(s) required for parsing. Silly to get stopped there, but there was just enough friction between the specified expression, the language I was using (Erlang), and my understanding of the subtleties that I punted. I think with Regex101 in my back pocket I'll give it another try. https://regex101.com

I also could not get the regex to work, so I ended up writing a custom tokenizer. It ended up being like 30 lines of code, and unlike the regex I could understand how it works

Re: Mal – Make a Lisp

#9
post #5

Earlier quoted context omitted.

Regex to parse lisp expressions?

Regexes are at least useful for parsing numbers and symbols. But yeah, that shouldn't be where you get stuck.

[\s,](~@|[\[\]{}()'`~^@]|"(?:\\.|[^\\"])"?|;.|[^\s\[\]{}('"`,;)])

Step 0, so I didn't get very far.

https://github.com/kanaka/mal/blob/master/process/guide.md#s...

Re: Mal – Make a Lisp

#10
post #4

I attempted this a few years back, didn't get far before I got hung up on the regular expression(s) required for parsing. Silly to get stopped there, but there was just enough friction between the specified expression, the language I was using (Erlang), and my understanding of the subtleties that I punted. I think with Regex101 in my back pocket I'll give it another try. https://regex101.com

If you are using erlang you should be using pattern matching not regex. Erlang/Elixir are one of the easiest languages to build parsers in with their binary string pattern matching.

I agree, pattern matching is what I sorely miss every time I use anything other than Erlang. It's just enough of a hurdle I set it aside and didn't return.

It's a big step.

https://github.com/kanaka/mal/blob/master/process/guide.md#s...

Post reply on HN