{"id":17288244,"url":"https://github.com/yallie/runsharp","last_synced_at":"2025-04-14T11:10:26.906Z","repository":{"id":28319563,"uuid":"31832494","full_name":"yallie/RunSharp","owner":"yallie","description":"Syntactic sugar improvements for the RunSharp library","archived":false,"fork":false,"pushed_at":"2015-03-09T01:06:38.000Z","size":616,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T00:22:41.386Z","etag":null,"topics":["c-sharp","code-generation","code-generator","executable","reflection","runsharp"],"latest_commit_sha":null,"homepage":"https://code.google.com/r/postjazz-runsharp","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yallie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-08T00:02:43.000Z","updated_at":"2023-07-09T08:49:35.000Z","dependencies_parsed_at":"2022-08-17T17:15:18.246Z","dependency_job_id":null,"html_url":"https://github.com/yallie/RunSharp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yallie%2FRunSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yallie%2FRunSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yallie%2FRunSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yallie%2FRunSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yallie","download_url":"https://codeload.github.com/yallie/RunSharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868766,"owners_count":21174758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","code-generation","code-generator","executable","reflection","runsharp"],"created_at":"2024-10-15T10:26:34.002Z","updated_at":"2025-04-14T11:10:26.888Z","avatar_url":"https://github.com/yallie.png","language":"C#","readme":"﻿What's that\n===========\nSyntactic sugar improvements for the RunSharp library.\n[RunSharp](https://code.google.com/p/runsharp/) is a nice user-friendly \nwrapper for Reflection.Emit API developed by Stefan Simek and Matthew Wilson.\n\nOriginal RunSharp code:\n\n```csharp\nMyTypeGen.Public.Static.Method(typeof(void), \"Main\")\n   .Parameter(typeof(string[]), \"args\")\n   .Attribute(typeof(DescriptionAttribute), \"Entry Point\");\n```\n\nMy version:\n\n```csharp\nMyTypeGen.Public.Static.Void(\"Main\")\n   .Parameter\u003cstring[]\u003e(\"args\")\n   .Attribute\u003cDescriptionAttribute\u003e(\"Entry Point\");\n```\n\nOverview\n========\nRunSharp is a layer above the standard .NET Reflection.Emit API, allowing to \ngenerate/compile dynamic code at runtime very quickly and efficiently \n(unlike using CodeDOM and invoking the C# compiler). To the best of my\nknowledge, there is no such library available at the moment.\n\nExample\n=======\nA simple hello world example in C#\n\n```csharp\npublic class Test\n{\n   public static void Main(string[] args)\n   {\n      Console.WriteLine(\"Hello \" + args[0]);\n   }\n}\n```\n\ncan be dynamically generated using RunSharp as follows:\n\n```csharp\nAssemblyGen ag = new AssemblyGen(\"hello.exe\");\nTypeGen Test = ag.Public.Class(\"Test\");\n{\n   CodeGen g = Test.Public.Static.Method(typeof(void), \"Main\", typeof(string[]));\n   {\n      Operand args = g.Param(0, \"args\");\n      g.Invoke(typeof(Console), \"WriteLine\", \"Hello \" + args[0] + \"!\");\n   }\n}\nag.Save();\n```\n\nThe above code should generate roughly the same assembly as if the first \nexample was compiled using csc.\n\nTutorial\n========\n[RunSharp - Reflection.Emit Has Never Been Easier](http://www.codeproject.com/Articles/20921/RunSharp-Reflection-Emit-Has-Never-Been-Easier)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyallie%2Frunsharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyallie%2Frunsharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyallie%2Frunsharp/lists"}