Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDM 話& .NET Conf: Focus on Windows 周りとか #28

Closed
1 of 3 tasks
ufcpp opened this issue Mar 2, 2021 · 22 comments
Closed
1 of 3 tasks

LDM 話& .NET Conf: Focus on Windows 周りとか #28

ufcpp opened this issue Mar 2, 2021 · 22 comments

Comments

@ufcpp
Copy link
Collaborator

ufcpp commented Mar 2, 2021

配信枠: https://youtu.be/99ek2n6F_1U

Visual Studio 16.9 Release と 16.10 Preview 1が来ちゃったんでそっち優先するかも。
Ignite に合わせてのリリース?

https://focus.dotnetconf.net/ とかもちょっと触れつつ。

Blazor Desktop の話ちょっとかずきさんに丸投げ気味に

あと、 #27 に書いたリスト、多分1回では終わらないので終わるところまでやる。
とりあえず3件はブログ書いたのでそれ優先

@ufcpp-live
Copy link
Owner

using System;

int x;
var (x1, y1)
    = (x, var y) // 式の途中はダメ!
    = (1, "abc");

Console.WriteLine(x);
Console.WriteLine(y);

@ufcpp-live
Copy link
Owner

raw string

// C# in C# in C# in ...
// lang=csharp
const string s1 = """"""
    // lang=csharp
    var first = """""
        // lang=csharp
        var second = """"
            // まあ、多分、1段以上の highlight はしないんじゃない?
            var third = """
                abc
                """;
            """";
        """"";
    """""";

var s = @"
""abc"" // このエスケープがいや
";

var csharp = $@"
class C
{{ // このエスケープがいや
}}
";

// $""" には断固反対

@ufcpp-live
Copy link
Owner

// *1 と *2 が等価
var a1 = """
    abc
""";

var a2 = @"abc
";

var b1 = """
    abc""";

var b2 = @"abc";

var c1 = """
    abc



    """;

var c2 = @"abc



";

var d1 = """
  abc
    def
      ghi
""";

var a2 = @"abc
  def
    ghi
";

@ufcpp-live
Copy link
Owner

// 調べる
var a1 = """"
abc""""""";
// ↑を abc""" 扱いすることは可能か?

@ufcpp-live
Copy link
Owner

// 1行目よりも小さいインデントはあり
var a1 = """
    abc
def
        ghi
""";

var a2 = @"abc
def
    ghi
";

@ufcpp-live
Copy link
Owner

string interpolation はアロケーションかかりすぎてやばい

なので、 https://github.com/dotnet/csharplang/pull/4486/files?short_path=77eda16#diff-77eda16068bf940c41c3c540d5a0f74c1bfee4b56388b0bc4e59e037abaa9ec7

ILogger logger;
logger.Log<(int, int, int)>(
    LogLevel.Information,
    default ,
    (1, 2, 3),
    null,
    (t, m) => $"{t.Item1} {t.Item2} {t.Item3}");

logger.LogInformation($"{1} {2} {3}"); // ログレベルによらずアロケーション

@ufcpp-live
Copy link
Owner

文字列処理を stack ベースにするのはむっちゃ大変。
特に await

// https://github.com/dotnet/csharplang/pull/4486
// string interpolation を ref struct + TryFormat に展開しようという話。
// ref struct だと…

// これ、OK
var s = $"{await Task.Run(() => 1)}";
// これ、どうすんだ?

async Task m()
{
    await Task.Yield();

    //Span<byte> s; // 書けない
    // 書けてもいいのに

    r(stackalloc byte[1]); // これはいける

    await Task.Yield();

    local(); // これは余裕

    await Task.Yield();

    static void local()
    {
        Span<byte> s = stackalloc byte[1];
    }
}

void r(Span<byte> s) { }

IEnumerator m1()
{
    yield return 0;

    Span<byte> s = stackalloc byte[1]; // 書ける!
    var x = s[0];

    yield return 0;
}

@ufcpp-live
Copy link
Owner

言語内言語?
あるよ、今のC#に、すでに。

image

@ufcpp-live
Copy link
Owner

進捗 1/3 でした
(raw string 話で終わり。途中、「improved interpolated strings spec」の話に行って、重たい話で時間食う。

@ufcpp-live
Copy link
Owner

締めの言葉

lang=csharp

@ufcpp-live
Copy link
Owner

ufcpp-live commented Mar 3, 2021

配信後気づいた話:

async Task m()
{
    r1(stackalloc byte[1], await Task.Run(() => 1)); // これダメ
    r2(await Task.Run(() => 1), stackalloc byte[1]); // こっち OK。評価順的に stackalloc が await をまたがない。
}

void r1(Span<byte> s, int x) { }
void r2(int x, Span<byte> s) { }

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

8:28~ Blazor Desktop/Hybrid の話は丸投げしていい?
(https://zenn.dev/okazuki/articles/mobile-blazor-bindings の話)

10:35~ 🍣
12:55~ バージョン合わせゲーム
18:55~ ネイティブとWebViewで同一インスタンス共有してる

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

31:15~ 「困ったら安定板を使おうかと思ってやってるけど、困ることがなくて」(リリースチャネルの Visual Studio 全然使ってない話)

39:43~ Record に色が付きました

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

45:58~ Remove Unused References
48:57~ 遷移的な参照(transitive reference)は誤判定されてそう?

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

51:56~ enum の補完が賢くなった

そもそも今、C# の文法的に m(Blue) のコンパイルが通るようにしたいという提案もあり。

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

59:10 改行周りのリファクタリング

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

1:03:30 (x, var y) = ... (変数と宣言の混在分解)
1:04:31~ #28 (comment) の話
1:05:24~ これは「Any Time」(コミュニティ貢献)

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

1:19:00~ Raw string
1:20:14~ 先頭のインデントは入らない

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

1:22:33~ 言語内言語の話
1:23:39~ lang=
1:30:21~ VirtualCharService
1:32:40~ これ自体が正規表現
#28 (comment) これとか

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

1:34:19~ 複数行リテラルとエスケープしないリテラルの話
1:37:04~ 「任意の個数」と言うのが意外と大事
自分自身を書くため: #28 (comment)

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

1:49:18~ 改行とか先頭空白の話 #28 (comment)

@ufcpp
Copy link
Collaborator Author

ufcpp commented Mar 23, 2021

1:59:11~ 行きつく先は「生 Append」
#28 (comment)

その後ブログちゃんと書いた: Improved Interpolated Strings

2:10:26~ (Improved Interpolated Strings の実装で) ref struct の地雷踏みそう #28 (comment)

@ufcpp ufcpp closed this as completed Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants