Nu programming language is an open-source software created in 2007 by Tim Burks, an American software developer who now works for Google on APIs. The creation of Nu came about in the same year as the launch of the first iPhone, and it was working with OS X and iOS that led to the creation of the new language.
The success of Apple products has made the 1983 language Objective-C an extremely relevant coding language to know, as it powers OS X and iOS. Despite the release of Swift in 2014, most developers for OS X, as well as iPhone apps, still work with Objective-C.
The other inspirations for creating Nu came from Ruby and Lisp. Ruby is known to be one of the semantically simplest languages out there, powering some of the most popular websites on the net, notably Twitter. Lisp, one of the oldest high-level programming languages still in use, provided the syntax. Burks originally wanted to graft Ruby to Objective-C, but found too many mismatches. It was then that he decided to create an entirely new language specifically for Objective-C.
What is Nu language?
Nu is an alternative scripting language used to program OS X through Apple’s native API, Cocoa.
Like Ruby, Nu is an interpreted, object-oriented language. Using the familiar syntax of Lisp, and the semantic simplicity of Ruby, Nu was designed to structure C code without the need to generate cumbersome “glue code” – the artefacts that are imposed on C code when using other existing languages such as Python.
When Burke was developing Nu, he kept a few goals in mind. He wanted something with the power, expressiveness and flexibility of the Lisp family of languages, but which also worked seamlessly with Objective-C. Nu is designed to be expressive, and therefore to reduce the amount of code that it is required to write. It also allows for the reuse and recycling of code and components from existing projects.
The current system requirements for Nu are Mac OS X 10.7 or iOS 4.3 or greater. An implementation also exists for Linux.
Are Slot Sites Programmed Using NU?
The best slot sites, as well as all the other kinds of online casinos out there are a great example of projects that are in a desperate need of various kinds of programming languages, tools and software. We took slots sites as an example here due to the fact that they are operating at a field that requires a lot of programming – without it there would not be a business or the entire industry!
Usually slot games are programmed in several languages such as Java or HTML 5 – how much of the programming is based on NU language, that we don’t know, but we are assuming it is used at least at the slot apps for iOs. When it comes to mobile slots for Android, we are confident that NU checks all the requirements needed to attain a relevant market share. NU is especially popular among slots and casino sites licensed by the UK Gambling Commission.
How to build and install NU repository
There are six discrete steps to building and installing Nu, from prerequisites through to testing. Here’s a rundown of what you’ll need to do to get started coding using Nu.
1. Install PCRE
The first step is to download and install PCRE, the Perl-Compatible Regular Expression Library, from www.pcre.org. Make sure that you build PCRE with UTF-8 support, or later steps will fail. The command for building universal binary with UTF-8 support is as follows:
$ env CXXFLAGS=”-arch i386 -arch ppc” \
CFLAGS=”-arch i386 -arch ppc” \
LDFLAGS=”-arch i386 -arch ppc” \
./configure –disable-dependency-tracking –enable-utf8
The default location for PCRE should be /usr/local, and please ensure that this is where it goes in order to avoid more complications later.
2. Check if your OS includes libffi
Nu requires libffi, which may require you to build your own library, depending on what OS you are running. 10.5 users have this already included, but others may need to do this extra step before proceeding. Detailed information on how to build the libffi library can be found online.
3. Build mininush
A minimal version of the Nu shell, called mininush, is built using the command make as follows:
$ make
4. Complete Nu build
Mininush can then be used to run nuke – a build and task management too of Nu – and complete the build. The following command is used to build the Nu framework and the shell, which is known as nush:
$ ./mininush tools/nuke
5. Install Nu
Mininush is also used to install nush, Nu.framework and Nu tools, with the following command:
$ ./mininush tools/nuke install
You will be required to enter your password at this point. The location for the framework should be /Library/Frameworks and for the executables /usr/local/bin.
6. Test Nu
nuke test is used to test the installation. Enter the command:
$ nuke test
If the test is successful, the final result should look similar to this:
All: completed 45 tests/133 assertions/0 failures
SUCCESS (0 failures)
Tools available in Nu
Nu has a suite of tools available that allow the user to perform different tasks with the language. Let’s take a quick look at them and see a bit of what they can do.
nuke
We’ve already encountered nuke while building, installing and testing Nu. It was inspired by the rake tool in Ruby, and it is similarly multi-purpose. nuke can be used to build and run applications, to build frameworks and to run tests, among many other functions.
nudoc
This tool automatically creates documentation for Objective-C and Nu source files. The output is as html files, which are generated and placed in a directory named doc.
nutemplate
As the name suggests, this is the Nu templating tool, which can be used from Nu or Objective-C code to generate XML, HTML or CSS.
nubake
This is a code generation tool, which takes its name from the idea that Nu source files can be ‘baked’ into compiled objects. This makes them both simpler and more tamper-resistant.
As well as the tools described above, the tools suite also includes the code formatter nubile and the testing tool nutest.
Uses of Nu programming language
One simple use of Nu is to test and explore Objective-C components by writing programs that run in the Nu shell, nush. This is a great starting point to see how Nu is integrated with Objective-C.
Nu can also be used to build applications in Cocoa, which is Apple’s native application programming interface (API). This can be done in a number of ways, depending on whether you have Objective-C code to compile into your application or not.
If there is no compilation needed, then you can simply copy nush into the application bundle directory Contents/MacOS and rename it to the desired name of your application. If you wish to compile Objective-C code into the application, then it can be prompted to start with Nu using a main() function. The final option, which avoids modifying the main() function, is to instruct the Nu parser to load and be used at runtime.
A third use of Nu is in the building of Cocoa frameworks. A framework is essentially reusable code providing specific functionality so that you can develop your own applications. Frameworks will always require at least a little C code as well as using Nu. There are tasks in nuke that will help in the creation of frameworks.
Some examples of practical uses of Nu programming language are in a simple screen saver, a currency converter and console games.
How to embed Nu
Nu is not yet a very widely-used coding language, so while you may be familiar with it, there are many who aren’t or don’t use it. If you have developed an application using Nu, you may well want to ship it to your users without a requirement for them to also install Nu. This can be done by embedding Nu inside the application as a private framework.
After using nuke to build the application, you will need to add a directory under Contents, named Frameworks, and then copy into this newly created directory Nu.framework. After this, your application must be instructed to look for Nu.framework in the Frameworks directory. This is done by using a program called installnametool.
After this, your application will be ready to use, even if the end user doesn’t work with Nu.
Where can I find out more?
In order to be thinking about using Nu, it is assumed that you are already familiar with using Objective-C in the creation of iPhone apps or building anything in OS X. If that is not the case, then your first step is to learn how to use Objective-C, as Nu was designed specifically to interface with it. If you wish to work on developing Apple software, Objective-C is essential.
If you have already mastered Objective-C, then understanding Nu should be quite manageable. For more information on how to use this coding language, please visit the GitHub pages at https://github.com/programming-nu, which contains a repository of all information including examples of simple applications using the language.