Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
A statically typed functional language.
fib =
0 => 1
1 => 1
x => (+ (fib (- x 1)) (fib (- x 2)))
(map fib [0 1 2 3 4 5 6 7 8 9 10])
# [ 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 ]
Peach is inspired by JavaScript, Elm, Clojure and @bodil's BODOL, which I learned about from this awesome talk.
# assignment
x = 2 # 2
# equality
(== x 2) # true
# maths and stuff
(* x 2) # 4
# conditionals
if ((< x 10))
`little`
else if ((< x 20))
`medium`
else
`large`
# functions
double = (x => (* x 2))
(map x (x => (pow x 2))) # [2 4 8 16]
# currying
double-all = (map double)
(double-all [1 2 3 4]) # (2 4 6 8)
# pattern matching
(fn fib
0 => 1
1 => 1
x => (+ (fib x - 2) (fib x - 1))
)
(fn starts-with-one
[1|_] => true
_ => false
)
# tail call optimisation
# n: the accumulating factorial
# x: a decrementing iteration count
factorial =
(n, 1) => n
(n, x) => (factorial (* n x) (- x 1))
(factorial 1 32768) # Infinity, because JavaScript. Better than a stack overflow!
Coming soon:
And then:
One day:
Use Node 6+.
npm install
npm test
FAQs
A tiny functional language
The npm package peach-lang receives a total of 0 weekly downloads. As such, peach-lang popularity was classified as not popular.
We found that peach-lang demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.