Skip to content

About Syntactic Sugar #9510

Answered by bbarry
gchling asked this question in General
Jul 3, 2025 · 10 comments · 15 replies
Discussion options

You must be logged in to vote

I'm pretty sure if you want you can write CIL if you create a project that uses Microsoft.NET.Sdk.IL

.class private auto ansi beforefieldinit Program
    extends [System.Runtime]System.Object
{
    .method private hidebysig static 
        void '<Main>$' (
            string[] args
        ) cil managed 
    {
        .maxstack 8
        .entrypoint

        ldstr "Hello World"
        call void [System.Console]System.Console::WriteLine(string)
        nop
        ret
    }
}

That is about as close as you can get to no syntax sugar while still writing text based code in .NET.

Replies: 10 comments 15 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@huoyaoyuan
Comment options

@jnm2
Comment options

jnm2 Jul 5, 2025
Collaborator

@huoyaoyuan
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@HaloFour
Comment options

@bbarry
Comment options

Answer selected by CyrusNajmabadi
Comment options

You must be logged in to vote
4 replies
@CyrusNajmabadi
Comment options

@CyrusNajmabadi
Comment options

@CyrusNajmabadi
Comment options

@CyrusNajmabadi
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@gchling
Comment options

@CyrusNajmabadi
Comment options

@HaloFour
Comment options

@gchling
Comment options

@CyrusNajmabadi
Comment options

This comment was marked as disruptive content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
10 participants