agraef / pure-lang

Pure programming language
https://agraef.github.io/pure-lang/
315 stars 20 forks source link

Highlight advantages over other functional programming languages #9

Closed richsmith92 closed 7 years ago

richsmith92 commented 7 years ago

Having experience with Mathematica, I can completely understand why term rewriting rocks for computer algebra systems. But for mundane programming tasks, like JSON or CSV data processing, why would one choose Pure over e.g. Haskell, OCaml or Ruby/Python/JavaScript? I think if you clearly explain somewhere in README why programming in Pure can be more fun than in most other languages due to term rewriting, with examples, you'll get a lot more interest in your project.

I didn't check all of the examples you have. Maybe you can point to ones where term rewriting allows for the most expressive code?

agraef commented 7 years ago

Well, I already discuss this, to some extent, on the homepage (check the Examples section), in the Pure Quick Reference (specifically, check Section 8.10) and on the Rewriting wiki page, and some more symbolic evaluation examples are listed on the Examples wiki page, so I'm not sure what more I could do.

In particular, the units.pure example is one of the less esoteric examples where term rewriting is actually being used, and most programmers can probably relate to this.

The average user with the mundane kind of programming tasks that you mention will probably benefit more from Pure as a dynamically typed, JIT-compiled alternative to the likes of ML and Haskell, which makes it easier to get into functional programming if they're using Python or Ruby right now but may be curious about FP.

Maybe it would be a good idea to take this discussion to the mailing list where other users may chime in. I'm not sure what to do about this ticket, so I'm closing it for now. But feel free to reopen it if you have examples which should be added to the docs and/or the sources.

richsmith92 commented 7 years ago

Thanks for the answer! I didn't notice you have a mailing list, I'll probably use it next time.

Regarding rewriting, pattern matching in Haskell feels very second-class, so next time I encounter its limitations, I'll try to implement the same logic in Pure. This should be a good show case for me at least.

agraef commented 7 years ago

Regarding rewriting, pattern matching in Haskell feels very second-class

Exactly. In particular, Haskell hasn't anything like Pure's reduce or Mathematica's ReplaceAll.