domingo, 9 de octubre de 2011

Emacs 24 is frozen

Emacs 24 entered the feature freeze state a couple of weeks ago, so it's the moment to install it and start fiddling with its new features (I want to try the editable occur buffer, and some asynchronous goodies for gnus).

There have been a couple of posts in planet emacsen that explain how easy is to install it in debian or ubuntu (natty).

The thing is that I use an older ubuntu version and I had to compile it myself. Not very problematic, but here's the couple of libs that I had to install before being able to compile it. Obviously, you'll need the usual binutils and dev tools. also you'll need these packages.

apt-get install autoconf texinfo libxpm-dev libgif-dev libgtk2.0-dev xserver-xorg-dev xorg-dev libfontconfig-dev libfreetype-dev libxft-dev # probably, not everything is needed, but once you warm up, apt-get is too easy.

Then, just get the code from the repo, and configure install in proper directory:

git clone https://github.com/emacsmirror/emacs.git 
cd emacs
./autogen.sh
./configure --prefix=~/emacs-24
make install


Now you have your emacs in ~/emacs-24/bin/emacs, and hopefully, everything will work from the beginning. I had to disable a couple of lines in my .emacs file, but just minor things.

Now it's time to try emacs-starter-kit 2.

martes, 4 de octubre de 2011

Is it really that bad? Seems so

In the last couple of days there's been quite a lot of ranting about overly complex software we have to manage daily. It applies to software we use (super-complex UI and over-featured apps) and software we develop Does it really make sense to deal with so many layers of added complexity to deal with mostly simple (conceptually) problems.

In those texts, they talk about 'old friends' like boost, SDL, Xcode, Objective-C, never-ending-toolchains, and supercomplex interfaces to third party software (APIs, security layers, etc.).

In my opinion, and without having spent as many years as those guys (or commenters at HN) on computers, it's true that the starting barrier to any new environment seems overly complex for the functionality we get. Most of the times, external tools solve deficiences of languages. Being a tool geek myself (probably, I have spent more hours than you trying and configuring window managers and editors), I have the feeling that entering most of new environments is more complex than it should be.

Want to do a rails app? no problem, you just have to handle a few technologies/tools:
ruby, rails, cucumber, rspec, rack, passenger, bundler, rvm, gems, html, js, ajax, css. Then, keeping compatibility with Chrome, firefox, safari, opera and, God forbid, IE.

Not bad, eh?

Well, if you want to write the views in a more confortable way, you can use haml, sass, compass, coffescript, that will compile to their ancestors, and will make you a happier person.

You see? (I hope you get the sarcasm)

Every now and then I think about Dan Ingalls quote:

"An operating system is a collection of things that don't fit into a language. There shouldn't be one"


And drool when thinking about smalltalk.

martes, 27 de septiembre de 2011

Bihain de uindou

Demasiadas veces mirando por su ventana y quedándome en blanco. veo
que algo se mueve ahé dentro, y veo la ventana mirándome, y la veo a
ella mirandome a través de la ventana. A veces, incluso me veo a mi a
través de ella a través de la ventana.

Y aún no sé qué decir (me y le). Y te.

Señalar con el dedo y ver el nombre en verde.
Clicar. Cerrar. Clicar. Cerrar. Y repetir.

sábado, 17 de septiembre de 2011

Amber language (former jtalk), digging deeper


Lots of changes have happened in jtalk world since last week.
  • Jtalk is now Amber. The project has changed its name when the 0.9 release happened. That means that the repo is now different, and the website too.
  • JQuery bindings have been removed from the system. Now we can access javascript objects directly, and use asJQuery in the same way, so there's no drawback, only the way to deal with jquery is more smalltalkish. Counter new appendToJQuery: 'body' asJQuery works perfectly, so no problem.
Creating functions
If you want to know a bit more on amber, you have to keep in mind that it's a smalltalk, so you can explore everything in your IDE. Let's try to find out a bit more on how the compilation from smalltalk to js works. This will allow us to debug our in a lower level than usual, and find glitches in our codes, or detect where our closure is missing the variables (when interfacing with js, sometimes it's useful to see the whole js code, and make conclusions on js).

Let's create a new class Foo with a method that gets a block (callback) and executes it. Now, to find out how it's compiled, we'll make amber print the compiled source of the method:
(Foo methodDictionary at: 'get:') fn compiledSource "print it".

If we print it, the result will be the js source of the method



You can try variations like returning explicit values, try to pass instVars to the closure, and see what is the translation to js. This helps sometimes to find out your way.

Can I inspect?
Inspector is there, but for the moment, it's in very early stage.

Debugger
Debugger is also there, also in early development. You can see the stacktrace, and inspect the methods, but not changing values and so.

NodeJS

We can use amber for the server side, running the generated javascript on node.js. Due to the hability of Amber to interoperate with plain js, we can use a shitload of libraries from amber. Here follow a couple of examples of amber on node.js

Server
Nicolas Petton wrote a fileserver meant to be used in the node.js side. This allows us to commit changes to our files transparently without the need of webdav,python(see last post), or any external server. It's Amber all way down.

The usage is fairly easy. Just cd to the root amber directory and run ./bin/server, that will run ./server/FileServer* things.

IRCBot
Trying the node.js part of amber, we can try to build a small program, and as no programming language is complete unless it has a IRC bot in it, let's solve this issue:) Btw, I hacked a couple of emacs functions to deal with st files a bit better.

domingo, 11 de septiembre de 2011

can your editor^W OS do this?



Here is an emacs feature that it's hard to believe until you see it working.

m-x butterfly


Unbelievable, no?

Well, let's link this amazing functionality to the gesturing strokes-mode.

m-x strokes-mode
m-x strokes-global-set-stroke


Then, click in the buffer that appeared, and draw(drag) a circle with your mouse. when you end, press the right button.

now emacs will ask you for a command. Now it's the butterfly turn. write 'butterfly'.

Ok, now you have configured and amazing mouse gesture that will flip bits on your hard drive only by reproducing the figure (circle) you just did before.

in any buffer, press shift and draw a circle dragging the second mouse button (mouse wheel probably).

ENJOY!

PS: I've changed the shortcut from the second button to first, and now I can use my tablet to manage emacs. And here's another great thing of the ubiquity of emacs: You can use it to manage things related to irc,jabber,mail,text editing, playlist managing and even pdf reading. neat.

viernes, 9 de septiembre de 2011

emacs and smalltalk, a bit closer

Today I've been hacking around with jtalk. Implementing something for the node.js backend means that probably you'll be using your editor of choice.

I've downloaded paolo bonzini's smalltalk-mode.el

I've hacked some shortcuts to navigate through classes using emacs narrowing feature.

Here's the hack:

jueves, 8 de septiembre de 2011

HN Frenzy

HackerNews is not in its greatest moments lately, but today, lots of diferent great articles/links appeared. It's a bit overflow of info in just one moment, you open a handful of links and you face.



Not in HN but a tiny example of how cool is the project that's driving some of smalltalkers to sleep 4 hours per night.Jtalk. Credits on that go to Bromagosa