5 ms·
The Pure Programming Language
- nicechianti 3y ago[dead]
- elbear 3y agoA "Why Pure?" section would be useful. The symbolic manipulation part is something I haven't encountered in other mainstream languages (at the level of the language). It's equivalent to Python's SymPy, right?
- elpatokamo 3y agoThere is a section in GitHub, which is where most of the documentation seems to be anyway. This FAQ is linked directly from the website. https://github.com/agraef/pure-lang/wiki/FAQ#why-pure https://github.com/agraef/pure-lang/wiki/FAQ#why-pure
- lebean 3y agoGiving you a reason why would make it unpure. To be a pure language, one should use it solely for the pure pleasure of using it.
- elbear 3y agoFunny argument, not necessarily in a bad way. Still, something to entice the reader would be welcome.
- sterlind 3y agoYes, Pure is a term-rewriting system, similar to SymPy. Transformation rules define patterns to match in expressions, what bindings to capture from the match, and what to transform the matched pattern into. This is also how the XL language seemed to work. The major difference between a term-rewriting system and a general-purpose functional/declarative language is that you don't need to define everything. Expressions will be transformed until they can't anymore, and then they're left alone. So you can e.g. implement symbolic differentiation as a set of rules, and take the derivative of a symbolic expression, because the variables (or even entire functions!) just don't need to be defined. The king of all term-rewriting systems is (imo) Mathematica. It's extraordinarily powerful, capable of matching subtrees and variable arity expressions and it's perfect for doing card tricks with algebraic identities. Unfortunately proprietary. Sadly, term-rewriting languages are languishing. Even Pure is pretty dead.
- bloaf 3y agoIts a shame, because there is a lot of really cool stuff you can do when you're able to work with your code in algebraic terms. Just as one simple example: Suppose you have defined some expressions that describe how to read/write data from a database, and you have used them to define a workflow-expression that retrieves a bunch of data, does some math on it, and displays the result. In Mathematica, you can plug that whole workflow-expression into the "Simplify" function and it will potentially eliminate entire database calls if it realizes you've got stuff like "GetData[y]*(GetData[x]-GetData[x])" in your result that will always evaluate to 0. You can even do things like define a high "complexity" of your GetData functions to make the Simplify function look for an algebraic form that will minimize calls to the database, even if it has to make the algebra look uglier.
- elbear 3y agoWow, this sounds like something with a lot of potential. It also makes me think the book Algebra-Driven Design[1]. That coupled with what you're describing sounds like a powerful combination. [1]: https://reasonablypolymorphic.com/blog/algebra-driven-design/index.html https://reasonablypolymorphic.com/blog/algebra-driven-design...
- hcarvalhoalves 3y agoThis library bring these capabilities to Clojure: https://github.com/mentat-collective/emmy https://github.com/mentat-collective/emmy It's based on an older library for Scheme, by Sussman.
- jjtheblunt 3y agoMathematica user since 1988: i think it, in retrospect, might be great that it’s proprietary, in that it dampens its likelihood of trend-driven over commitment and resulting irrelevance.
- JadeNB 3y ago> Mathematica user since 1988: i think it, in retrospect, might be great that it’s proprietary, in that it dampens its likelihood of trend-driven over commitment and resulting irrelevance. I think that's not really true. It's not that Mathematica isn't trend-driven, just that it's responsive to trends more or less to the extent that Wolfram (company or person) is, rather than to the extent that the entire developer community is. Depending on how you use it, you may or may not like its embrace of new trends; while I've occasionally been glad it can do $CoolThing, I have also wondered sometimes why my Mathematica install needed to grow from, at some point in the single-digit versions where it was perfectly useful, a few hundred megabytes to now nearly 9 GB.
- nazgulsenpai 3y ago[flagged]
- justincredible 3y ago[dead]
- shayarma 3y agoi do like new programming languages. learning swift was fun at the time.
- zengid 3y agoLooks like a fast embeddable functional lang for doing math or dsp. Cool!
- dang 3y agoRelated: Pure: a modern functional programming language based on term rewriting - https://news.ycombinator.com/item?id=15782598 https://news.ycombinator.com/item?id=15782598 - Nov 2017 (34 comments) Pure is a modern-style functional programming language based on term rewriting. - https://news.ycombinator.com/item?id=3121221 https://news.ycombinator.com/item?id=3121221 - Oct 2011 (1 comment) Interview With Albert Gräf - Author of the Pure Programming Language - https://news.ycombinator.com/item?id=2332095 https://news.ycombinator.com/item?id=2332095 - March 2011 (6 comments) The Pure programming language - https://news.ycombinator.com/item?id=722580 https://news.ycombinator.com/item?id=722580 - July 2009 (12 comments)
- riku_iki 3y agois this syntax lisp inspired? looks unusual to me(which could be an issue in adaptation)..
- HKH2 3y agoIt looks like Haskell.
- unicas 3y agoPure employs the textual order which is often considered more intuitive and is also used in mainstream functional languages such as ML and Haskell. (The specificity order also has its advantages, however, and has actually been used with great success in languages such as Aardappel and Hope.) On the surface, Pure looks similar to modern-style functional languages of the Miranda, ML and Haskell variety, but under the hood it is a much more dynamic language, with macros and reflective capabilities more akin to Lisp. Pure’s algebraic programming style probably appeals most to mathematically inclined programmers, but its interactive programming environment and easy extensibility also make it usable as a (compiled) scripting language for various application areas, such as graphics, multimedia, scientific, system and web programming. cited <-: https://agraef.github.io/pure-lang/quickref/pure-quickref.pdf https://agraef.github.io/pure-lang/quickref/pure-quickref.pd...
- classified 3y agoI don't find the code particularly readable, and dynamic typing isn't something that holds a lot of attraction for me, so this one is rather meh, although I do find the LLVM backend interesting.