---------- Forwarded message ----------
From: Mark S. Miller <erights@google.com>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: javascript-standard@google.com
---------- Forwarded message ----------
From: Mark S. Miller <erights@google.com>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: javascript-standard@google.com
function jacobi(a, n) { | |
if (n <= 0n) throw new Error('n must be positive integer'); | |
if (n % 2n === 0n) throw new Error('n must be odd'); | |
a %= n; | |
let result = 1; | |
while (a !== 0n) { | |
while (a % 2n === 0n) { | |
a /= 2n; | |
let n_mod_8 = n % 8n; | |
if (n_mod_8 === 3n || n_mod_8 === 5n) { |
multiplyAndAddUnsafe(Q: ProjectivePoint, a: bigint, b: bigint): ProjectivePoint | undefined { | |
// R=R*2+P //bits from a,b = 1,0 | |
// R=R*2 //bits from a,b = 0,0 | |
// R=R*2+Q //bits from a,b = 0,1 | |
// R=R*2+P+Q //bits from a,b = 1,1 | |
const G: ProjectivePoint = this; | |
const spl = (a: bigint) => a.toString(2).padStart(max, '0').split('').map(i => Number(i)); | |
const max = Math.max(ut.bitLen(a), ut.bitLen(b)); | |
const aBits = spl(a); | |
const bBits = spl(b); |
# Algorithm W (Damas-Hindley-Milner) in LiveScript. | |
# By Paul Miller (paulmillr.com), Public domain. | |
# | |
# Based on Robert Smallshire's [Python code](http://bit.ly/bbVmmX). | |
# Which is based on Andrew's [Scala code](http://bit.ly/aztXwD). | |
# Which is based on Nikita Borisov's [Perl code](http://bit.ly/myq3uA). | |
# Which is based on Luca Cardelli's [Modula-2 code](http://bit.ly/Hjpvb). | |
# Something like that. | |
prelude = require './prelude' |
const rotlHs = (h: string, l: string, s: number) => | |
s > 32 ? `(${l} << ${s - 32}) | (${h} >>> ${64 - s})` : `(${h} << ${s}) | (${l} >>> ${32 - s})`; | |
const rotlLs = (h: string, l: string, s: number) => | |
s > 32 ? `(${h} << ${s - 32}) | (${l} >>> ${64 - s})` : `(${l} << ${s}) | (${h} >>> ${32 - s})`; | |
export const keccakP = (() => { | |
let out = 'let h, l, s = state;\n'; | |
const vars = []; | |
for (let i = 0; i < 200 / 4; i++) vars.push(`s${i} = s[${i}]`); | |
out += `let ${vars.join(', ')};\n`; |
Proving ownership of | |
- paulmillr.com/pgp_proof.txt via paulmillr.com/pgp_proof.txt.asc | |
- twitter.com/paulmillr | |
- github.com/paulmillr via gist.github.com/paulmillr/cb3ad3b9cd4ac849eb1def3634f93421 | |
- Active key: Paul Miller (PGP 697079DA6878B89B) from 3 Jul 2022 | |
- Revoked key: Paul Miller (PGP 46BEEF337A641ABB) was active from 15 Apr 2020 to 2 Jul 2022 | |
Full pubkey: |
.border-radius (@radius) { | |
-webkit-border-radius: @radius; | |
-o-border-radius: @radius; | |
-moz-border-radius: @radius; | |
-ms-border-radius: @radius; | |
border-radius: @radius; | |
} | |
.user-list { | |
// need to use special `.` syntax |
data Cargo = Peasant | |
| Cabbage | |
| Wolf | |
| Goat | |
deriving (Eq, Enum, Show) | |
type ShoreState = [Cargo] | |
type Move = [Cargo] | |
type State = (ShoreState, ShoreState) |
Add to .gitignore
:
node_modules
public
Add to your app dependencies
of package.json
:
# Ruby’s “method missing” analog with ES6 proxies. | |
proxify = (object) -> | |
new Proxy object, get: (receiver, name) -> | |
object[name] ? object.methodMissing.bind object, name | |
object = proxify | |
a: 1, | |
b: 15, | |
c: -> | |
'called' |