Skip to content

Instantly share code, notes, and snippets.

View actsasbuffoon's full-sized avatar

Michael Tomer actsasbuffoon

  • Maestro
  • Boston, MA
View GitHub Profile
@actsasbuffoon
actsasbuffoon / lang.hs
Last active August 29, 2015 14:12
The beginnings of a simple imperative language in Haskell
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -Wall #-}
module Main where
-- This is a simple dynamically typed imperative language with mutable state. It's somewhat similar to JavaScript, but
-- it differs in many ways. There are a few notable oddities to the language that I'm still working out. For instance,
-- we don't have reference types. In most languages you would write something like this:
--
-- foo = new Person("Mike")
swagger: "2.0"
info:
description: Simple example
version: "1.0.0"
title: Example
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
host: 127.0.0.1:8080
schemes:
@actsasbuffoon
actsasbuffoon / simple_neural_net.rb
Last active May 4, 2016 16:19
A simple neural network example.
class Neuron
attr_accessor :inputs, :threshold, :weights
def initialize(threshold, weights)
@threshold = threshold
@weights = weights
@inputs = []
end
def output