Hacker News new | past | comments | ask | show | jobs | submit login
Playing with Wolfram Playing Cards (adereth.github.io)
184 points by Adrock on Nov 3, 2017 | hide | past | favorite | 39 comments



If the OP is here, I found the cup on their site. It lets me put it in my cart

http://store.wolfram.com/view/misc/index.str#heart-spikey-mu...


They put it back in the store after they saw my tweet :p


That's a lot of power. Use it wisely.


I'm always amazed by how expressive Mathematica is. Writing some of these expressions imperatively would be significantly more than one line.


I’ve been toying with an idea for a while. Mathematica/Wolfram is a surprisingly interesting language from a design p.o.v. — everything from the Lisp origins, syntax sugar, syntax highlighting and formatting, all the things mentioned in another comment etc.

I’ve been thinking about writing about some of these details and how other languages and editors could be inspired.

Anybody who thinks there might be interest?


Yep!


These are mostly just API calls with arguments, with some simple lambdas. You can implement that in any language.


I think the magic of Mathematica is the combination of (1) a huge collection of well-maintained CAS and math functions (2) great graphics and animation support (3) the notebook interface (which jupyter is catching up on fast) and (4) some of the best documentation in the industry.

Modifying the Mathematica code after its written, however, is very tricky.


Even if some of the components in Mathematica are not state-of-the-art, there's a huge synergy benefit from having everything together in one environment, using the same datatypes. I think that's the big benefit of Mathematica and Matlab. Python can match (or exceed) a lot of their capabilities but you spend all this time with package managers, converting data types, etc.


What is this time with package managers? Takes an hour one time to learn pip and virtualenv. Then its 1 pip command to install a package.


An hour? I'd say about five minutes.


What you said plus the accuracy and precision to which results are computed. They're effectively limited only by the amount memory you have and your patience. And even patience isn't required unless you're calculating pi to trillions of digits. It's really fast.


Mathematica is functional. So..you can but you can't. Expressiveness..its a virtue, and Mathematica offers it through being a pattern matched, lazy binding, functional language, with both lexical and block scope, with amazing operators built in for the basic data types.

Shameless plug: https://scrollto.com/the-generalized-mean-an-algorithmic-app...

The code could maybe be written in another language but the fact that Mathematica allows for unbound variables and has beautiful functional library calls like Fold, make it very elegant to write once and work with almost any arguments. Wolfram Cloud is free and Mathematica has a trial, if you did want to fool around.

Mathematica is written in C++, it would be nice to see Wolfram head in the direction of having it produce binaries. It could become a major language of general development if that ever became the case. But Wolfram has always been very "particular" with his goals. One can dream...


I love Mathematica too, so I bought the Home edition. I play in a lot, but at work and home I keep J open [1]. It has a shell and an IDE of sorts if you want it. Something like the geometric mean in your article is:

#%:/

define it as gm =: # %: /

# is tally or number of terms

%: is root

* multiply

/ apply over or map

gm 1 100

10

It also has plot libraries, graphics and is very fast for an interpreted language. Perfect for math and statistics. I do like the curated data available to Mathematica, and WL or Wolfram Language is able to be coded functionally, imperatively, or any way you might want.

  [1] jsoftware.com


The main point of the code was to create new means and show derivation of known means. It's easy to write a geometric mean in any language. Having the solve function in Mathematica makes it possible to do dynamically generated means that wouldn't be possible in languages without a strong CAS library.

Also, will J error out on gm a b ? or gm a 100? The beauty of Mathematica is that I can still get results results in algebraic form, when I leave variables unset.

In:= GeneralizedMean[{x, y, z, t}, (#*#2) &]

Out= (t x y z)^(1/4)


The article was great, and I get your point. I was not presenting J as comparable to Mathematica as CAS or WL vs. J, but only showing its expressiveness. You are correct in that it will error out with your examples without writing catch code. I too dream WL goes native. Until then, I will stick with other PLs. How do you like Clojure for mathematics?

I still use Maxima on my Android phone along with J. Wolfram Alpha is nice to have too on it!

Also my example was missing the * even though it was explained below. It should be: gm =: #%:*/


Thank you - I hope to eventually produce a paper about alternative continuous and discrete means/norms. Kolmogorov went 5/10 the way, I think I brought his line of questioning to its rightful conclusion. Theres a lot of research to still be done however - only certain forms have easy closed forms when taken on continuous spaces. You might enjoy Part 2: https://scrollto.com/means-of-infinite-sets-and-more/

I actually have never used J, have only minor experience with Clojure in a startup codebase I once worked on, and never heard of Maxima. You have invited me to explore J and Maxima and I thank you for that. So far, I have used solely Mathematica for mathematics. I've tried python with pandas and other libraries but the syntax always seemed obtuse for me. Python's C call interop is why its so library friendly - but the actual language makes these libraries seem bolted on, less integrated than preferable. There are so many languages to try: Haskell, Rust and Julia are on my bucket list. I've mostly conceded to just learning languages when I need to - for an open source codebase or new job. To me, coding is a means to an end of production of tools, apps, deliverables.. Curiosity can deliver one into an abyss of stasis - where one learns all the most amazing expressiveness tools and techniques but never builds anything with them. All a balance..right. Godspeed :-)


When I say Mathematica, I mean both the language and the functions they provide.


Then again, all code is 'just' a bunch of RAM instructions, which can be implemented in any (Turing-complete) language. That doesn't tell us anything about how elegant or expressive it is.


I'm surprised that they didn't choose a purely functional language for Mathematica.


Don't know why you are being downvoted. Mathematica is a pattern matching language. You set downvalues or upvalues usually. It does have functional syntax and functional methods but the base of it is pattern matching. That contributes to its rather poor performance and necessity to use Compile for C level perf. Most likely Wolfram was inspired by a couple other CAS being developed around the time he started developing Mathematica.


Those are really neat. I did say "of course" sarcastically out loud when I got to the King.


Yeah, I lost it at that one. I'm not sure if that's his doing or just an internal troll.


They should provide a QR code on each card that sends you to the Wolfram site with the expression being executed, that way when you are waiting your turn on Hold-em you can watch the animation from your phone

(it must have been a pain to hand type those expressions...great job!)


Price: £4 — great! Shipping: £12 — nope!


shipping to canada is an utterly inexplicable 47 dollars, apparently not including taxes and duty


Basically they ship the deck all by itself in a 747.


weird, same price to get to NZ! $5 for the cards, $47 for the shipping.... thx but I'll pass.


Indeed, of all the tech company swag I've seen and collected, from a pure nerdiness metric, I'd wager Wolfram's remains one of the coolest by far.


A CAS with beautiful graphing is a big feature that is required in most situations and their swag wants to sell that point .


The code for these is really short and elegant! Keep in mind when you want to make some graphics that aren't owned by the "king", the much more powerful (though some boilerplate is required) open source libraries like p5.js and three.js are capable of rendering these real-time in the browser!


Did you mean D3 instead of three.js?


How plausible are animated versions of these in real life? What's the thinnest we can make a display+processor combo that can be powered by, say, the heat from my hands?


I don't think you could practically power a display + processor combo with the heat from your hands. The best I can find on the power radiated by your hands is this article

https://www.smithsonianmag.com/innovation/this-flashlight-is...

That article says you can get about 5 milliwatts using a Peltier converter, so working backwards based on Peltier converters being ~10% efficient that's only 50 milliwatts radiated by your hands. Even with an ideal 100% efficient converter that turns 100% of that energy into electricity, combined with a 100% efficient step up converter to raise the voltage that's not a lot to work with, that's barely enough power to light a couple of blue LEDs, much less a display and a microcontroller capable of rendering 3D graphics.


What if it's just a display plus a wireless receiver? SMartphones have not shrunk much over the last decade but that's cause of the constant pursuit of more functionality. I'd be quite interested to see how minimal they could go. I'll bet on playing card-size active displays within 10 years.


It could certainly be done with lenticular printing (to some extent...)


This reminds me of pixel spirit: a tarot cards deck with beautiful pictures made from shaders.

https://github.com/patriciogonzalezvivo/PixelSpiritDeck/blob...


The seven of clubs actually vaguely frightened me. What an appetite.


Cool cards. What's not cool is $50 shipping on $5 cards. To Canada...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: