Wednesday, October 9, 2019

UNIXem versions 1.9.2 - 1.11.4 pushed to GitHub

UNIXem - Unix-emulation library for Windows - is a small and simple library that provides emulation of several popular Unix API functions on the Windows platform. Its primary purpose is to assist Windows programmers who are porting to Unix or are writing multi-platform code.

Prior to version 1.9.2 it was available on the (currently moribund; soon to be turned around) Synesis Software website at http://synesis.com.au/software/unixem.html; henceforth newer versions will be provided at https://github.com/synesissoftware/UNIXem.

A few days ago I received a pull request notification on UNIXem, to correct a syntax header in one of the headers. This prompted me to update and reconcile the GitHub repo with the internal source control. This has now been published, and all updates over the last 8+ years are now available. The significant changes are:


  • added mkdtemp();
  • added mkstemp();
  • added unixem_timegm() / timegm();
  • modified glob():
    • GLOB_ONLYFILE => GLOB_ONLYREG;
    • glob() now preserves dots directories when included in leaf-most pattern part;
  • renamed setenv() => unixem_setenv()unsetenv() => unixem_unsetenv();
  • fixed defect in unixem_setenv();
  • built library name changes from "unixem(.X)" to "unixem(.X).core", e.g. unixem.lib => unixem.core.libunixem.1.lib => unixem.1.core.lib;
  • removed include/sys/select.h (which was vestigial);
  • build/project files:
    • added VC++11, VC++12, and VC++14 support;
    • moved VC++6 project file from build/vc6 to projects/core/vc6;
    • added VC++ 10 project files, in projects/core/vc10;
    • added VC++ 10+ props file(s), in projects/vcprops.

Wednesday, April 10, 2019

CLASP & libCLImate : different language implementations converging

I'm working on CLASP and libCLImate for Ruby, Go, .NET at the moment, and they're getting close to a 1.0 release, particularly CLASP.

There've been two recent releases of CLASP.Ruby:

  • 0.17 adds a CLASP::Arguments.load() method, which takes a Hash or YAML-containing file (actually an IO type), containing definitions of the flag/option/alias specifications;
  • 0.18 changes the name of the concept from alias to specification, removing the ambiguity that's been bugging me for years.
The same changes will be made in the Go and .NET versions shortly. The Python and Node versions will change in the medium term.

Once all the other variants are done, the original C/C++ library will be done.

Friday, March 29, 2019

Lots of new things to Go at ...

The Go work is marching on, with the occasionally publicly publishable parts, the most recent of which are:

  • ANGoLS (Algorithms Not found in Go Language Standard library) first release to the world;
  • STEGoL (Simple Testing Enhancements for Go Language) first release to the world;
  • CLASP.Go v0.14.2, much improved and working seamlessly with libCLImate.Go, of which:
  • libCLImate.Go v0.4.1, again much improved.
ANGoLS and STEGoL are new, and so are suffering from the Matt Wilson-disease of poor/missing documentation, but CLASP.Go and libCLImate.Go are now replete with information and examples. Checkout them out. Feedback welcomed.

Watch this space - and the Synesis Twitter and Synesis GitHub accounts - for more Go stuff in the coming weeks. libpath.Go and recls.Go are imminent. Pantheios.Go will be released by mid-year. (And there'll likely be plenty of webservice-related libraries, too, given that's the current focus of Go development here ...)

Monday, March 18, 2019

A bunch of CLASPs

CLASP - Command-Line Argument Sorting and Parsing - is a suite of libraries for sophisticated parsing of command-line arguments and presenting the parsed elements - flags, options, values - in a usable form. The original C/C++ library was released in 2011; variants for other languages have been released from time to time since.

Of necessity (but also enjoying it), currently I'm building systems in a bunch of different technologies, including GoJavascript (NodeB), Python, and Ruby. As such, I have new/updated versions of the CLASP variants for these languages:


Each of the newly-released projects - Go, js, Python - contains  (on GitHub) an EXAMPLES.md file, with links to examples. CLASP.Ruby will provide examples in a forthcoming release.

Friday, February 15, 2019

Simple cat in CoffeeScript

Further to the post "Simple cat in Node", here's a version in CoffeeScript.

#! /usr/bin/env coffee

fs = require('fs')
readline = require('readline')
paths = process.argv.slice(2)

cat = (path) ->

stm = if path then fs.createReadStream(path) else process.stdin

readline.createInterface(
input: stm
).on 'line', (line) ->

process.stdout.write line + '\n'

return

  return

if 0 == paths.length

cat null

return
else

  // process each one at a time
paths.forEach (path) ->

cat path

return


As you can see, it's very simple in structure to the JavaScript version; just simpler and with fewer parentheses. It can be further simplified by removing all the return statements, as every one is redundant in this case:

#! /usr/bin/env coffee

fs = require('fs')
readline = require('readline')
paths = process.argv.slice(2)

cat = (path) ->

stm = if path then fs.createReadStream(path) else process.stdin

readline.createInterface(
input: stm
).on 'line', (line) ->

process.stdout.write line + '\n'

if 0 == paths.length

cat null
else

  // process each one at a time
paths.forEach (path) ->

cat path