Ne Project Programming Language Documentation
Low-Level large systems are one of the toughest aspects of Software Engineering.
Nectar was designed to implement such systems in a way that the programmer has the guarantee to know and design the system up to their wishes.
Nectar is simple to use, compiled to binary — and works on NeKernel and POSIX platforms.
let main()
{
writefn("%s:13", "Hello, world!\n");
return;
}The following prints out 'Hello World' with a maximum buffer size of 13.
let main()
{
let bar := "Hello, world\n";
writefn("%s:13", bar);
return;
}You now know how to write a variable in Nectar.
let main()
{
const bar := "Hello, world\n";
writefn("%s:13", bar);
return;
}Way better!
In this section we will be talking about the trait and impl keywords in Nectar.
Traits are rules used to describe implementations in Nectar, they work by giving specifications about how an impl should be mapped out.
Take it as a blueprint for let's say, an order-book.
trait order_book
{
let buy(let self, let qty);
let sell(let self, let qty);
};An implementation would take care of implementing such methods for let's say, European order book, etc.
impl order_book : trait order_book
{
let buy(let self, let qty) { }
let sell(let self, let qty) { }
}This implements the order book object from its traits order_book. More examples can be found on the repository of Nectar, or in the next page.