Facebook has built an in-house programming language to fight the scourge of spam.
Software engineer Louis Brandy detailed the Feature eXtraction Language (FXL) in a post on the social networking site.
He said FXL was a fast, flexible and safe means for Facebook site integrity engineers to write rules to identify spam before it hits users.
"Spam threats to Facebook's site integrity change on a daily, or even hourly, basis," Brandy said.
"Attackers peddling a 'free iPad 5' scam one day might tempt users with false promises of various gift certificates the next. Fortunately, FXL provides us with the capabilities to keep pace with constantly evolving threats.
"We crafted FXL to … expressively codify the business logic of fighting spam and [to] fetch data as efficiently as possible."
Despite the simplicity of the language, it is "ruthless efficient" at fetching large amounts of data from many sources, a task from which the FXL name is derived.
The language was described as "a narrowly-optimized implementation of a well-chosen subset of Standard ML" with customised syntax that sought to optimise FXL rather than require an expansion of the language.
"Building your own language is almost always a bad idea," Brandy said.
If (Reputation(SharedUrl) < 0) Then [LogRequest] Else 
If (Reputation(SharedUrl) == MALWARE) Then [BlockAction, LogRequest] Else 
If (Average(Map(Reputation, PreviousSharedUrls(User, 5))) < 0) Then [WarnUser, LogRequest] Else 
The rules (above) expressed in FXL sought out malicious URLs by tapping a users' link sharing history and data held by URL reputation services; They were coherent in terms of business logic, but poor expressions of data fetching logic.
Such a problem was common to large computing systems but was solved with FXL which would automate batching the data fetches in a single network round trip.
"A conventional implementation would evaluate this code top to bottom, left to right. We would fetch data sequentially, conducting an excessive number of network round trips between the machine executing FXL and the reputation service."
Brandy listed more details about FXL on the facebook page.