The Slash Programming Language

Slash is a new programming language for the web. It is mainly inspired by Ruby and PHP, with hints of Python and Perl.

PHP is a great tool that is virtually unmatched in its domain - ie. ‘slap a script on a server and have it run’. The problem is that PHP’s idiosyncrasies make it awkward and sometimes even painful to program in.

Slash combines PHP’s simple execution model with the elegance of Ruby’s object model. The result is a language that lets you achieve results quickly while being a joy to use.

Source code

The Slash project is available on GitHub: https://github.com/slash-lang/slash

Overview

<%
    db = MySQL.new("localhost", "my-user", "s3cr3t");
    db.use("my-database");
%>
<h1>People</h1>
<ul>
    <% for person in db.query("SELECT * FROM people") { %>
        <li><%= person["name"] %></li>
    <% } else { %>
        <li><em>No people found!</em></li>
    <% } %>
</ul>

Features