Content from 2014-11
:tangle filenamefor 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 in Clojure 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
.orgfile, but that's it. I'm not really sure how I'd want to use this to write a large project of any kind.
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.
ASDFhas 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.
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, Esperanto, Emacs, Electronics, Education, Dog, Did You Know That?, DRM, Community, Comics, Colgate, Code, Buddhism, Books, Aside, Anarchism, 3D Printing
View content from 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, 2019-03, 2009-03