Older blog entries for chalst (starting at number 279)

C migration strategy
wingo asked, after summarising the safety issues with C:

I still write C. I work on implementations of safe languages -- languages that don't have the same kinds of fundamental vulnerabilities that C and C++ have. Eventually the amount of C in the world will stop growing, and decline as pieces that are now written in C will be written in Python, in JavaScript, in Guile: in short, in languages that don't launch the missiles when you try to write beyond the end of an array.

C has had a great run; we should celebrate it. But its time has passed. What is your migration strategy? How are you going to stop writing C?


I think the most conservative strategy is the best. I was impressed by Cyclone. I'm not sure the language is quite right for the job, and development seems to have halted some time back, but there have been alternatives proposed. I think Cyclone has shown that C can be modestly extended in such a way that we can statically for absence of undefined behaviours and many other desirable safety and correctness properties without nuisance or violation of the spirit of C. I hope that an obviously right safeness extension to C gets proposed and acquires momentum.

I actually had a dream about this, where I was reading a paper about an extension to Lua that allowed Cyclone+Lua programs to have whole-system correctness guarantees. I don't often remember my dreams, funnily enough.

Recentlog
nutella writes, of the site's recent glitches: Okay, now thanks to bad RSS feeds the Advogato front page is really messed up. The main target seems to have been the "Recent People Joining" list.

Bad RSS feeds? Really? I guess it's possible, but I assumed that StevenRainwater was backing out code that was not working, or has safety issues arising from the recent libxml2 migration.

6 Sep 2011 (updated 7 Sep 2011 at 08:22 UTC) »
Ex commands under Emacs
I've only recently noticed something rather useful for me: viper-mode's support for the ex command set, implemented in the viper-ex package as a part of the Viper vi-emulation package, is mostly orthogonal to the rest of Viper, meaning the Viper implementation of ex can be used without activating Viper mode. Hence you can bind the viper-ex function to a key in any Emacs mode and use commands like .,$s/wrong/right/g there. It is quite straightforward to use this to support vi-like macros, which are sometimes quite a bit briefer than their Elisp equivalents.

To get started, you need to import the viper-ex package, which defines the viper-ex interactive command, and which has some dependencies on the rest of Viper, ones which could be pruned without much difficulty. The ex commands are more pleasant with line numbering. The following Elisp will configure this, with viper-ex bound to C-:


(require 'viper-ex)
(require 'viper-keym)
(require 'viper-cmd)
(require 'linum)
(define-key global-map (kbd "C-:") 'viper-ex)
(global-linum-mode)

Note that several modes, like Org-mode, clobber C-: and so would need their maps redefined to use this.


Advogato's new libxml2-based text handler

This is new, I think. It seems to have fewer glitches than the old code, so kudos to StevenRainwater for getting this done.

4 Jul 2011 (updated 6 Sep 2011 at 12:36 UTC) »
Recentlog
ncm writes in favour of τ against π: It's silly to memorize an absurd number of digits of pi and then be obliged to double them before they are useful.

I've no issue with having both constants about, using π or τ whichever is simplest, but I find that π feels more fundamental to me. A couple of considerations:

  1. The area of the unit circle is π. This seems as close to fundamental a fact of trigonometry as you can get. Perhaps trigonometry differs from folk geometry in finding the radius of a circle more fundamental than the diameter?
  2. Quite a lot of the Tau Manifesto is devoted to how much nicer things are if we express radians as lying between [0,τ] rather than [0,2π]. Well, radians are an equivalence class over all the whole continuum, and choosing to express radians over a positive interval to me strikes of failing to appreciate the symmetry of geometry. I find [-π,+π] more natural than [-τ/2,+τ/2], and I like having π being the opposite angle to 0. I do, I confess, view expressing right angles as τ/4 rather than π/2 more intuitive, since right angles "quarter" the plane.

I'm quite happy for people to prefer working with τ rather than π, but I would be unhappy with a calculator than had a τ key and no π key.
12 Jun 2011 (updated 12 Jun 2011 at 09:58 UTC) »
Recentlog
LaForge asks (does Harald Welte actually read recentlog?) Why do self-respecting hackers use Gmail & Co?, noting how many of his mailing list subscribers use Gmail, and making some observations about the privacy implications.

As a datapoint, I do have a Gmail account, and I try only to use that for mailing lists, although some family members seem to prefer using that account despite my protestations. I don't consider the privacy implications of my mailing list subscriptions to be particularly invasive, especially since the fact of my subscribing to several of them is public information. I have a web.de account as an emergency backup for correspondence with my hosting service, and apart from these cases, I try to use the email accounts I maintain myself for correspondence, with the considerations LaForge talks about looming large.

It occurs to me that I could try to get a friend to administer my emergency email account, but then I recall that I've had trouble with that in the past.

I should think that Joel Coel's answer to the question Using gmail as your primary mail server on Server Fault provides a common answer to LaForge's question too.

10 May 2011 (updated 11 May 2011 at 13:25 UTC) »
Recentspam
I do derive some perverse entertainment from some of the spam accounts that have a fleeting existence here, but my favourites are always the SEO "experts". Hi! I'm either incompetent or a criminal, probably both, they tell us, Let me help you!

Today, let me introduce SEM Media, India offering to "Clue your Wounded Website", and whose graphic design skills are as weak as their brand self-awareness is feeble. For but a taster of their site, I provide a snapshot below.

A taster of what SEM Media could do to your 
business
Recentlog
Musouka said [I] (had like 2 or 3 years of [programming java] HS oriented so mostly Object based programming) and i wanted to know if any of you guys had any hints or tricks to getting to know and remember the language?

I'm not sure what HS-oriented Java is: high-school course in programming? You might find these resources useful:

  • You can download Bruce Eckel's ageing-but-popular book from his Thinking in Java site;
  • Work through a problem set that tests programming skills that you want to solve. If you are at all mathematically oriented, then the Project Euler questions will provide a good workout with core parts of the language like collections. There are other puzzles out there that will test your ability to get Java to solve problems like extracting information from XML, handling UI, or interacting with a server;
  • Look at free-software projects: a question on Stack Overflow, well written java open source projects (for learning)?, had some answers that might be interesting for you.
Be patient and realistic. Set yourself goals that you can solve: it takes time before you will have the skills to write software that other people will be excited about.

About your user page: there are quite a few people, myself included, who don't think that Facebook makes a good homepage for Advogato. Creating a page for yourself on a public code repository, say, Github or Bitbucket, makes for a better homepage. You could post your coding efforts there

Recentlog
karlberry mentioned the Firefox It's All Text add-on, which allows you to edit TEXTAREA forms in Emacs. Worth mentioning Alex Bennee's Edit with Emacs plugin for Chrom{ium,e}.
Recentlog
karlberry wondered where he'd seen the question about Pdftex's \pdfnormaldeviate primitive. I guess it has to be TH's post Random numbers in TeX, where he wonders what the old Pdftex manual meant by the primitive generating a distribution with a "unit" of 65 536.

270 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!