Last active
August 29, 2015 14:09
-
-
Save rolfwr/aec4daf4789e8374b6f6 to your computer and use it in GitHub Desktop.
Hello world in C# compiled to .NET IL, and then compiled down to a stand-alone portable Bourne shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
LC_CTYPE=C; export LC_CTYPE | |
charat() { if test -z $BASH; then r=$(expr substr $1 $(($2 + 1)) 1); else r=${1:$2:1}; fi } | |
p=0 | |
h=0 | |
i=0 | |
while true; do | |
case $i in | |
0) | |
# IL_0000: ldstr "Hello World!" | |
eval "s${p}=\"Hello World!\"" | |
# IL_0005: call System.Void System.Console::WriteLine(System.String) | |
eval "a1=\$s${p}" | |
echo "${a1}" | |
# IL_000a: ret | |
break | |
exit 1 | |
;; | |
esac | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
LC_CTYPE=C; export LC_CTYPE | |
charat() { if test -z $BASH; then r=$(expr substr $1 $(($2 + 1)) 1); else r=${1:$2:1}; fi } | |
p=0 | |
h=0 | |
i=0 | |
while true; do | |
case $i in | |
0) | |
eval "s${p}=\"Hello World!\"" | |
eval "a1=\$s${p}" | |
echo "${a1}" | |
break | |
exit 1 | |
;; | |
esac | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static void HelloWorldCSharp() | |
{ | |
Console.WriteLine("Hello World!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment