Skip to content

Instantly share code, notes, and snippets.

View be5invis's full-sized avatar

Belleve be5invis

View GitHub Profile
@be5invis
be5invis / jlos.jl
Last active December 1, 2016 12:32
module jlos
import Base.getindex
import Base.colon
import Base.(-)
import Base.(<<)
export endl, @method, Message
function <<{T <: IO, X}(io::T, x::X)::T
CommandType Name Version Source
----------- ---- ------- ------
Alias Add-ProvisionedAppxPackage 3.0 Dism
Alias Apply-WindowsUnattend 3.0 Dism
Alias Disable-PhysicalDiskIndication 2.0.0.0 Storage
Alias Disable-StorageDiagnosticLog 2.0.0.0 Storage
Alias Enable-PhysicalDiskIndication 2.0.0.0 Storage
Alias
@be5invis
be5invis / idris_main.c
Created February 3, 2017 04:18
main.c compiled from main.idr
#include "math.h"
#include "idris_rts.h"
#include "idris_bitstring.h"
#include "idris_stdfgn.h"
void _idris_assert_95_unreachable(VM*, VAL*);
void _idris_call_95__95_IO(VM*, VAL*);
void _idris_io_95_bind(VM*, VAL*);
void _idris_io_95_pure(VM*, VAL*);
void _idris_Main_46_main(VM*, VAL*);
void _idris_mkForeignPrim(VM*, VAL*);
@be5invis
be5invis / sample.tt
Last active March 8, 2017 10:10
PROPOSAL -- TT syntax
-- 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
"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')`;
// 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.
@be5invis
be5invis / 00--Results.md
Last active September 13, 2023 20:32
Haskell-ish AltJS performance test results

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.

@be5invis
be5invis / glyf-cubic-boolean-extension.md
Last active May 3, 2018 08:19
glyf Cubic & Boolean Extension

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.

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.