Skip to content

Instantly share code, notes, and snippets.

View jaredpar's full-sized avatar

Jared Parsons jaredpar

View GitHub Profile
@jaredpar
jaredpar / hello-world-merkle-tree.json
Last active June 18, 2021 14:54
A merkle hash for c# hello world
{
"options": {
"outputKind": "ConsoleApplication",
"scriptClassName": "Script",
"publicSign": false,
"checkOverflow": false,
"platform": "AnyCpu",
"optimizationLevel": "Release",
"generalDiagnosticOption": "Default",
"warningLevel": 9999,
{
"options": {
"outputKind": "ConsoleApplication",
"scriptClassName": "Script",
"cryptoPublicKey": "",
"publicSign": false,
"checkOverflow": false,
"platform": "AnyCpu",
"optimizationLevel": "Release",
"generalDiagnosticOption": "Default",
using System;
using System.Reflection;
internal static class Extensions
{
/// <summary>
/// Reset the internal RuntimeBinder instance to free the symbol table, etc.
/// Uses reflection to execute:
/// <code>
/// var binder = RuntimeBinder.GetInstance();
/// lock (binder.m_bindLock)
baseservices.mono Work Item 1
baseservices\\exceptions\\stackoverflow\\stackoverflowtester\\stackoverflowtester.cmd 1
JIT.CodeGenBringUpTests Work Item 2
JIT.Directed Work Item 2
JIT.Generics Work Item 1
JIT.jit64.hfa Work Item 2
JIT.jit64.valuetypes Work Item 2
JIT.Math Work Item 1
JIT.Methodical.a-dA-D Work Item 1
JIT.Methodical.eh Work Item 2

The key items we need to accomplish is

  1. Find the builder type
  2. Pass user arguments (Span, culture, etc ...) to builder ctor
  3. Pass compiler arguments (hole count, fixed length) to the builder ctor
  4. Allow for non-string results
  5. Binary compatibility: let existing code evolve without breaking existing callers.

Consider if we allowed developers to define methods like the following

Bootstrap.props
```xml
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<Project>
<PropertyGroup>
<_BootstrapBuildDir>$([MSBuild]::EnsureTrailingSlash($(BootstrapBuildPath)))</_BootstrapBuildDir>
</PropertyGroup>
<Import Project="$(_BootstrapBuildDir)build\Microsoft.Net.Compilers.Toolset.props" />
2021-03-04T20:05:19.3280965Z CompilersBoundTreeGenerator -> D:\workspace\_work\1\s\artifacts\bin\CompilersBoundTreeGenerator\x64\Release\netcoreapp3.1\BoundTreeGenerator.dll
2021-03-04T20:05:19.3282387Z CSharpErrorFactsGenerator -> D:\workspace\_work\1\s\artifacts\bin\CSharpErrorFactsGenerator\x64\Release\netcoreapp3.1\CSharpErrorFactsGenerator.dll
2021-03-04T20:05:19.3283465Z CSharpSyntaxGenerator -> D:\workspace\_work\1\s\artifacts\bin\CSharpSyntaxGenerator\Release\netcoreapp3.1\CSharpSyntaxGenerator.dll
2021-03-04T20:05:19.3284537Z Microsoft.CodeAnalysis -> D:\workspace\_work\1\s\artifacts\bin\Microsoft.CodeAnalysis\Release\netcoreapp3.1\Microsoft.CodeAnalysis.dll
2021-03-04T20:05:19.3285547Z Microsoft.CodeAnalysis -> D:\workspace\_work\1\s\artifacts\bin\Microsoft.CodeAnalysis\Release\netstandard2.0\Microsoft.CodeAnalysis.dll
2021-03-04T20:05:19.3286673Z CSharpSyntaxGenerator -> D:\workspace\_work\1\s\artifacts\bin\CSharpSyntaxGenerator\Release\netstandard2.0\CSharpSyntaxGenerator.dll
2021-03
VSIXExpInstaller.exe did not contain compilation options in its PDB
Summary
Successful rebuilds
c:\users\jaredpar\code\roslyn2\artifacts\obj\AnalyzerRunner\Release\net5.0\AnalyzerRunner.dll
c:\users\jaredpar\code\roslyn2\artifacts\obj\AnalyzerRunner\Release\net472\AnalyzerRunner.exe
c:\users\jaredpar\code\roslyn2\artifacts\obj\BuildBoss\Release\net472\BuildBoss.exe
c:\users\jaredpar\code\roslyn2\artifacts\obj\CodeStyleConfigFileGenerator\Release\netcoreapp3.1\CodeStyleConfigFileGenerator.dll
c:\users\jaredpar\code\roslyn2\artifacts\obj\csc\Release\netcoreapp3.1\csc.dll
c:\users\jaredpar\code\roslyn2\artifacts\obj\csc\Release\net472\csc.exe
c:\users\jaredpar\code\roslyn2\artifacts\obj\CSharpSyntaxGenerator\Release\netcoreapp3.1\CSharpSyntaxGenerator.dll
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
int total = 0;
var map = new Dictionary<string, int>();
@jaredpar
jaredpar / evil.il
Created February 9, 2021 18:39
Defines a type C such that && doesn't work the way you expect
// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Copyright (c) Microsoft Corporation. All rights reserved.
// Metadata version: v4.0.30319
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..