Cosm API Review

Cosm has always been designed to be completely cross platform, and was started in 1995, which was 18 years ago. The computing world is far less diverse in 2013 and is dominated by flavors of Windows, Linux, and OSX, all with POSIX standards. Some of the CPU/OS and utility layer API’s now seem a little bit odd because they were for compatibility with systems that no longer exist in the wild. We also want to be sure we have APIs that are as simple and concise as they can possibly be.

Shared memory and named semaphores have been removed. They are generally useless for distributed systems (Cosm apps have never used them it turns out) and can fail in ways that are difficult to detect and recover from. Message passing has always been more flexible and much easier to reason about. So both have been removed to protect the innocent.

The defines OS_TYPE, CPU_TYPE, CPU_64BIT/CPU_32BIT, and COSM_ENDIAN are now fully auto-detected and set in cpuytypes.h. This simplifies the build system for those using Cosm. Doxygen documentation is also being added to replace the old HTML API docs as each function is reviewed.

The CosmFile and CosmDir functions in the CPU/OS layer will only deal with the local file system, and we no longer need to support VMS and MacOS (pre-X). The Cosm File System deals with all distributed files access. Since local file paths never leave the machine, the prefixing logic is no longer needed, which simplified the API. A function to locate the standard documents, configuration, and temporary storage directories at run time is being added.

Some things worked out far ahead of their need. Cosm has been based on UTF-8 and had IPv6 support since long before there was anything IPv6 to talk to. IPv6 still has a huge number of gotchas at the OS and routing levels, so we’re still waiting for it to be safely useable.

Quick note on cryptography – we’ll be moving fully to AES-256, SHA-3, and elliptic curves, all with a 256-bit length. We’ll be dropping support for the older crypto protocols entirely where possible, knowing the current protocols will likely be considered obsolete and weak in 10 years and need another update.

Much of the above is already completed, but more will be released to the code repository in the next few weeks. Simpler and easier APIs ahead.

Cosm Platforms

When Cosm was born in 1995, there were hundreds of platforms (combinations of CPU and OS) to choose from. IRIX, OS/2, SunOS, NeXTStep, MacOS 9, Windows 95 and dozens more. But most of those have passed away, and all of them were orders of magnitude slower than a modern smartphone. Cosm supported a large number of platforms, each loved in its own way, but going forward Cosm will focus on the platforms that are in common use today.

Operating Systems: Win32, Win64, Linux, Android, OS X, iOS. Endangered species: Solaris, FreeBSD, OpenBSD, NetBSD.

Host CPUs: x86, x64, ARM, ARM64, MIPS, MIPS64. Endangered species: PPC, PPC64.

Extensions like x86 SSE, ARM vector units, and OpenCL are handled through the accelerator framework, and run in or with a host CPU that detects them at run time.

Our Compile Farm – Platforms that Cosm is tested on regularly:

  • Windows: Win32-x86, Win64-x64.
  • Linux: Linux-x86, Linux-x64 (Amazon EC2), Linux-ARM (Raspberry Pi).
  • OS X: OSX-x86, OSX-x64, OSX-PPC (G4 MacBook).
  • Android: Android-ARM (Nexus 7), Android-MIPS, Android-x86.
  • iOS: iOS-ARM (iPhone 4s & iPad).
  • Clouds: Amazon EC2, Microsoft Azure, Google Compute Engine (where available).

The platforms will continue to evolve as they have since 1995. Porting the CPU/OS layer to a new platform has always been a quick process, so adding new platforms in the future will never be a problem. Any software using Cosm can build and run on 99.9%+ of the devices people use today including phones, tablets, desktops, servers, and clouds.

Cosm is Now Under the Apache License Version 2.0

All Cosm® code is now licensed under the Apache License, Version 2.0. The servers, the clients, the CPU/OS and Utility layers – the works. The transition to the Apache License allows a wider base of users to use the Cosm API, libraries, and applications in their own projects.

So why the Apache License 2.0?

We are all big fans of Open Source, always have been, and the legal landscape has change a great deal since 1995 when Cosm began. Back then it was extremely difficult to even construct an Open Source license that worked, with the only real choices being GPL and BSD. After a massive proliferation a few main licenses have survived and flourished. The Open Source Initiative and other organizations exist to promote Open Source. Things are much simpler.

So that leaves deciding which of the major players, GPL*, BSD*, Apache, MIT, CPL, Eclipse or Mozilla. Lots of common ground. The new license for Cosm had to be useable by anyone, including commercial software, since the individual components of Cosm are modular. For example, if you want to use CosmFS in your software, you’ll need a license that allows you to do so. It had to spell out the terms on issues like the patents, use of the Cosm trademark, and giving credit where it’s due, so that there is no ambiguity. It also needed to be compatible with as many other Open Source licenses as possible. At the end of the day and with where we plan to head with Cosm, Apache 2.0 won us over.