Photo of the author
The Blog of Fourthbit

by @alvatarc - Á. Castro-Castilla

The Best Programming Language (or How to Stop Worrying and Love the Code)

Every once in a while, someone, somewhere, decides it’s time to write yet another post on what’s the best programming language, the mighty properties of a forgotten language, or the new language that does it right. So my time has come. Finally, I get to say what I think about programming languages.

First of all, a disclaimer: unless you’ve developed in 30+ languages, and suffered the code of others in all (or most) of them, you can’t really be objective. So yes, I’m biased. Like most of the people writing about this topic. Actually, I believe that this topic becomes absurd as soon as you are well-versed in many languages.

…continue

SchemeSpheres v0.6 release

  • Support for Android.
  • New generators, with Android support: (minimal, remote REPL, SDL OpenGL application with remote inspection/debugging).
  • Fusion/Sake tasks handle Scheme/C/Java avoiding recompilation whenever possible.
  • Full SDL2 bindings.
  • Full OpenGL/ES2 bindings.
  • General improvements to the overall infrastructure and bug fixes.
  • More functionality in several spheres.

If you want to try it out follow these quick instructions (or check out the Quickstart and Installation Guide):

…continue

The end of 2013 brings SchemeSpheres v0.4!

The new pipeline for the Gambit Scheme compiler (featuring modules and dependencies processing, hygienic macro expansion, and library/executable compilation) is ready for Linux. With this new release, we get these (very important) changes:

  • Riaxpander is the new hygienic macro expander. This brings a number of advantages, the most important ones being better macro debugging and better define-macro / syntax-rules interaction.
  • Optional positional and named parameters are now available.
  • Spheres and Sake programs got fully refactored to make them more solid, extensible and maintainable.
  • Sake now accepts extension tasks more naturally, just placing them in the /sake/extensions directory of the Core Sphere.
  • As a consequence, sakefiles got cleaner and unified.
  • Fusion Sphere brings a new minimal generator, plus an improved opengl2d one.

If you want to try it out follow these quick instructions (or check out the Quickstart and Installation Guide):

…continue

SchemeSpheres v0.2 Released

The project, aimed at providing schemers (the species of developer skilled in the art of Scheme) with an infrastructure to build multiplatform apps (Android/iOS/Win/OSX/Linux). Following the concept of “batteries included”, the project releases its 0.2 version, one step more towards the v1.0 release. The main changes in this release are:

  • Much easier installation of SchemeSpheres: download and run one single script.
  • A new program called spheres will take care of installing and uninstalling spheres for you. No more finding Spheres through Github!
  • Various fixes in core functionality, like FFI and Spheres importing.
  • Several fixes in Fabric, Energy, Fusion and String spheres.

Try it out if you want to start hacking right away. And stay tuned for updates! You’ll see pretty awesome stuff very soon, especially if you are into game development in Lisp / Scheme ;).

…continue

Essential CSS positioning

This isn’t 1999 any more. I don’t even remember designing with transparent tables (but I DO remember what a discovery for me this technique was). Yeah, positioning with transparent tables. It was even worse than CSS positioning. It was better to give this job to a WYSIWYG tool (but not many where able to do it properly). No wonder why Macromedia Flash took over the world back then. Not Adobe Flash, but Macromedia Flash. Version 3, to be more precise.

Nowadays nobody really thinks the future is Flash, as the war is probably already won by HTML5, along its pals CSS3 and Javascript. And, most importantly, nobody can expect using transparent tables and avoid summoning the CSS Gods to release their wrath upon the living. It also happens to make sense, technically. So CSS positioning be it.

That said, I think understanding CSS positioning is useful for any developer these days. Even if is just for avoiding the trial-and-error method of setting positions of HTML elements until I get one that works.

Let’s dive in.

…continue


Creating an open-source project in C with Autotools (Part 2 of 2)

In the previous post, I created a stub for a C program using Autotools. It didn’t have any functionality, so now I am going to implement it, exploring some of the aspects involved in the creation of a program like dfym. I will leave a few of them for future posts (such as profiling, testing and debugging), as they deserve proper attention on their own.

This post is not about this particular program, but rather about topics commonly encountered when creating a new program in C. Here, I’ll deal with program structure, argument processing, input, output, code formatting, documentation and packaging. These are topics that can be useful for many other programs, so I believe they can be found useful for different purposes.

…continue

Creating an open-source program in C with Autotools (part 1 of 2)

In this post I will start building a command-line utility in C, using some interesting tools and distributing my package properly. This is not a tutorial on Git, Autotools, C or GDB, but rather on using all the tools together to make an open-source project. This first part will focus on setting up the construction system with Autotools.

The program I’m going to develop is a command-line utility for tagging files systemwide. I’ll call it dfym (Don’t Forget Your Music). It will allow us to tag files or directories and find the files and directories matching a tag, as well as manage the database. It will use SQLite as a database (it won’t work at the filesystem level, as this is not an exercise on userspace filesystems). Actually, using a database will have its benefits as well as it drawbacks.

…continue

Using match and comprehensions in Scheme

One of the blogs on functional programming I like most is Matt Might’s. In my first post I want to comment on Higher-order list operations and port its code to R5RS Scheme thanks to SRFI-42 and Alex Shinn’s matching macro libraries. The original code is written for Haskell and Racket.

The first thing I’ll need to do is to import the libraries using my favourite Scheme implementation’s specific forms. This code requires a R5RS-compatible implementation, with syntax-rules macros. For this examples I’m using Gambit Scheme compiler, with the Scheme Spheres libraries. If I’d like to use Gambit without Scheme Spheres (or any Scheme implementation without R5RS hygienic macros), I’d need a syntax-rules expander, such as Psyntax (bundled with Gambit’s distribution, supports syntax-case), Alexpander (a fast, generic implementation) or the Blackhole module system. Scheme Spheres is using Alexpander. The two aforementioned modules are necessary, but fully R5RS-compatible, so importing them in any Scheme implementation should be straightforward.

…continue