Multiple OSes


Implementation of the programming languages in Nexss Programmer

Nexss Programmer has now also installer for Linux. See: https://github.com/nexssp/cli/blob/master/install/installNexssProgrammer.sh

npm i @nexssp/cli -g # installs package globally

Different linux distributions

Please see below for example how multiple distributions are handled in the linux configuration. The configuration are generated and saved in to the cache. (SUDO - is also stored in cache as cache is per user. So root has own cache folder in the home directory.)

const distName = process.distro;
// TODO: Later to cleanup this config file !!
switch (distName) {
  case process.distros.ORACLE:
    //if here for older versions of nexssp
    const distVersion = process.distroVersion * 1; // *1 converts to number
    if (distVersion >= 8) {
      // TODO: recognize the slim version
      compilerConfig.install = `${sudo}dnf update -y && ${sudo}dnf install -y oracle-epel-release* && ${sudo}dnf install -y php php-json php-pdo php-intl`;
      languageConfig.languagePackageManagers.composer.installation = `${sudo}dnf update -y && ${sudo}dnf install -y curl && curl -s https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer`;
    } else {
      compilerConfig.install = `${sudo}yum update -y && ${sudo}yum install -y oracle-epel-release* && ${sudo}yum install -y php php-json php-imap php-pdo php-intl`;
      languageConfig.languagePackageManagers.composer.installation = `${sudo}yum update -y && ${sudo}yum install -y curl && curl -s https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer`;
    }

    break;
  case process.distros.ALPINE:
    compilerConfig.install = `${sudo}apk add php php7-json php-imap`;
    break;
  case process.distros.ARCH:
    compilerConfig.install = `${sudo}pacman -Sy --noconfirm php php-imap`;
    break;
  case process.distros.FEDORA:
    compilerConfig.install = `${sudo}dnf install -y php php-json`;
    break;
  case process.distros.CENTOS:
    compilerConfig.install = `${sudo}yum install -y epel-release* && yum install -y php php-json php-imap`;
    break;
  case process.distros.SUSE_LEAP:
  case process.distros.SUSE_TUMBLEWEED:
    compilerConfig.install = `${sudo}zypper -n install php7 php7-json`;
    break;
  case process.distros.AMAZON:
  case process.distros.AMAZON_AMI:
  case process.distros.RHEL:
    compilerConfig.install = `${sudo}yum install -y php php-json php-imap`;
    break;
  default:
}

Note: This is WIP version, however put more light on the subject.

Here is the information about how to implement new languages or expand current config for other OSes. Please remember that if you are doing any changes to the languages configuration you need to recreate cache (once) by adding --nocache eg. nexss myfile.go --nocache. It will take a bit longer. Also nexss cache rebuild (2.2.37+)

All configurations of the languages, compilers are installed on demand so for example if you run command nexss myfile.go and compiler of the go language is not there Nexss Programmer will install it for You.

The configuration files for the languages are in the folder c:/Users/YourUsername/.nexss/languages/ Those files are written in JavaScript, however they are straight forward as need only to put different values on variables. We haven't use pure JSON as with this way it is more flexible.

So for example after you run the first program in go there will be added new language folder language_go.git in this case. Every folder contains:

  • Folder templates/ which of course contains templates for the language, more here: Files---Templates
  • File nexss.php.errors.js which contains error/solution definitions, more here:Errors-Solutions
  • File php.win32.nexss.config.js definition of the Windows OS.

Nexss Programmer working also on WSL - Windows Subsystem Linux

  • File php.linux.nexss.config.js definition of the Linux OS.
  • File php.darwin.nexss.config.js definition of the Mac OS.

Implement Linux and MacOS

Nexss Programmer is not prepared fully to work on Linux and MacOS however core code for Nexss Programmer is ready. You can implement it on your machine manually by configuring the Language files.

Prepare environment

Nexss Programmer uses Powershell to install some of the compilers. For now it will be like that until full implementation of Linux and/or MacOS is done. To Install Powershell on Linux:

Config files

These should be straight forward as it takes some of the configuration from the Windows configuration files. Eg:

Change php.linux.nexss.config.js and/or php.darwin.nexss.config.js accordingly.

//To add example later

Nexss will be run on all OSes, However for now there is only support for Windows OS.

Please consider donating to speed up process.

Donate Donate

It is a great pleasure to work on the tools for everyone however it is a huge amount of work and the donations are always part of motivation which helps to move forward. There is still a lot of work to implement Nexss PROGRAMMER on the Linux and MacOS.

Please consider donating to the Nexss Paypal Account

paypal Donate