3 ms·
In the early 2000s I wrote 'Basil'. It started as a macro language on steroids soon turned into a concatenative), functional web language that I used to build a
by sambeau 16y ago
In the early 2000s I wrote 'Basil'. It started as a macro language on steroids soon turned into a concatenative), functional web language that I used to build a number of large commercial sites. It turned out to be amazingly expressive while surprisingly efficient (or, at least, efficient enough).
It was a cross between lisp and C (and a touch of REXX). Everything was a string, strings were manipulated and stuck back together and everything returned a value (or the empty string {}) even a 'for' and an 'if'.
A very simple example is this piece of code (that I hastily dug up) that would make a stripy table.
<!--begin stripey table-->
<table>
for(x in args)
{
<tr>
for(y in x)
{
if(stripey)
{
stripey=t
<td bgcolor="$dddddd"> y </td>
}
else
{
stripey=f
<td bgcolor="$ffffff"> y </td>
}
}
</tr>
}
</table>
<!--end stripey table-->
Which on first view probably looks unremarkable until you see the invisible concats in all the white space and that the curly brackets all denote strings, even after the fors and ifs.
for instance:
x = for(y in {1 2 3 4 5 6 7 8 9 10}){y}
x
would return:
12345678910
Just thinking about it has made me dig out the old code and take a look at it again. It had super-simple built in MySQL integration, an MVC-alike system of actions, objects & 'envelopes'. It automatically cleaned all CGI in and CGI out. It even had it's own NoSQL style database!
String concatenation was ideal for web programming (and a lot of other Unix tasks).
I'd love to return to it as it had a number of innovative features that I've yet to see in any other language (as well as a number I've seen appear since).
- deleted 16y ago[deleted]
- sambeau 16y agoI've just spotted an error in my hastily edited code above... I'll leave it as an exercise for the reader :)