Possibly The Scheme Shell will be my third Lisp (after Clojure and Racket).
I need to do some more shell-scripting. And a Scheme for shell scripting sounds perfect.
Possibly The Scheme Shell will be my third Lisp (after Clojure and Racket).
I need to do some more shell-scripting. And a Scheme for shell scripting sounds perfect.
You all probably knew where this was going, right?
Of course, it’s been my priority to run the new MTC on the PocketCHIP. And it runs fine, without any special conversion; just needed to figure out how to install a library it depended on without going through drracket.
Now I’m off for my celebratory bike ride. 🙂
Got my PocketCHIP yesterday.
And here it is running Emacs, with a Racket REPL via Geiser.
I have to say, this has been the dream for a long time … a cheap, portable device that runs Linux, has Emacs, git, rsync etc. And I can actually write and run Lisp on it.
It has a keyboard / screen that can be used in emergencies, but can also be accessed via USB-serial and PuTTY from any old Windows PC. (Useful when you want to go somewhere which may have a PC but don’t want to take a laptop with you.)
I’ve been excited by small computers before. I do stuff with Arduinos. I have a couple of Raspberry Pis sitting around. And last year got very enthused by the possibilities of the ESP8266 running nodemcu.
But in reality, the RaspPi and ESP have both proven more awkward to work / play with than the CHIP.
The RaspPi’s problem is its dependency on HDMI. And lack of ability to log in by serial over USB. I don’t usually have an HDMI screen to hand. And not in the same room as a network router I can connect an ethernet cable to. And without one, plus special keyboard / mouse etc. And wired internet connection, it’s hard to do much with the RaspPi. I normally only use it in the local hackspace.
The ESP8266’s issue is dependency on a 3.3v power-supply. Which is awkward. Even with an FTDI cable to connect it to the computer’s USB port, you need EXTRA power of the right voltage to talk to it. I have to use a spare Arduino, just to get that 3.3v power.
It kind of pains me to say it, as I really want to champion the British innovated Pi over the American innovated CHIP, but the CHIP guys have done a magnificent job of making their board easy to use straight out of the box. The PocketCHIP is a master-stroke. I unboxed it, plugged it into a USB charger, switched it on, and was exploring and playing with the CHIP within a couple of minutes. It combines all the extra gubbins you need to do stuff with the CHIP in one, obviously cheap, but pretty usable, package. Even the keyboard is OK for small bursts of typing.
I got a PocketCHIP and two extra CHIPs. Even without the Pocket, being able to communicate with a bare CHIP via a terminal over USB makes it far more accessible than the RaspPi. Once I’d figured out a terminal program (I found cu works well) I was able to log in, set up the wifi, update and upgrade the Debian and install the software I want to play with, without any hardware beyond the USB cable.
I really hope someone comes up with a Pocket equivalent for the Raspberry Pi Zero soon. It makes a massive difference to adoptability. And I don’t really understand why the Raspberry Pi can’t be accessed over serial. It’s got USB sockets. Why can’t we do serial over them?
Long live Mind Traffic Control!
No New Year’s Resolutions or even questions this year. But as an honorary Brazilian, my new year doesn’t really start until after carnival, so now would be the time for it.
However here’s a quick update. The answer to the old MTC question is now resolved for me.
It’s time to put the bullet into the Mind Traffic Control that was. The case against it is overwhelming. MTC was written to learn the exciting new world of Google App Engine and the style of web programming of the mid to late 2000s … Python, something almost Django-like (ie. Rails-like). Backed by a relational database-like thing.
It’s a world I later fell out of love with. Python and Django are … fine. But they aren’t what continues to excite me in 2016.
I toyed with Meteor. But how to host on GAE? And, anyway, in 2016 I have the sickness … I just AM a Lisp programmer. Not necessarily a very good one or particularly experienced one. But I’ve succumbed. This is what I’ve been looking for all my life. It’s what I want to do, going forward.
So a rewrite in Clojure / ClojureScript. That presumably can be hosted on GAE. And I can have a wonderful new reactive UI with Om.
Yes … I’ve been playing around with it … but …
But then again. The old GAE database isn’t a good match for the circular queue of MTC. And worse, I’m not keen on storing my personal data on someone else’s cloud. Yes, it would have to be a single-page app. Yes, it ought to talk to remoteStorage and offer Dropbox etc. too.
These are all wonderful things and yes I am playing with them and want to use them. But … MTC? MTC is a todo-list app. There are a million and one such apps. They’re the “hello world” of browser-based GUI frameworks.
I’d love people to experience what’s good about MTC. But is it likely? How would I cut through the noise of those millions of alternatives? (Some of which are very slick.) Could I really get any kind of audience for a todo-list app in 2016? Does it make sense to put my energy in this direction?
And then again … if I’m going to boot up my browser and run a local server, then I have OWL.
OWL is great for more extensive, smart-disorganized note-taking. It’s just that it doesn’t have some of the charms of MTC. It’s not dynamic … tasks sit around and clog up the pages. You have to navigate around to find them. Sure, it’s pretty easy to navigate around – wikiness makes complexes of documents into small-worlds – but it’s still lacking that immediacy of the river / feed of tasks.
So last year I was fairly convinced that MTC was just going to become OWL hosting. But that isn’t what happened. There is still something to MTC, to the todo-queue concept. And it has resisted being subsumed within the OWL paradigm. My early enthusiasm for OWL was wrong about this. And my initial intuitions vindicated.
So what next? These last months I’ve been drawn back to the command-line. And also to Racket. Which compiles to fast executables. (Clojure is great, but the JVM does take a long time to start.)
And I’ve been admiring (again) todo.txt. Which in many ways is the right approach.
And so … I present : the new Mind Traffic Control. Which is, I admit, nothing but a short Racket program. That reads a file called “todo.txt” from somewhere on your machine. And does MTCish things with it.
– it’s (right now) a convenient command-line tool.
– it’s compatible with your existing todo.txt file. It doesn’t do everything that todo.sh does. But it has its own tricks.
– in particular, it keeps the queue-ness. You only see the latest item. And most of its commands are about flinging tasks you don’t care about now into the future where you don’t have to think about them (yet).
– obviously it loses a lot of what made the GAE-hosted, web-based MTC interesting. There’s no delegation to other users etc. But I’m not sure many people used that.
– very simple. very minimal.
I have to say … I am EXCITED by this … more excited than I’ve been by any potential refresh I could have made to the old MTC paradigm (even rewriting more or less the same thing in Meteor or ClojureScript / OM). This is fresh and different.
The Future : MTC has a new mission.
Firstly it’s going to be MY todo-queue tool. Previously, the web version was always thought about in terms of “what might people want?”. In practice, almost nobody else wanted it. Now MTC’s mission is “what do I need from a tool?” What maximizes my convenience? I like the command-line. I’m comfortable there. That’s where this is going to be.
Secondly, I’m not that into task-management software. I want software to help me DO stuff. And the focus of MTC going forward is going to be to add features to help me do. For example, I have an item with a link I wanted to read. I now read the link and want to post it to a link-blog. Can that feature be added to MTC? Why not? I come up with an idea for a new project and start putting todo items about it into MTC? Can MTC create the project directories for me? Can todo items be exploded into actual scripts? Within this environment? Once again, a direction worth exploring. (In a sense, MTC with extra tools could be seen as exploring the coming UI paradigm of bots in rivers.)
Syncthing is now my synchronization solution. I don’t think I’m going to worry about clouds and hosting, because I want to use horizontal P2P syncing as the way of making sure the queue is on all my devices.
The original MTC site will be updated shortly. You can, already, export your data from it in todo.txt format. That is now the recommended solution for MTC users. The new version of the site will probably continue to let you do that, without adding anything new to your queue. But it will give guidance on how to install and use the new software.
From hereon-in it’s all Lisp. I’m getting more fluent in Racket. I do have a nagging feeling that maybe I ought to convert to Clojure-like dialect. Which would allow me to use the same code in the browser, on a node server or even compiled using Pixie-Lang. I’m still thinking about this and will make a couple of small experiments in the near future and I’ll pay attention … will other people pick up the Racket code? Will I find myself with a new compelling reason to have MTC back in the browser? Is it worth moving to Rackjure to smooth a potential future port? Right now the code is still trivially small enough that I could port relatively quickly. But I’m watching.
Wow! Now this is weird!
I honestly don’t know what to make of Clojure’s ad-hoc hierarchies. I have, I confess, been missing a little bit of the polymorphism I’m used to with classic OO class-hierarchies.
This looks like it’s the answer to that. But hmmmm …. if I start down this path am I going to find myself reinventing standard OO capacities with a weird syntax? Does adopting these things mean I’m falling back from my FP sophistication to “class-based” programming? Is it the equivalent of abusing do to make my Lisp more imperative?
My Quora answer to the question “Is it still reasonable to say mainstream languages are generally trending towards Lisp, or is that no longer true?“
Based on my recent experiments with Haskell and Clojure.
Lisp is close to a pure mathematical description of function application and composition. As such, it offers one of the most concise, uncluttered ways to describe graphs of function application and composition; and because it’s uncluttered with other syntactic constraints it offers more opportunities to eliminate redundancy in these graphs.
Pretty much any sub-graph of function combination can be refactored out into another function or macro.
This makes it very powerful concise and expressive. And the more that other programming languages try to streamline their ability to express function combination, the more Lisp-like they will get.
Eliminating syntactic clutter to maximize refactorability will eventually make them approximate Lisp’s "syntaxlessness" and "programmability".
In that sense, Paul Graham is right.
HOWEVER, there’s another dimension of programming languages which is completely orthogonal to this, and which Lisp doesn’t naturally touch on : the declaration of types and describing the graph of type-relations and compositions.
Types are largely used as a kind of security harness so the compiler or editor can check you aren’t making certain kinds of mistakes. And can infer certain information, allowing you to leave some of the work to them. Types can also help the compiler optimise code in many ways : including safer concurrency, allowing the code to be compiled to machine-code with less of the overhead of an expensive virtual machine etc.
Research into advanced type management happens in the ML / Haskell family of languages and perhaps Coq etc..
Ultimately programming is about transforming input data into output data. And function application and composition is sufficient to describe that. So if you think POWER in programming is just about the ability to express data-transformation, then Lisp is probably the most flexibly expressive language to do that, and therefore still is at the top of the hierarchy, the target to which other programming languages continue to aspire.
If you think that the job of a programming language is ALSO to support and protect you when you’re trying to describe that data-transformation, then POWER is also what is being researched in these advanced statically-typed languages. And mainstream languages will also be trying to incorporate those insights and features.
OK. Consider me won over.
Lisp is great to work with. The things that grabbed me about FP in Erlang and Haskell (pattern-matching arguments, partial application, lazy evaluation) are all here.
My code is as concise as Erlang and damned nearly as concise as Haskell (I think the line count is similar though the number of characters per line is about twice as high)
Although I respect Haskell’s type system, Clojure’s dynamic typing holds me up less. I *am*, admittedly, hitting more problems that a type system would have picked up. (Far more than I typically hit in Python) but I think as I get more used to the language this will go down.
I’m not being particularly demanding in terms of libraries. (Quil is almost all the libraries I need at the moment.) But I’m finding that there are all these handy things like spit which make me smile. (Remember what this was like in Java?)
Things that would still be a bit fiddly in Python / CoffeeScript continue to turn out to be easier than I imagined they would be when I implement them in Lisp. That’s partly because I default to approaching them as “how do I write a small lambda that can then map across this list” and mostly, by the time I wrote that function, all I have to do is … er … map it across the list.
Lisp is extra-ordinarily compressible. I keep finding ways to refactor and fold up things I did earlier to make them shorter and shorter. And the more functionality I add to my program the more compressed it seems to get.
CoffeeScript isn’t at all bad, but if ClojureScript works out, then I’ll probably start to move aggressively to use it as my default in-browser language. (And yes, I guess that may mean rewriting OWL in it. OWL is still short enough that I think I could sprint it in a couple of days.)
Similarly, if I can compile Clojure libraries that can be called from Java projects then you’ll start to see me more productive on Android. (Beyond OWLdroid I have a couple of other bits and pieces of apps. written, but not taken them to completion. If Clojure slots painlessly into the workflow, it will be a lot more tempting to dive back in.)
So … yeah … Clojure rocks!
Having decided that this year was my Haskell year, I now find myself dabbling with … er … Clojure.
Why? Well, basically because of Quil which is a wrapping of the Processing library for Clojure. I need to do some Processing-like graphics, and I want to learn the FP way of doing it. Haskell would be great, but I’ve had a bit if hassle recently with trying to install some of its extra libraries so not I’m not so confident I can set it up as quickly as I need. Plus, Clojure / Processing also holds out a bit of hope I might be able to move what I’m doing to Android, which would be a bonus for what I’m working on at the moment.
So suddenly I’m back in Emacs. And writing Lisp as seriously as I ever have. It still looks somewhat verbose and cumbersome, especially compared to Haskell, but I’m finding that as I tweak and refactor, and get more familiar with the idiom, it starts to distil down to smaller and more elegant code. I’m enjoying.
Having contrasted Quora, positively with StackOverflow, I find that Quora is also starting to play the “word-shaping” game by which either an algorithm or a tone-deaf moderator decides to constrain how you are allowed to express your questions 🙁
No idea why they really feel the need to do this. But it basically has the effect of driving out all personal voice, subtle context to your question, potential for jokes, creative wordplay, malapropism, coining neologisms or anything else that keeps language alive and a delight for the intelligent mind.
Here’s my original (rejected) question :
Should I learn Clojure for Android programming?
I’d like to get into Android programming. But every time I play with it, I find it full of that verbose Java bureaucraticality that we all know and hate.
I’d like to work with a nice modern, higher-level language. (I’m mainly using CoffeeScript / Python these days) So, would it be worth me learning Clojure to do Android programming?
By this I mean two things :
– can you write Android apps. in Clojure at all (is the tooling there?)
– does Clojure buy you anything in the Android world? Or will I still be making the same long sequence of imperative calls to the same Java libraries that I’d be doing in Java? Ie. for this kind of application there isn’t much “compression” in Clojure compared to Java
I’m not saying this is a great question. Or perfect example of writing. But it is MY question, the way I wanted to phrase it.
Update : Got into a certain amount of argument about this. (Partly because I’m complaining.)
Here’s what I found myself replying :
If people prefer not to answer the question, that’s their prerogative. No problem.
The point is, is Quora going to set a “maximum sophistication” limit on questions, so that people who are capable of understanding a question that requires three paragraphs to capture its full meaning, are nevertheless prevented from writing or reading such questions because Quora has decided that only single-paragraph questions are allowed?
I think that will be a catastrophic loss. For me because I like Quora. And, I think for Quora, because it will become a less interesting place to be. I’ve already seen this happen on StackExchange. A place where I used to hang out every day, but where I now spend as little time as possible.