Skip to content

Instantly share code, notes, and snippets.

Belleve Invis be5invis

View GitHub Profile
View generate-iosevka-release-package-list.js
"use esnext";
const version = '3.0.0-alpha.2'
const shapes = {
'': ['Default', '', false, true],
slab: ['Slab', 'Slab', true, true],
curly: ['Curly', 'Curly', false, true],
'curly-slab': ['Curly Slab', 'Curly Slab', true, true],
ss01: ['Andale Mono Style', 'SS01'],
View ot-nga.md

OpenType “Neo Geometry Architecture”

Static coordinate data

  • nKnots : UInt16 – Number of control knots in this contour set.
  • flags : StaticCoordFlag ^ nKnots – Flag array.
  • xData, yData : Bytes – Compressed X and Y coordinate data, driven by flags.

StaticCoordFlag

View oa-ftl-demo.ts
// Algebra 1
interface ExprAlg1<E> {
lit(x: number): E;
add(a: E, b: E): E;
}
const Eval: ExprAlg1<number> = {
lit: x => x,
add: (a, b) => a + b
};
interface Expr1 extends Expr2 {
View asmb-table.md

Assembly Alternatives Table ASMB

Assembly Alternatives Table (ASMB) defines the mechanism for complex justification, including Kashida. The principle is to associate assembly alternative lists to current glyphs. An assembly alternative list will have multiple glyph assemblies, being a glyph list with optional stretchable parts.

The table follows the structure of GSUB and GPOS. Listing lookups only.

Lookup type 1: Simple glue application

  • subtableFormat: UInt16: Format identifier: format = 1
  • coverage: Offset16 Coverage: Offset to Coverage table, from beginning of this subtable.
View Breaking the 64K limit.md

Breaking the 64K limit

  • The next font format (OpenType 2?) should support > 64K glyphs in one font.
  • GID will be 32-bit.
  • A “subset” table would be present to support legacy APIs that expect GID being 16-bit. It is a bijection between 16-bit “Legacy GID” and 32-bit “Real GID”.
  • Legacy API implementations should reject “OT2” fonts if the subset table is absent – which means this font is designed exclusively for new API.
  • A STAT-like mechanism will be used to “break down” an “OT2” font into a family of legacy-API-aware fonts.
  • When processing in legacy software…
    • TTF component references – if still supported – will reference to Real GID rather than Legacy GID.
    • CMAPGSUB, COLR, SVG entries involving glyphs outside the down-level subset will be ignored.
@be5invis
be5invis / 00--Results.md
Last active Jun 6, 2020
Haskell-ish AltJS performance test results
View 00--Results.md

Candidates

  • JavaScript: Hand-written JavaScript.

  • Idris-codegen-es: Idris 1.0 with idris-codegen-es.

  • Idris (Official JS): Idris 1.0 with official JavaScript Codegen.

  • PureScript: Using Latest PureScript.

  • PureScript (Uncurried): Latest PureScript with Data.Function.Uncurry.

  • Idris (C): Idris 1.0 with C codegen on Windows x64.

  • C: Hand-written JavaScript, compiled with gcc 6.2.0, with Win64 settings and -O3.

View 04--tarai-idr-official.js
// The official JS backend uses setTimeout somehow
// The i$RUN has been modified
var i$bigInt = (function () {
// Copyright (c) 2005 Tom Wu
// All Rights Reserved.
// See "LICENSE" for details.
// Basic JavaScript BN library - subset useful for RSA encryption.
View typeyourcode.js
"use esnext";
const code = `extract : (a -> Bool) -> List a -> Maybe (a, List a)
extract _ [] = Nothing
extract p (x::xs) with (p x)
| True = Just (x, xs)
| False = do
(y, xs') <- extract p xs
pure (y, x::xs')`;
@be5invis
be5invis / sample.tt
Last active Mar 8, 2017
PROPOSAL -- TT syntax
View sample.tt
-- Totalscript syntax
Module -> Imports (Access? Declaration | Access Name | Access? OperatorDecl | Definition | Mutual)*
Access -> ("public" | "private") ("definition" | "function" | "lemma" | "theorem")?
Program -> (Declaration | Definition | Mutual)*
Imports -> Import*
Import -> "import" Name* "from" String
OperatorDecl -> "operator" Operator NumberLiteral ("left" | "right" | "none") "=" Access
You can’t perform that action at this time.