Rob PIke did it again!

Rob PIke did it again!
How does he do it? Everything he make is cool as fuck

pkg.go.dev/robpike.io/ivy
> Ivy is an interpreter for an APL-like language. It is a plaything and a work in progress.
It's a calcultator with apl syntax without math symbol. Pretty fun to use, could became my everyday calculator
bignum with vectors and multidimensional arrays support

> Android app
play.google.com/store/apps/details?id=org.golang.ivy&hl=en&gl=US
> iOS
apps.apple.com/us/app/ivy-big-number-calculator/id1012116478

> Talks (old, but can be used as a language reference)

From the demo

# Operator precedence is unusual.
# Unary operators operate on everything to the right.
# Binary operators operate on the item immediately to the left, and everything to the right.
2*3+4 # Parsed as 2*(3+4), not the usual (2*3)+4.
2**2+3 # 2**5, not (2**2) + 3
(2**2)+3 # Use parentheses if you need to group differently.

# Inner product is written with a . between the operators.
# This gives dot product: multiply corresponding elements and add the result.
1 2 3 4 +.* 2 3 4 5

# More rolls of a die.
?10 rho 6
# Remember a set of rolls.
x = ?10 rho 6; x

install ivy

Attached: ivy.jpg (200x200, 8.83K)

Other urls found in this thread:

go-talks.appspot.com/github.com/robpike/ivy/talks/ivy.slide#1
youtube.com/watch?v=PXoG0WX0r_E
youtube.com/watch?v=ek1yjc9sSag
youtube.com/watch?v=ek1yjc9sSag&list=PLrwpzH1_9ufMLOB6BAdzO08Qx-9jHGfGg
twitter.com/SFWRedditGifs

forgot the links to the talks
go-talks.appspot.com/github.com/robpike/ivy/talks/ivy.slide#1
youtube.com/watch?v=PXoG0WX0r_E

>Rob Pike

Stopped reading right there.

>implying you know how to read

This is old news user.

I never said it was new
I know how to read commit date, I'm not

Attached: ivy.png (1092x685, 41.12K)

Here's a playlist with some small math problem solved using ivy

>First video
youtube.com/watch?v=ek1yjc9sSag

>Link to the playlist
youtube.com/watch?v=ek1yjc9sSag&list=PLrwpzH1_9ufMLOB6BAdzO08Qx-9jHGfGg

>Operator precedence is unusual.
>2*3+4 # Parsed as 2*(3+4), not the usual (2*3)+4.
>2**2+3 # 2**5, not (2**2) + 3
Why?

I think in that way it makes easier to write experssion. It should be an APL thing


#average of vector x
op avg x = (+/x)/rho x

It doesn't seem intuitive at all.

It is once you learn the language, it's not that hard

#define a vector with 1 2 3 4 5 as its elements
x = 1 2 3 4 5

#define a user operation called avg that takes a named parameter x
op avg x =

# +/ reduce the vector by summing all its elements
(+/x)
output: 15

# rho x return the size of the vector
rho x
output: 5


(+/x)/rho x
# / is the common division, so reading from left to right is " sum all x's elements and then divide by the size of x".

Bump

oh boy

Attached: robpike.png (768x768, 348.02K)

Redditors hate Rob Pike though

go back to r*ddit

I CAN'T WAIT UNTIL ROB PORTS IVY TO PLAN9 AND MAC OS!!!!

this wtf

yeah lets break basic laws of math lol what a great calculator

It's already there retard. Also there's a iOS and android port with limited functionality
> PLAN9
It's Plan 9, with a space

Programming is not math tho.
List does that too and with this alternative associativity you tend to use less parentheses and reason in forms like
subject op S*(expression) which is nicer once you get used to
It's not so hard to get to the new convention, just like you would do ti Polish or reverse-Polish notation

>laws of math
you're retarded and a mathlet

it looks pretty based
It's like a calculator on steroid with support for
> vectors,
> matrices
> complex numbers
> user defined operators
> file i/o
> bignum
> rational infinite precision (no 0.1 + 0.2 != 0.3 problem)
> high irrational precision (but not infinite)

It's technically a APL repl, but since it seems to focus only on numeric features it's more akin to an APL-syntax calculator

If you are doing data exploration and/or you can formalize your problem in vectors and matrices, then ivy could be the tool you are looking for

you can also save envs and load them to continue what you are doing

Attached: ivyra.png (351x167, 6.86K)

# seconds -> hours/day/minutes/seconds conversion
ivy> op date secs =
0 24 60 60 encode secs

ivy> date 120
0 0 2 0

ivy> date 122
0 0 2 2

It keeps getting better