[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Rate my revolutionary language. It's called C2, because

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 9
Thread images: 2

Rate my revolutionary language. It's called C2, because it's twice as good as C.

using c2.Application;
using c2.data.Json;
using c2.net.Http;
using c2.io.File;

// Python-style indentation-based syntax for a fresh, clean look
class ExampleMain implements Application:
/*
auto is the equivalent of @Autowired in Spring
e.g. the value gets injected by the runtime upon class instantiation
this reduces coupling in comparison to using Java's System.out
*/
auto Output stdout

constructor():
// C-style semantics for endless possibilities
int a = 42

void run():
stdout.writeLine('Hello World!')

File f = File.open('test.txt', 'wt')
f.writeLine('for me')

// UFCS - gets converted to this.myWriteLine(f, ...)
f.myWriteLine('and you')

f.close()

Http.get('api.4chan.org/status', func(Json data):
// Json object gets implicity stringified, obviously
stdout.writeLine('Response is:', data)
)

// Main thread ends while the request is still in progress,
// but like in Java, program doesn't quit until all threads have finished

// Output is a generic OutputStream-like interface
// for convenience, it handles both byte- and character-based IO
void myWriteLine(Output f, Any... text):
f.write('Special output: ', text, '\n')


~$ c2 --verbose example.c2
Compiling example.c2...
Found 1 implementation(s) of c2.Application:
- ExampleMain
Instantiating ExampleMain
Calling Application.run

Hello World!
Response is: {'status': 'ok'}
>>
>>57202587
So it's basically C++/Java without curly braces?
>>
>Autism intensifies...
>>
>>57202684
And without legacy cruft
>>
>>57202587

soooo cython?
>>
File: puke-s312x312-78676.jpg (56KB, 312x312px) Image search: [Google]
puke-s312x312-78676.jpg
56KB, 312x312px
>>57202587
>indentation-based syntax
>>
>>57202764
>writing tons of unnecessary characters
>>
>>57202755
It's statically typed, transpiles to C for compilation
>>
I like it
Thread posts: 9
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.