Skip to content

Instantly share code, notes, and snippets.

View goswinr's full-sized avatar

Goswin Rothenthal goswinr

View GitHub Profile
open BenchmarkDotNet.Attributes
open BenchmarkDotNet.Configs
open BenchmarkDotNet.Environments
open BenchmarkDotNet.Jobs
open BenchmarkDotNet.Running
[<MemoryDiagnoser(displayGenColumns=false)>]
[<HideColumns("Job", "Error", "StdDev", "Median", "RatioSD")>]
type Benchmarks () =
let x = Some 3
@matthewcrews
matthewcrews / Crews_Odin_Newsletter_Interview.md
Last active February 10, 2025 10:42
Odin Newsletter Interview

An interview with Crews, formerly known as Fast F#.

Q: What can you say about how you discovered Odin, and what appealed to you about it?

A: First off, it's an honor to be interviewed for the newsletter and thank you for inviting me! Scheduling and Planning Optimization have been my obsession since I can remember. There's actually a joke in my family that I've been doing it since before I was born. My mom was working on her PhD when she was pregnant with me and was taking classes on Operations Research, the science of planning and scheduling, so I've been exposed to this area of work since before I was born. For context, I don't see myself as a developer. Professionaly, I started life as a Chemical Engineer and then moved to Industrial Engineering when I saw that the main problems faced by companies are planning and scheduling. Learning to write code was just a by product of wanting to solve these problems. This means I am language agnostic. I really don't care what language people use.

I think you ne

@OnurGumus
OnurGumus / Dat.fs
Last active November 21, 2023 20:21
three.js fable
module rec Dat
open Browser.Types
open Fable.Core
open System
[<ImportAll("dat.gui")>]
let exports: IExports = jsNative
[<AllowNullLiteral>]
@mrange
mrange / 0_README.md
Last active June 3, 2024 08:06
Simple physics in F# and WPF

Simple physics in F# and WPF

This is an example on how to use WPF and F# to do some simple physics using Verlet Integration.

The program creates a system of particles and constraints. Particles have inertia and is affected by gravity but their motion is also contrained by the constraints.

I tried to annotate the source code to help guide a developer familiar with languages like C#. If you have suggestions for how to improve it please leave a comment below.

How to run

@Horusiath
Horusiath / RTree.fs
Last active October 26, 2022 13:55
RTree implementation for 2D spatial data
(*
An immutable R-Tree implementation in F#.
Based on: https://github.com/swimos/swim-rust/tree/main/swim_utilities/swim_rtree (licensed on Apache 2.0)
Author: Bartosz Sypytkowski <b.sypytkowski at gmail.com>
*)
namespace Demos.RTree
@mrange
mrange / README.md
Last active January 20, 2022 20:33
Parsers combinators with F#6

Parsers combinators with F#6 [<InlineIfLambda>]

Thanks to manofstick peer reviewing the blog post.

Full source code at github

For F# Advent 2021 I wrote a blog post exploring how F#6 [<InlineIfLambda>] can improve data pipeline performance.

I was thinking of other places where [<InlineIfLambda>] can help and decided to try to build a parser combinator library with [<InlineIfLambda>].

Fsharp goodies (Vol 1)

After the 'F# Compiler Community Session' I read the first 1K lines of SyntaxTree.fs. That's what I learned about the language.

  1. There is a byte string

    let a = "abc"B
    val a : byte [] = [|97uy; 98uy; 99uy|]
@isaacabraham
isaacabraham / 1-nav.html
Last active October 2, 2020 00:20 — forked from CallumVass/nav.fs
<aside class="relative bg-blue-700 lg:self-stretch lg:w-64 w-full shadow-xl flex flex-col">
<div class="p-6 flex justify-between">
<a href="..">
<img class="object-scale-down h-8 lg:h-32" src=".." alt=".. Logo"/>
</a>
<div class="block lg:hidden">
<button id="nav-toggle" class="flex items-center px-3 py-2 border rounded text-white border-white">
<svg class="fill-current h-3 w-3" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<title>Menu</title>
<path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"/>
@deviousasti
deviousasti / Rpc.fs
Last active August 23, 2022 15:04
Fast inter-process RPC using shared memory
open SharedMemory
open MBrace.FsPickler
module Rpc =
type RpcContext<'command, 'message> =
{ name: string; buffer: RpcBuffer; post: 'command -> Async<'message>} with
interface IDisposable with
member this.Dispose() = this.buffer.Dispose()
let createHost name (handler : 'command -> Async<'message>) =
@swlaschin
swlaschin / effective-fsharp.md
Last active October 20, 2024 12:47
Effective F#, tips and tricks

Architecture

  • Use Onion architecture

    • Dependencies go inwards. That is, the Core domain doesn't know about outside layers
  • Use pipeline model to implement workflows/use-cases/stories

    • Business logic makes decisions
    • IO does storage with minimal logic
    • Keep Business logic and IO separate
  • Keep IO at edges