• Fake Programming Language
    330 replies, posted
This is simple: Write a simple app (Hello World, or something similar) in a fake programming language, invented by, of course; You. Suggestions and ideas appreciated. This is my entry: [CODE] /* * This program is an example of the ARTIC programming language * * ARTIC is a fake language I came up with. It is an interpreted, imperative, dynamic typed, and [meaby in the future] * object-oriented language for applications. * * This language was influenced by languages like C, C++ and Lisp. The fully parenthesized syntax is from Lisp, the structure *from C and C++, and other aspects come from a myriad of other languages. * * -Alex Rosslyn, Friday 21, August 2009. * * */ /include (stdio) /*Preprocessor line: Inclues the "standard input/output" file*/ /*I'm a comment LOL*/ /*Group VAR, includes variables*/ {$var {$string /*Subgroup "string". Contains all string variables. (The name cannot be changed)*/ (name) /*Creates a string variable calledd "name". Empty*/ } {$int /*Subgroup "int". Contains integer variables. (Also, name cannot be changed)*/ (Time=5000) /*Creates an integer variable called "Time" (Case sensitive). Value= 5000*/ } } /*Group ends*/ /*Group main. The program starts here (For C and C++ programmers, this is your main loop*/ {$main (print("Hey guys LOL.\n")) /*Prints the following: Hey guys LOL. Also adds a newline (\n)*/ (get.cin) /*Gets input. any input. Basically the program is paused until you press any key. (For C and C++ programmers, this is "cin.get;"*/ (get("What's your name? %s", name)) /*The program writes "What's your name? " on the screen, and allows the user to enter input. Said input is stored in the "name" string variable*/ (wait(Time)) /*Waits for some time. Usually, the syntax would be "(wait(X))" where X is the number of milliseconds. Instead, the compiler takes the value from a variable*/ } [/CODE] The language is basically C and Lisp together. It can be written as a single line, for example: [CODE] {$main (print("Hey guys LOL.\n"))(get.cin)(get("What's your name? %s", name))(wait(Time))} [/CODE] In C++, that would be: [CODE] cout << "Hey guys LOL.\n"; cin.get; cout << "What's your name? "; cin >> name; Sleep(5000); [/CODE]
Program Hello_World; Begin str: Hello; Hello = 'Hello world!'; Print(Hello); End
lol, helloworld isn't really enough code to show off your own idea of a nice language. Anyways I would probably just post C++ with a few modifications.
Probably a language code equal to C#, but you can have code_c++ { } code_java { } parts in the code so you can use other programming languages.
[code] LETS START THIS MOFO GIVE ME PRINT the thing that I just got "Hello World!" THROW AWAY PRINT SCREW OFF [/code]
begin main { print "Hello World!"; } end
[QUOTE]lol, helloworld isn't really enough code to show off your own idea of a nice language.[/QUOTE] True. Meaby... a contest where you write apps in your language or somnething? I was thinking about using this thread for that, but it would fail if the thread itself fails...
[code] ` outputs hello, world out "hello, world" [/code]
[CODE] /* * This program is an example of the ARTIC programming language * * This example creates a calculator. * * ARTIC is a fake language I came up with. It is an interpreted, imperative, dynamic typed, and [meaby in the future] * object-oriented language for applications. * * This language was influenced by languages like C, C++ and Lisp. The fully parenthesized syntax is from Lisp, the structure *from C and C++, and other aspects come from a myriad of other languages. * * -Alex Rosslyn, Friday 21, August 2009. * * */ /include (stdio) {$var {$int (num1) (num2) (result) } {$string (ari) } } {$main (print("---Sample ARTIC Calculator---\n")) (print("-----------------------------\n")) (get.cin) (get("Enter the first number: %i", num1)) (get("Enter the second number: %i", num2)) (get("Enter Arithmetic Operator (+,-,*,/): %s", ari)) (if(ari == '+'): ( (let(result=num1+num2) ) (elif(ari == '-'): ( (let(result=num1-num2) ) (elif(ari == '*'): ( (let(result=num1*num2) ) (elif(ari == '/'): ( (let(result=num1/num2) ) (print("-----------------------------\n")) (print(result)) } [/CODE]
[code] ` simple calculator out "first number:" in x out "\nsecond number:" in y out "\noperation:" in op out "\nresult:" + __exec("x" + op + "y") [/code]
[QUOTE]out "\nresult:" + __exec("x" + op + "y")[/QUOTE] *bashes head against the wall* Silly me :(
[code]010200100012000000210212122201021021012012010210201201021021020120100210201021021020120120120102[/code] Binary code for my 3 state computer.
I wish I could make stuff like this :(
[QUOTE=Eudoxia;16839923]*bashes head against the wall* Silly me :([/QUOTE] ... the pitfalls of designing your own language based on another language ;) (especially C++/C, what were you thinking?! :v:) [editline]04:07PM[/editline] [QUOTE=Mattz333;16839953][code]010200100012000000210212122201021021012012010210201201021021020120100210201021021020120120120102[/code] Binary code for my 3 state computer.[/QUOTE] You mean ternary?
[QUOTE]... the pitfalls of designing your own language based on another language ;) (especially C++/C, what were you thinking?! )[/QUOTE] *mass change in progress*
I made a calculator. [code] LETS START THIS MOFO LOLGROUP1 GIVE ME ENTER TEXT THING THAT STORES(WHATEVER_WAS_IN_HERE_NAME = NAWMBER1) GIVE ME PRINT IN ENTER TEXTBOX (NAWMBER1) the thing that I just got "PUT FIRST NAWMBER HERE PLZ AND POOSH ENTER" IF ENTERBAWTEN WAS POOSH THEN STORE STORE PRINT IN ENTER TEXTBOX (NAWMBER1) STORE WHATEVER IN NAWMBER1 GIVE ME ENTER TEXT THING THAT STORES(WHATEVER_WAS_IN_HERE_NAME = OPERATIONTHINGY) GIVE ME PRINT IN ENTER TEXTBOX (NAWMBER1) the thing that I just got "PUT OPERATIONTHINGY HERE PLZ AND POOSH ENTER" IF ENTERBAWTEN WAS POOSH THEN STORE STORE PRINT IN ENTER TEXTBOX (OPERATIONTHINGY) STORE WHATEVER IN OPERATIONTHINGY GIVE ME ENTER TEXT THING THAT STORES(WHATEVER_WAS_IN_HERE_NAME = NAWMBER2) GIVE ME PRINT IN ENTER TEXTBOX (NAWMBER2) the thing that I just got "PUT NAWMBER2 HERE PLZ AND POOSH ENTER" IF ENTERBAWTEN WAS POOSH THEN STORE STORE PRINT IN ENTER TEXTBOX (NAWMBER2) STORE WHATEVER IN OPERATIONTHINGY DOTHEMATH NAWMBER1(OPERATIONTHINGY)NAWMBER2 = ANSWER GIVE ME PRINT_STORED_THING (ANSWER) the thing that I just got "ANSWER" SHOW PRINT STORED THING SCREWOFF LOLGROUP1 SCREW OFF [/code]
I always wanted to take brainfuck and make it a little less of a brain fuck, and more useful like this: > and < move the memory index pointer 0-9 add integers to the memory at the current index a-Z add chars to the memory at the current index +,-,*-/ does the operation to the current index and the next index to the right @(#) copies the current index to index of #( like @(3) copies to the third memory index) . prints the current index , takes input {} loops, if current index = 0, break loop [] if current index = 0 skip stuff inside So hello world would be: H>e>l>o>W>r>d<<<<<<.>.>..>.>.<.>>.<<<.>>>>. Fibonacci loop (1,1,2,3,5,8,13...) would be: 1>1>0<<{.>.<@(3)+@(3)>+<}
EDIT: Fucking pressed the tab button and this shit posted. EDIT: Hold on.
[code] \\ <'Hello World'> // [/code]
[code] print 'Hello World'; [/code] Simplicity is key.
Mine looks like a Space Rocket. :D
[QUOTE=nullsquared;16839884][code] ` simple calculator out "first number:" in x out "\nsecond number:" in y out "\noperation:" in op out "\nresult:" + __exec("x" + op + "y") [/code][/QUOTE] Ah, so in the __exec function the variables would behave somewhat like preprocessor defines?
[QUOTE=cryticfarm;16839110][code] LETS START THIS MOFO GIVE ME PRINT the thing that I just got "Hello World!" THROW AWAY PRINT SCREW OFF [/code][/QUOTE] [QUOTE=cryticfarm;16840324]I made a calculator. [code] LETS START THIS MOFO LOLGROUP1 GIVE ME ENTER TEXT THING THAT STORES(WHATEVER_WAS_IN_HERE_NAME = NAWMBER1) GIVE ME PRINT IN ENTER TEXTBOX (NAWMBER1) the thing that I just got "PUT FIRST NAWMBER HERE PLZ AND POOSH ENTER" IF ENTERBAWTEN WAS POOSH THEN STORE STORE PRINT IN ENTER TEXTBOX (NAWMBER1) STORE WHATEVER IN NAWMBER1 GIVE ME ENTER TEXT THING THAT STORES(WHATEVER_WAS_IN_HERE_NAME = OPERATIONTHINGY) GIVE ME PRINT IN ENTER TEXTBOX (NAWMBER1) the thing that I just got "PUT OPERATIONTHINGY HERE PLZ AND POOSH ENTER" IF ENTERBAWTEN WAS POOSH THEN STORE STORE PRINT IN ENTER TEXTBOX (OPERATIONTHINGY) STORE WHATEVER IN OPERATIONTHINGY GIVE ME ENTER TEXT THING THAT STORES(WHATEVER_WAS_IN_HERE_NAME = NAWMBER2) GIVE ME PRINT IN ENTER TEXTBOX (NAWMBER2) the thing that I just got "PUT NAWMBER2 HERE PLZ AND POOSH ENTER" IF ENTERBAWTEN WAS POOSH THEN STORE STORE PRINT IN ENTER TEXTBOX (NAWMBER2) STORE WHATEVER IN OPERATIONTHINGY DOTHEMATH NAWMBER1(OPERATIONTHINGY)NAWMBER2 = ANSWER GIVE ME PRINT_STORED_THING (ANSWER) the thing that I just got "ANSWER" SHOW PRINT STORED THING SCREWOFF LOLGROUP1 SCREW OFF [/code][/QUOTE] Heh. Looks like Lolcode.
[QUOTE=Z_guy;16842689]Ah, so in the __exec function the variables would behave somewhat like preprocessor defines?[/QUOTE] __exec is like eval() in perl and PHP.
This is pretty cool idea for a thread. [code] using System; using System.Windows.Forms; using System.Net.Sockets; // macrossss #define SomeFunc(arg) \ Console.WriteLine(arg) // global scope functionsssss public void DieInAFire() { Application.Exit(); } class Program { public static void Main() { SomeFunc("Wheee."); Socket sock = new Socket(blah, blah, blah); // ... // use sock // ... sock.Dipose(); delete sock; // non-GC'd manual deletion DieInAFire(); } } [/code] I wish. :sigh:
Recipe++ [code] Recipe for one hello world { You will need: one console window iostream Step 1: open the console window and set its title to test. Step 2: Add one "hello world" to your mixing bowl Step 3: Cook your mixture and serve Step 4: Tidy away and clean all utensils. } [/code]
[code]start init english init speech init willpower say hello world fuck it all sleep [/code]
[QUOTE=nullsquared;16839884][code] ` simple calculator out "first number:" in x out "\nsecond number:" in y out "\noperation:" in op out "\nresult:" + __exec("x" + op + "y") [/code][/QUOTE] Why __exec("x" + op + "y")? Wouldn't __exec(x + op + y) make more sense?
[code]hello world[/code] It prints everything. [B]EVERYTHING.[/B]
Number code. [code]1 34 9 38 75HelloWorld56 266 0[/code]
Sorry, you need to Log In to post a reply to this thread.