Ya Language

http://Ya-Lang.com . Designed and made by Pavel Senatorov, see Ya-Lang.com for emailing.

Ya is based on CeePlusPlus (C++) and gets most of C++ as is. Yet there is no compatibility with C++, C++ program is not a Ya program and cannot be compiled as is. Anyway it's

Main news in comparison with C++: Appeared at 2012.

Works only in Windows for now.

== Example: Hello World ==

@HelloWorld.Ya; using <stdio.h>; $int($char[][] args) main

printf("Hello, %s!\n", args.Length > 1 ? args[1] : "World");
return 0;

== Basics of Ya ==

=== Block structure is described by tabs at starts of lines ===

Tabs at start of line are counted and used for specifying code blocks <code>{...}</code>, like in [[Python]]. But blocks made in single line with <code>{</code> and <code>}</code> are also supported. Typical Ya program has near to no one <code>{</code> and <code>}</code>.

=== Modules, ala #define and no project file ===

=== Double compilation aka [[Metaprogramming]] === === Extensible syntax === === Extensible lexical tokens === === Support for databases and internal structures like databases === It will probably be done as library. It will be possible to write expression that works with a number of tables, which are sets (f.e. arrays, lists) of fielded type (of class), and perform <code>join where sortby</code> of SQL. In C# it is named [[Language Integrated Query]]. === Multiple names for any entity is allowed === Variables, functions, types and template argument requirements all may be named by a number of names. No need to use <code>#define</code> instead. Example: <code>$int a b c = 100;</code> - here you can use this variable by name <code>a</code> or <code>b</code> or <code>c</code>. === Description of types === === Many small changes in the base of C++ === <source lang="c"> switch 10-5
  1. .3,7
printf("Wow! It's 0,1,2,3 or 7\n");
printf("Simple case!\n");
else
printf("default is written as default or else.\n"); }}
</source>
 - each case starts without <code>case</code> and <code>:</code> after case values is not written. Case values can include many values and also ranges <code>value..value</code>, like in <code>0..3,7</code> - this case works if switched with 0,1,2,3 or 7. Also no need to write <code>break;</code> to break out of case - it is automatically included at the end of a case. But if it's required to continue on next case then <code>continue;</code> may be used - it jumps to the body of next case.
<source lang="c"> !any $StringEnum? enum $char[]
Str1 = "lala", Str2 = "bebe"
!any $ErraType? enum $int+:8 // i.e. they are unsigned bytes
eFatal, eErr, eWarn, eMess,
</source>


CategoryProgrammingLanguage


EditText of this page (last edited September 4, 2013) or FindPage with title or text search