Skip to content

Instantly share code, notes, and snippets.

@jl0pd
jl0pd / DSL.fs
Last active July 21, 2022 12:52
Sample DSL for UI
type Color(r, g, b) = class end
module DSL =
type IView = interface end
type ViewBase() = interface IView
type VStackView(items: IView[]) = inherit ViewBase()
type ButtonView() = inherit ViewBase()
type ViewBase with
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<WarningsAsErrorsRange>
$(WarningsAsErrorsRange);
@jl0pd
jl0pd / Program.cs
Created April 6, 2021 05:02
C# Unsafe and semi-safe sum
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace SumTest
{
class Program