Skip to content

Instantly share code, notes, and snippets.

A Free Browser For All

Today's Web is in a state of disarray. We are constantly being bombarded by advertisements (possibly malicious!), trackers, malware scripts, and bloated JavaScript-heavy websites which put too much effort into being complicated.

We want a browser liberated from these plagues: a browser that is built from the ground up for privacy, liberty and security. We want a browser that does not bow down to the status quo and accept "You shalt be tracked."

A browser that does not exist for spending 1% of your battery life on fetching, parsing, compiling and running JavaScript just to display the basic layout of a page.

We want a liberated browser, for humans to use in order to safely and efficiently communicate with the wasteland that the Web is today.

@darkf
darkf / bf.ml
Created May 30, 2013 11:29
Brainfuck interpreter in OCaml
let eval str =
let cells = Array.make 4096 0 in
let ptr = ref 0 in
let len = String.length str in
let rec evalbf c =
if c >= len then
c
else
match String.get str c with
@darkf
darkf / lc.hs
Created March 5, 2014 01:58
Simply typed lambda calculus interpreter in Haskell
import Data.Maybe (fromJust)
data Type = IntTy
| ArrowTy Type Type
deriving (Show, Eq)
data Term = Const Int
| Var String
| Abs String Type Term
| App Term Term
type Weight = Float
type Bias = Float
-- type Neuron = Bias -> [Weight] -> [Float] -> Float
-- Artificial neuron, given some activation function f.
-- A neuron is simply a function from a vector of weights, and a vector of values, to an activation value.
neuron :: (Float -> Float) -> Bias -> [Weight] -> [Float] -> Float
--neuron :: (Float -> Float) -> Neuron
neuron f b ws xs = f (sum (zipWith (*) ws xs) + b)
type Weight = Float
type Threshold = Float
perceptron :: [Weight] -> Threshold -> [Float] -> Bool
perceptron ws t xs = sum (zipWith (*) ws xs) >= t
-- OR gate
or_p = perceptron [1, 1] 1
-- AND gate
interface Point2D {
x: number;
y: number;
}
interface Point3D extends Point2D {
z: number;
}
function f(pt: Point2D) {}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
import Data.List
import Data.Ord (comparing)
import Control.Applicative ((<|>))
import Criterion.Main
import GHC.Generics (Generic)
import Control.DeepSeq
@darkf
darkf / sdl_test.nim
Last active December 31, 2015 05:18
SDL test in Nimrod
import math
import sdl
const
WIDTH = 1024
HEIGHT = 768
TIMESTEP = 1000 div 30 # 30 fps
THING_WIDTH = 32
@darkf
darkf / interp_pattern.hs
Created October 18, 2013 10:15
Interpreter for a simple dynamically typed pattern matching language
-- Interpreter for a simple dynamically typed pattern matching language
-- Copyright (c) 2013 darkf
-- Written on 10/18/2013
import Control.Monad.State (State, runState, evalState, get, put)
import qualified Data.Map as M
data AST = Add AST AST
| Def String AST
| Var String
@darkf
darkf / interp.hs
Last active December 25, 2015 17:49
Barebones interpreter in Haskell showing `State s a`
import Control.Monad.State (State, runState, evalState, get, put)
import qualified Data.Map as M
data AST = Add AST AST
| Def String AST
| Var String
| StrConst String
| IntConst Int
deriving (Show, Eq)