15 comments

[ 3.0 ms ] story [ 47.8 ms ] thread
I'm constantly taking advantage of this on News.YC.
"Well, Perl/Ruby/PHP don't run persistently on the server."

Depends on the server. It's hard to find a Ruby webapp that runs non-persistently.

And it doesn't matter anyway. He's talking about adding records to the DB and uploading images, the same things you'd do through a web interface.
Huh? I have seen the same done with rails over and over. Well kind of.
Really? You've seen folks running SSH into a server and firing up irb to add a blog post?
As a primary interface for blogging, perhaps not. But using irb and your ORM as an admin interface to your database? Absolutely.
"Couldn't you write some standalone scripts to run from the commandline to insert new posts into your blog?"

As someone mentioned in the comments on that site, there's no need to write special scripts for this - using script/console does the job nicely with Rails.

  script/console
  post = BlogPost.new("title", "body", ... )
  post.save
  ^d
You're modifying the database vs. in memory objects, but when you're scaling up via multiple app server instances, it's handy to store the info in the db.
yeah thats what I meant. Not quite the same as the article, but to similar effect.

I do appreciate the "lisp" approach though, for sure.

You can certainly do something similar with other languages under the right constraints. For example you can fire up a copy of your application from the command line (or from within Emacs using IPython mode for example). The difference is that you're not connecting to the same instance as the web server so for example you can't change in memory constructs. But for an applications that uses a database for data storage you can certainly accomplish similar things.
I've been enjoying this capability with Erlang too.
So you just execute a lisp statement (post "headline" "mybody")?
I'm at the opposite end of the spectrum. I used Scheme to make ourdoings.com. I know how to open up a REPL on the server but I never have. To keep me motivated to implement features in such a way that anybody can use them, I maintain a strict discipline of not doing anything that I haven't made a user interface for. This keeps me motivated to implement new features for all my users.
Accessing functions from a shell is available to lots of programming languages. Be it naturally or through an add on.

It sounds like Mr. Carper just likes what's familiar to him, which is the real benefit.

I do like the idea of a command line style interface to a blog.

"When I want to post a new model, I SSH to my server, fire up Emacs, connect to the Lisp running on my running server via local SLIME, and run an ADD-MODEL function. Simple. Lisp automatically timestamps my posts, and checks for empty-string model names, and all the other good stuff you'd want from a control panel. (Plus if it fails, I get a debugger.)"

yea sounds it...

My thoughts exactly.

I mean, that's great for him personally and all, but "Step 1: Use Emacs" pretty much makes this a non-starter for something like 95% of the people in the world who might run a blog or personal website.