Skip to content

Instantly share code, notes, and snippets.

View Art's full-sized avatar

Art Scott Art

View GitHub Profile
@cbalint13
cbalint13 / OpenLANE.md
Last active April 1, 2023 16:50
OpenLANE steps
@kripken
kripken / hello_world.c
Last active January 17, 2024 12:15
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}
@cure53
cure53 / wasm.md
Last active October 17, 2023 00:16
Calling alert from WASM

Calling alert from WebAssembly (WASM)

This very simple and minimal tutorial documents in a few easy steps how to play with WebAssembly (WASM) and get first results within minutes.

While the code below is mostly useless, it will show, how to call the alert function from within a WASM file and thus demonstrate how to import and export DOM objects.

Of course, this exercise has no real use. It is just meant to show, that getting started with WASM isn't hard. And there is no need for a complex build-chain, tons of tools or a dedicated VMs. Just use a browser, one online tool and that's it.

And Now?

@jdh30
jdh30 / neighbors.cpp
Created March 28, 2016 23:46
C++ implementation of a HashSet benchmark from the F# Journal
#include "stdafx.h"
#include <iostream>
#include <unordered_set>
using namespace std;
typedef pair<int, int> P;
template <class T> struct MyHash;
template<> struct MyHash<P>
@jdh30
jdh30 / neighbors2.fs
Last active April 2, 2016 23:41
F# implementation of a HashSet benchmark from the F# Journal with unboxed tuples
type [<Struct>] P =
val i : int
val j : int
new(i, j) = {i=i; j=j}
let cmp =
{ new System.Collections.Generic.IEqualityComparer<P> with
member __.Equals(this, that) =
this.i = that.i && this.j = that.j
@jdh30
jdh30 / neighbors2.rs
Created March 28, 2016 22:37
Rust implementation of a HashSet benchmark from the F# Journal
use std::collections::HashSet;
use std::hash::BuildHasherDefault;
use std::default::Default;
use std::hash::Hasher;
pub struct FnvHasher(u64);
impl Default for FnvHasher {
#[inline]
@sudipto80
sudipto80 / CollaborativeFiltering.fs
Created January 21, 2016 08:56
Collaborative Filtering
// Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help.
//Comprehensive coverage of Collaborative Filtering Techniques
//http://www.hindawi.com/journals/aai/2009/421425/
module confusion =
let TP (matches : int [] []) =
matches |> Array.mapi( fun i j -> matches.[i].[i]) |> Array.sum
@owskio
owskio / Rule30.fs
Created September 29, 2015 22:05
Elementary Cellular Automaton in F#
open System
open Microsoft.FSharp.Core
open System.Collections.Generic
let print = printfn "%A"
let (*) n str =
String.replicate n str
let wraps str padding =
@hodzanassredin
hodzanassredin / fun3d.fsx
Last active August 29, 2015 14:22
Tower of Hanoi
let countOfDisks = 10
let initialState = [for x in 1..countOfDisks do yield x], List.empty, List.empty
let bottDiskSize = 4.
let cylHeight = 4.0
let diskSize size = size * bottDiskSize / float(countOfDisks)
let diskHeight = cylHeight / float(countOfDisks)
let diskPosition pos = pos * diskHeight
let cyl =
@mavnn
mavnn / paket.dependencies
Last active August 29, 2015 14:08
stealing
source https://nuget.org/api/v2
nuget FSharp.Formatting
nuget NUnit
nuget NUnit.Runners
nuget Nuget.CommandLine
nuget FAKE
nuget SourceLink.Fake
github fsharp/FAKE modules/Octokit/Octokit.fsx