A quick update (for me, as much as anyone else) of where I’m at and what I’m currently thinking about … March 2017:

ClojureScript and Reagent

I want to get up to speed on this as my standard way of writing browser based software. React seems to have conquered the world as browser based, reactive framework. And with React Native it’s also come to mobiles. It seems that the ClojureScript / React Native story is becoming compelling too.

So, yes, this is mainly how I want to do GUIs moving forward. I’m doing some experiments. Expect, eventually, Patterning and some of my other projects to move to this.

WebAudio

A friend of mine has sold me on the idea of going back to audio in the web-browser. Which is obviously a great way to make little musical apps that are easy to share with people. He’s not so keen on ClojureScript but does like Javascript in a functional style with Redux and Immutable.js so we’ll probably be using them on a collaboration. I’m considering porting versions of Gbloink! and Zewp! to it. Along with more of my current Processing based “ArtToys” Library.

Lisps on Android

It may be that ClojureScript + ReactNative is the right way to go. But I’m also looking at Clojure on Android. And Racket on Android.

Reading online it seems that Clojure on Android has been improving, but is maybe not as efficient as ClojureScript with ReactNative. And, also obliges you to deal more directly with the Android Java frameworks. Maybe something that’s useful for larger, more framework intense, applications.

I was originally tempted by LambdaNative, a Scheme for Android app. development. But it now looks like Racket’s Android story has improved considerably and is quite similar. Especially sharing the focus on using OpenGL for visuals. Racket on Android basically compiles to C and uses the NDK, which might be a faff to get working, but might also be more efficient. One to have in the arsenal.

Also, of course, Racket on Android would let me keep a common Racket code-base for both the command-line and an Android version of Mind Traffic Control.

Rosette

I’m kind of intrigued by Rosette and the idea of “solver aided” programming. And being a Racket DSL is a bonus. I want to get my head around this, this year.

Music Languages

Last year. I did a lot on Sonic-Pi. This year I thought I’d go back and take another look at Overtone. Which is, in many ways, the predecessor of Sonic-Pi done as a Clojure library.

It’s not quite as simple as Sonic Pi with its integrated development environment but Clojure is
more powerful than Ruby.

While I still think that Faust looks cool. I’ve also been tempted by the lower-level simplicity of CSOUND … wondering if it might make sense to write a CSOUND generator in Clojure. I’m slightly pulled backwards and forwards on this question. Plus, Overtone provides its own synth-design functions.

Project ThoughtStorms

So, I haven’t trumpeted it here. But last year I moved away from the Smallest Federated Wiki for ThoughtStorms. See ThoughtStorms:LeavingTheSFW for the full story.

Here I’ll just note … I’m very happy with the decision, and I have lots of ideas for how to develop my currently very minimal wiki engine to do more of the things I want to do. In many ways, this is like the MTC reboot of last year.

Small Boards

I’ve become a bit of a collector of small hobbyist / maker boards, from Arduino to last year’s CHIP. I’ve just got a couple of BBC Micro:Bits which are great fun. These are a really smart and original idea in what’s becoming a crowded and competitive market. The computing power is pretty minimal. But what gives them an edge is that they’re packed with sensors. And come with their own primitive display.

I’m looking forward to playing with and giving these a good run for their money.

Interestingly they run MicroPython. Something I hadn’t really looked at before.

Python

All of which means, despite last year’s thinking, that I’m actually renewing my relationship with Python. I really thought I was deprecating it in favour of Javascript. This year, that seems fairly unlikely. Python just is nicer than Javascript in so many ways. It’s the back-end of my new wiki, which I’m planning to extend. It’s the language of the Microbit and potentially useful on other boards. It’s getting ported to the GoLang infrastructure and perhaps has a great future in front of it there. Meanwhile, even a tiny serverside JS program with node.js seems to install a million dependencies.

So Python is definitely here to stay in my near future.

QaSaC

A rather crazy art-project I dabbled with last year spawned an interesting toy / esolang : QaSaC. This is little experimental “concatenative” language like Forth and Joy cross-pollinated with a visual data-flow language like Pure Data.

I think there’s some potential here. And I’ve really enjoyed the concatenative / stack-based thinking and elegance of this kind of programming. So I am working (albeit slowly and interspersed with everything else) on getting an actual viable version of this out soon.

OK. I think that’s a pretty comprehensive list of my obsessions for 2017. Let’s see how much progress I make with them all. This year, I promise, I’ll be trying to release, and blog, more often about them.

Posted in Me.

Interesting to go back to Stevey’s Blog Rant from 2006.

Quite perceptive … the ascendent Lisps today, at least the ones that have caught my attention, are Clojure and Racket. Neither of which really existed at the time he was writing (although Racket’s ancestor, Dr. Scheme did). Both of which do, indeed, have offered a layer of practicality and accessibility that perhaps other Lisps of the time lacked.

Posted in Uncategorised.

So I wasn’t actually planning this. But I’ve been working on Patterning again in the last week or so.

There’s a new version coming.

The bad news is that it’s going to break the “API” and your existing code. 🙁

The good news is that there will now actually BE an API. A real one, made with Protocols and defrecords that should be usable directly from Java without yet another wrapper. And will hopefully be more stable in future. 🙂

So, sorry for any inconvenience. But I think it’s all going to be a lot better from here on in.

Posted in Uncategorised.

Clojure is a wonderful language. The more I use it, the more I like it.

But the default error reporting is catastrophically bad, forcing you to look through screensful of Java stack-trace for the needle of a bit of code that’s actually yours.

I’m sure there are better solutions, but today I just hacked a very quick and dirty python program to filter this result, highlighting the lines that I care about.


#!/usr/bin/python

import sys
p = sys.argv[1]

for line in sys.stdin :
    if p in line :
        print '33[92m' + line + '33[0m',
    else :
        print line,

I made this code in an executable file called “colourit” in my bin directory. Now I can do this :


lein test |& colourit patterning

to, for example, highlight lines containing the word “patterning”.

Posted in Uncategorised.

So Clojure is getting Reader Conditionals ie. a way to put Clojure / ClojureScript etc. variants into ordinary source files.

It’s like .cljx files but without the separate pre-processor. Now the Clojure / ClojureScript compilers themselves will be able to pick out the variant of the code relevant to them.

Most of Patterning’s core is in .cljx format. I’m looking forward to moving to .cljc but it seems like this feature is so new (only in Clojure 1.7) I’d be better waiting a bit longer.

Posted in Uncategorised.

Wow! Figwheel looks pretty damned interesting.

Another item for my Mind Traffic Control queue … try using it for Patterning apps.

Posted in Uncategorised.

A few years ago I looked at some of the programs I was writing, both for public release and libraries / scripts for internal consumption, and realized that even I was confused.

I needed a new map to understand what I was doing. Hence I came up with Project ThoughtStorms. A quick and dirty overview of what I was up to in this space of wikis, personal information and knowledge management.

I think that helps. I know what I’m up to, with the legacy of my ThoughtStorms UseMod wiki and SdiDesk, my experiments with Smallest Federated Wiki, the new OWL stuff, etc. It’s still a mess, but it’s conceptually “encapsulated” in a single place.

Now I find myself with a similar situation with a number of different tries at some tools to make it easier for me to produce static web-sites. Originally there was GeekWeaver, a way for me to generate static sites quickly and easily from an OPML outline. That was a great idea … except … it got mixed up with my n00bie enthusiasm for Lisp and desire to create a powerful Lisp-like programming language.

GeekWeaver also foundered on two other issues : soon after I wrote it, there were no popular OPML outliner tools. Although Dave Winer has resolved that issue and I have, indeed, used Fargo to author GeekWeaver programs.

The other, more subtle and pernicious issue is that few people want to develop a site from scratch these days. Most people use huge frameworks with not just Javascript, but CSS, LESS etc. It really doesn’t make sense to try to use a tool which denies the file-system or the fact that you’ll want to be working with a large number of external files.

So the next time I needed to produce some quick static pages I went back to the drawing-board and came up with BootDown : a very simple Python script that lets you write text in Markdown and wraps it in a BootStrap / BootSwatch template. It’s the opposite of GeekWeaver, it isn’t trying to be a rich and clever language that lets you define your own templates, it’s just a quick way to take advantage of a lot of templates that already exist.

BootDown adds two things to conventional Markdown. A shorthand for declaring div tags. And a page separator. So you can still make a multi-page site inside a single file. And you can explicitly reference the div classes and ids you need.

More recently still, I’ve been getting into a real Lisp : Clojure. Today, that’s the language I really want to be working with. And I have a current project that again involves generating a multi-page, fairly static site. But the inputs are a little bit more complicated : some more structured data, not just text. And it makes sense to store it in an outline. So I’ve started writing Clojure code to read OPML and spit out a BootDown Markdown file, to wrap in HTML.

I can see this project starting to grow too.

And so here I am … three Python code-bases : GeekWeaver, BootDown and the OWL back-end server. Two Clojure projects : the beginnings of a library to work on OPML outlines (OPMLKit) and my unreleased code I’m writing for this current project. And some clunky pipelines to use them together. It’s starting to be another mess. And that’s why I need Project GeekWeaver : an umbrella to pull together these different strands together, at least conceptually.

There are some thoughts … would it make sense to pull at least some of the original GeekWeaver code INTO the OWL back-end server? So that “run transformations on this outline” is a standard OWL feature, and OWL becomes GeekWeaver’s built-in IDE? But what about the OWLdroid version that doesn’t have Python? Should I rewrite that code in CoffeeScript. (Or ClojureScript … a working but still fairly slow option at the moment.) BootDown “just works”. Am I better off scrapping the GeekWeaver idea altogether and just focusing on such practical solutions?

Some of this will become clearer as I work through this current site I’m making. meanwhile Project GeekWeaver is the category and (shortly) the site for the high-level overview.

Posted in Uncategorised.

Further to this story.

I tried to deploy another small Clojure library to Clojars today. And found myself being asked for the passphrase to sign my update.

You need a passphrase to unlock the secret key for
user: “phil jones
2048-bit RSA key, ID XXXXXX, created 2012-03-05

I got into a terrible confusion. Because, for the life of me, I couldn’t remember what passphrase I’d chosen to sign my Clojar last time. Had I just locked myself out of my Clojars account and the existing group and Patterning project?

A couple of hours faffing and I figured it out :

– my previous library WASN’T signed. It’s just in “Clojars Classic” and isn’t “promoted” so doesn’t require signing. That’s why I don’t remember signing it or inventing a pass-phrase.

– the reason that lein deploy was demanding a pass-phrase THIS TIME, was that in this library I’d decided to remove the word SNAPSHOT from the id in defproject.

lein deploy assumes that SNAPSHOTs default to being deployed in classic (the “free-for-all” part of Clojars) whereas non-SNAPSHOTS are intended to be deployed in the new “releases” repository, which is slightly more formalized arrangement, requiring author signing.

– I have gpg on my machine, and I did set up signing for my email address a couple of years ago. This was nothing to do with the previous library I put on Clojars. It was when I was experimenting with encrypted email. (A practice that I’ve embarrassingly let slip since then, but should really go back to.) So that’s the pass-phrase that was being demanded, and that I’ve managed to forget (from 2012, not end of 2014). Not impressive, but not quite as bad as creating one four months ago and then totally forgetting about it.

That still leaves me with some problems when I eventually will want to put my libraries into “releases”) but at least I can still use Clojars. The library will have to continue as a SNAPSHOT though.

Posted in Uncategorised.

Bloody hell! I just wrote a blog post and WordPress lost it.

Grrrr …

The short resume was :

– yes, I’m late (Feb) continuing my “Welcome to 2015” blog posts.

– last year I got the functional programming bug. Haskell is pretty damned good, but I’ve fallen for Clojure because a) dynamic types, b) Lisp syntax(lessness), c) Paredit.

– last year I did more Python, but not much OWL. This year, OWL is calling again. And as well as making me want to rethink Mind Traffic Control in light of it, is also seeming to demand some kind of pivot on GeekWeaver.

I’ll be coding and blogging more on this ongoing development in coming weeks / months.

I’ve also been playing a bit with remoteStorage, but nothing to show yet.

Posted in Uncategorised.

Well that was surprisingly painless.

I’m in the process of reorganizing the code for Patterning, my Clojure library that produces (visual) patterns.

Patterning was built using Quil, which is a Clojure wrapper around Processing. But I wanted to be able to call the library directly from Processing itself (Java version).

It seemed silly to create an uberjar file containing the whole of Quil and Processing, to be called from … er … Processing, so I decided to split the project into the core (pure Clojure, no Quil or Processing dependencies) and a Quil based wrapper.

I’m also, compiling the library using ClojureScript to run in the browser. (Called from Javascript). Once again this part doesn’t want any Quil / Processing dependencies.

But I was a bit stumped with how to manage some of this. My previous experience of projects that rely on other projects (git submodules) has been somewhat painful.

But it seems the Clojure (via Java) world has actually sorted this. All I needed to do was create an account over on Clojars and type :

lein deploy clojars

to put the JAR for my Patterning library there.

And so here it is.

Including it in a new project is as simple as referencing it in the project.clj file. There’s a simple test project which combines both Patterning and Quil. And here’s the very simple project.clj file. Note the patterning dependency.


(defproject com.alchemyislands/patterning_quil "0.1.0-SNAPSHOT"
:description "Quil Wrapper for Patterning library"
:url "http://alchemyislands.com"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/math.numeric-tower "0.0.4"]
[quil "1.7.0"]
[com.alchemyislands/patterning "0.3.0-SNAPSHOT"]]
:aot [patterning_quil.core]
:main patterning_quil.core
)

And that’s more or less it.

If you want to use Patterning in your own projects, just include it like that. If you still want to be using Quil, then use this as your example.

BTW: the new development for the core Patterning library is now at https://github.com/interstar/Patterning-Core

Posted in Uncategorised.