+ 25

>> Challenge: Create your own programming language in the playground! >>

First, decide on what code you want you use as an anchor. You could use Python, Java, C++, JavaScript, C#, PHP etc... The language doesn't matter. However, you must understand your anchoring language. You must also understand your goal. Secondly, take a piece of paper and write a rough draft of how your code looks like. Once you have done that, you can practice your anchor code. Finally, if you want to publish your language, create it as a single folder. Example: [name]---[anchor] ---[main]

20th Dec 2017, 8:19 PM
Edwin Pratt
Edwin Pratt - avatar
10 Antworten
+ 4
idk about the ->, that's an existing operator that i don't know how to (if it's possible) override to do what you want, but here https://code.sololearn.com/cP3tTWdxxzbB/?ref=app
28th Dec 2017, 5:46 AM
LunarCoffee
LunarCoffee - avatar
+ 15
That is really difficult task 😞
21st Dec 2017, 12:12 AM
Vukan
Vukan - avatar
+ 15
Amazing @Lil!
23rd Dec 2017, 9:35 PM
Edwin Pratt
Edwin Pratt - avatar
+ 11
WOW! @LunarCoffee! That code is nice!
28th Dec 2017, 12:19 PM
Edwin Pratt
Edwin Pratt - avatar
+ 7
I have an idea for a syntax if anyone wants one: BASICS --------- Every statement ends with a semicolon. say(string message) is for outputting text. Does not include newline. \n is newline. listen() returns string from input SETTINGS VARIABLES ---------------------------- Variables are statically typed, and caps sensitive. int x = 5; string hey = "Hello!"; const string ants = "are useful"; CONDITIONS - IF --------------------- bool success = true; on success -> { say("Yo!"); } CONDITIONS - ELSE ------------------------- bool success = false; on success -> { say("True!"); } other { say("False!"); } CONDITIONS - ELSE IF ---------------------------- int number = 3; on number == 3 -> { say("Three!"); } otherwise number == 1 -> { say("One!"); } other { say("I don't know..."); } LOOPS - WHILE -------------------- int number = 3; while number < 10 -> { say(number); } you can add more on that, this is just the base.
22nd Dec 2017, 6:55 PM
Lil Taco
Lil Taco - avatar
+ 5
This is not a programming language created by myself but this is how I'd do to make it (I mean the C++ thing) https://code.sololearn.com/WeGM0F21heJU/?ref=app https://code.sololearn.com/c3D3fV73yfQU/?ref=app https://code.sololearn.com/cIW5UWz6GZoq/?ref=app
4th May 2018, 8:06 AM
Uni
Uni - avatar
+ 3
thanks :D
28th Dec 2017, 4:21 PM
LunarCoffee
LunarCoffee - avatar
+ 3
I'll give this a go sometime, but watch this space for a very, very long time while I create it!
5th Feb 2018, 9:42 PM
Robyn A
Robyn A - avatar
+ 2
UPDATE!!!!!!! I HAVE A WAY! I just have a question... when a user writes ~include {example.ext} it will include example.ext Now. it is an interpreted language and I'm using C as its output file. I'm using batch to write everything out. Here's the problem: How do I use the filename? I know this: %~fI ...but I don't want to use the I variable in my language to include files. I also only want the filename. Is there a solution? Thanks!
1st Apr 2018, 8:48 PM
Edwin Pratt
Edwin Pratt - avatar
8th Apr 2018, 7:19 PM
Игорь Белоусоа
Игорь Белоусоа - avatar