posted on 2014-11-21 22:17:00
Tried out literate programming a bit today using some info from Sacha Chua's
blog (mostly). It's actually pretty difficult to figure out how to make it work and what was strangest for me was that I can't figure out how to put a whole bunch of code blocks into the same file. It seems like you need to specify a
for every block!
#+begin_src clojure :tangle "chapter1.clj"
What I was really hoping for was defining a new file at each section. John Zahng
invited me to work on SICP
with him and I thought it was a particularly good case for trying out org-mode's literate programming functionality. After an hour or two of trying, though, I don't know how to make it do what I want. I can get it to dump all of the code into a file with the same name as my
file, but that's it. I'm not really sure how I'd want to use this to write a large project of any kind.
posted on 2014-11-13 16:33:00
For a while, I'd been working on cloning twitter in Lisp, since I'd been playing with Lisp web frameworks (weblocks, hunchentoot, caveman, clack) for a while. Now that I know so much more about web development, it seemed like a perfect chance. Also, with hunchensocket around, I could do push notifications with websockets, too, which Rails can't without third party services.
I have a site up now, at Chirp
, after many hours of beating my head against the wall. I thought I'd write down some major points for others who try to sort the madness out.
- Your app will be compiled, don't expect it to behave like you're running it from the REPL.
I had my configuration defined using envy's
(defconfig) in the top level of a file. That meant that all of the configurations were defined at compile time, when the environment variables I was using weren't defined. So, I had a few nil's in my configurations.
Now, I wrap the
(defconfig)'s in a function call when the app starts up. Works like a charm.
- You don't own the database, you just get to use it.
CLSQL doesn't have permission do do a number of things you might have been doing on your own database server. I had a helper function that made the database and tables if they didn't exist. I got a lot of complaining about "template1," which seems to be some internal postgres thing that administrators get access to. Don't use
(clsql:create-database), they both try to do things they're not allowed to.
- Getting environment variables is a necessary evil.
Environment variables are not a first-class part of the lisp world, but they're not too hard to get to. Heroku uses a lot of them to show you your configuration, pay special attention to
You can get at these two ways.
ASDF has a private
(getenv) function, which is handy and generally available. If you're using SBCL, you can also
(require 'sb-posix) and use
(sb-posix:getenv). It has a sibling,
(sb-posix:setenv), should you need it.
Hopefully, we'll make a better, more user-friendly buildpack, soon.
posted on 2014-11-11 14:15:00
So, back in July I took the plunge and decided that I wasn't cut out for the world of Academia. Grad school was taking an emotional toll that was turning into a physical toll and wasn't paying the fulfillment dividends that it needed to. I'd spent years acquiring very specific skills in quantum computing research that people didn't value at all. The pay was terrible. The social environment was terrible. The management was terrible. It was time to leave.
So I went ahead and enrolled in App Academy
, which my friend Scott
Most importantly, I feel like it's a good life choice. I miss doing physics, but the universities have made it such a horrible environment to work in, it's not worth it to me, anymore. I'm happy I get to keep problem-solving in programming and, if I'm lucky, I'll find a job that uses my considerable skills in debugging and engineering.
The Job search starts today and I'm confident it will give me a fuller life than a career in Physics was offering.
This blog covers vegan, ice cream, Work, Vegan, Uncategorized, Rust, Resistance, Research, Repair, Recipes, Physics, Nest, Music, Lisp, Linux, Links, Link, Life, Language, Information, Image, Gnome, Games, Gallery, Food, Fascism, Esperante, Emacs, Electronics, Education, Dog, Did You Know That?, DRM, Community, Comics, Colgate, Code, Buddhism, Books, Aside, Anarchism, 3D Printing
View content from 2009-03, 2009-04, 2009-06, 2009-07, 2009-08, 2009-10, 2009-11, 2009-12, 2010-05, 2010-06, 2010-07, 2010-08, 2010-09, 2011-01, 2011-02, 2011-03, 2011-04, 2011-06, 2011-07, 2011-08, 2011-09, 2011-10, 2011-11, 2011-12, 2012-01, 2012-02, 2012-03, 2012-04, 2012-07, 2012-08, 2012-09, 2012-11, 2013-02, 2013-03, 2013-04, 2013-06, 2013-07, 2013-09, 2013-11, 2014-01, 2014-02, 2014-03, 2014-07, 2014-11, 2014-12, 2015-01, 2015-02, 2015-07, 2015-10, 2015-11, 2015-12, 2016-01, 2016-05, 2016-08, 2016-10, 2016-11, 2016-12, 2017-02, 2017-06, 2018-04