Cmajor 1.5.0 released

"Seppo Laakko" <seppo.laakko@pp.inet.fi>
Wed, 31 Aug 2016 19:06:06 +0300

          From comp.compilers

Related articles
Cmajor 1.5.0 released seppo.laakko@pp.inet.fi (Seppo Laakko) (2016-08-31)
| List of all articles for this month |

From: "Seppo Laakko" <seppo.laakko@pp.inet.fi>
Newsgroups: comp.compilers
Date: Wed, 31 Aug 2016 19:06:06 +0300
Organization: Compilers Central
Injection-Info: miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="39455"; mail-complaints-to="abuse@iecc.com"
Keywords: C, available
Posted-Date: 31 Aug 2016 21:52:15 EDT

Hi!


Cmajor compiler version 1.5.0 released:


http://sourceforge.net/projects/cmajor/files/1.5.0/


Source code also in GitHub:


http://github.com/slaakko/cmajor


Cmajor is a hybrid programming language based on C++ and C#.
Its syntax is closer to C#'s than C++'s syntax and semantics
closer to C++'s semantics than C#'s semantics.


It's not garbage collected but relies on destructors doing
the cleanup as in C++.


It runs on Windows and Linux, has LLVM and C backends,
has basic implementation of concepts, has an IDE in Windows,
and has support for debugging integrated in IDE in Windows
and using command line tool cmdb in Linux.


New in this release:
o Code completion in the editor (not perfect but mostly usable).
o A document about implementation of the Cmajor compiler:
          Implementation.pdf in the doc subdirectory.
o constexpr: a function declared constexpr is evaluated
at compile time if given literal arguments of a basic
type (int, uint, long, ulong, etc.).
A constexpr function can call other constexpr functions.
It can also be a function template.
It can be called in contexts where a compile time constant is
expected. When argument is not a literal it behaves as an
ordinary function. constexpr is a new keyword.


For example:


public constexpr factorial(int n)
{
        if (n == 0) return 1;
        return n * factorial(n - 1);
}
public const int fact5 = factorial(5);


It is planned that in future the argument can also be
an instance of a literal class type, where literal class type
is sufficiently simple nonpolymorphic class type.


o Intrinsic type predicates.
There's now some intrinsic compile time Boolean functions
that answer questions about types in System.Meta namespace:
bool IsLvalueReferenceType<T>();
bool IsRvalueReferenceType<T>();
bool IsReferenceType<T>();
bool IsConstType<T>();
bool IsPointerType<T>();
bool IsIntegerType<T>();


bool IsClassType<T>();


etc...


o Predicate constraints for concept checking.
One can call a constexpr or an intrinsic predicate function
in a where-constraint:


public int foo<T>() where IsPointerType<T>()
{
// ...
}


o System.Numerics.Multiprecision library has now BigFloat and
BigRational classes.


o Updated to LLVM version 3.8.1 and GCC version 5.4.0.


Regards,
Seppo Laakko


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.