What?! Yet another programming language? Like, there isn't enough of them already?
Believe us, we know how it sounds! We also likely know every possible argument against creating a new programming language. But the truth is, Jancy was not created just to fix the infamous fatal flaw of other languages — although we admit that the passion to invent was a significant driving force.
The main motivation to create Jancy was our software product called IO Ninja.
What we needed was a scripting language with safe data pointer arithmetic, extensive facilities for UI programming (properties, events, etc.), and easy integration with the host C/C++ application.
We couldn't find such a language! So we created it. Meet Jancy.
Jancy scripts are JIT-compiled and can be called directly from the host C/C++ application. Jancy supports all of the major calling conventions and is compatible with C/C++ compilers with respect to struct/union layouts with arbitrary packing factors.
Jancy provides all the colors and flavors of pointers such as safe pointers and safe pointer arithmetic, unsafe thin pointers for interoperability with existnig C/C++ libraries, weak pointers which do not retain objects, function pointers with partial application, scheduled function pointers and even property pointers!
Ever used Microsoft Excel before? Then you know the concept of writing a "formula" which will be automatically re-evaluated when the referenced cells change. With Jancy you can do the same in your code — and with full control of where and when to use this reactive paradigm. This is perfect for UI programming!
Jancy provides a convenient way of tokenizing input streams — that is, splitting a stream of characters into a token sequence. Specify regular expressions to define recognized lexemes and then simply write actions to execute when these lexemes are found in the input stream!
Jancy provides a convenient facility for ensuring the deterministic resource release in an inherently non-deterministic GC-world. This is achieved with
disposable storage specifier.
Jancy add a layer of syntactic sugar to the good old C-style error code model. This makes it look and feel just like throwing and catching exceptions. You are free to use the error code check or exception semantics with the same function — depending on what you deem more appropriate in each particular case.
Jancy features one of, if not the most, comprehensive implementation of properties. Along with the natural syntax for simple properties there is support for properties with overloaded setters, indexed properties, bindable properties, auto-get properties, and property pointers.
Jancy supports multicasts and events which allow accumulating function pointers and then calling them all at once. Weak multicasts and events which do not require explicit unsubscribing are also supported, thus providing an out-of-the-box solution for the publisher-subscriber pattern.
Besides standard class features such as constructors, destructors, virtual methods, and namespace member access control, Jancy also supports multiple inheritance, in- and out-of-class method implementation, operator overloading, in-place field initialization and preconstructors.
Const-correctness is a yin to the yang of data pointers. It is a great feature, which not only detects a whole range of logical errors at compilation time but also helps to design better and more foolproof libraries and APIs. Const-correctness is left behind in way too many languages. Jancy restores justice by bringing it back.
This function pointer-related feature simplifies the development of asynchronous multi-threaded applications. Jancy provides a natural syntax for creating callback function pointers, which are guaranteed to be executed in the proper context (e.g. in a worker thread, with a lock held, as a Windows message handler, etc.)
Jancy features a rather unusual approach to controlling namespace member access. There are only two access specifiers:
protected. Yes, this makes it more difficult to fine-tune member access, but at the same time opens a new possibility for dual modifiers that have different meanings for "friends" and "aliens".
Beside traditional character literals, Jancy features new kinds thereof. The first There are hex, decimal, octal, & binary literals for a convenient definition of in-program binary constants. There are formatting literals (as in perl-style formatting). And there are multi-line literals! All kinds of literals can be concatenated in any combinations.
Bitflag enums are just like enums... but for flag constants. Bitflag enums are missing in most modern languages and usually require some not-so-trivial workarounds. Jancy provides a solution for flag enums out-of-the-box.