jimf / uparse

Tiny parser combinator library
MIT License
2 stars 0 forks source link

Thank you for uparse #1

Open simplygreatwork opened 5 years ago

simplygreatwork commented 5 years ago

Hi Jim,

Thank you for publishing this tiny library. It's a great starting point for me to grok how parser combinators work very simply. I love the transformations. I have dabbled with the libs: arcsecond and mona so far but they can be difficult to debug or maybe not quite fast enough.

Cheers, Philip Weaver

jimf commented 5 years ago

You're welcome! I'm so glad this project was helpful for you. Parser combinators are fun. Here are a few links I've bookmarked over the years if you're interested. They're in no particular order, though the first one is/was my direct inspiration for this library.

simplygreatwork commented 5 years ago

As a side project, I've been getting up and running with Web Assembly. I've used your library uparse to parse s-expressions. I made some small local tweaks for custom formatters and for reporting parse error offsets.

I'd love to see something like Mozilla's Sweet.js for Web Assembly so that's a goal of a mine: a modular programming language syntax. Aside: I also really like the io language. (golang port). I don't think that a Web Assembly build exists for io yet. I saw that you have lots of cool repos. Kringle also looks really interesting and inspiring.

Philip

jimf commented 5 years ago

Very cool, thanks for sharing. I'll admit that, looking back, the shape of the parse results, as well as lack of error reporting, are two parts of this library that I'd like to improve. If you haven't looked at Parsimmon at all, it's worth a glance. It's a much more fleshed out parser combinator solution. Here are 2 gists of a math expression parser for comparison, the first in uparse, and the second in parsimmon.

I'm very excited about WASM, though admittedly I've been holding off on doing too much with it in terms of a compilation target until the garbage collection story is fully figured out. Writing web stuff in Rust is fun though 😄. I haven't seen io before. Thanks for the link! I really love implementing programming languages as a hobby. Most of them are in half states, so I haven't published most to GitHub, but they follow a very similar pattern, such as the one that I used in Kringle. In fact, I've done enough at this point that I made a little personal generator for quickly stubbing out the lexer/parser for whatever language I want to work on. I haven't gotten around to publishing that either, but I could if you're interested.

Lastly, on the topic of implementing little languages, there was a cool talk at this year's React Rally you might enjoy:

simplygreatwork commented 5 years ago

Hi Jim, I'd like to chat with you about some topics. In particular, I am dabbling with memory compaction with WebAssembly. Do you mind sending me an email to chat? philmaker@gmail.com or simplygreatwork@gmail.com. Alternatively, I suppose I could start a new discussion thread up here for memory compaction: https://github.com/simplygreatwork/sweet-webassembly/issues