Write less code. Ship faster.
The Devkron language, or simply DKL [DevKron Language], is a dynamic, declarative metalanguage with variable syntax: it writes HTML, XML and JSON for you, reads like any language you already know and lets you create your own syntax. Free to learn and develop.
- Data and its shape, together
- Ready-to-use frameworks
- Linux and Windows
What you write is already the HTML
In DKL a page isn't built by concatenating strings or with separate templates. Logic and markup live together in the same file, naturally.
##
table(class="orders")
{
tr { th{"Number"} th{"Customer"} th{"Total"} }
#!
for i = 0; i < list.count(orders)
{
ref o = list.obj(orders, i)
##
tr
{
td{ $"#<@@(o, \"#number\")>" }
td{ $"#<@@(o, \"customer\")>" }
td(align="right"){ $"#<@@(o, \"#total\"):#,0.00>" }
}
#!
}
##
}
Output
<table class="orders">
<tr>
<th>Number</th>
<th>Customer</th>
<th>Total</th>
</tr>
<tr>
<td>1001</td>
<td>Ana López</td>
<td align="right">1,250.50</td>
</tr>
<tr>
<td>1002</td>
<td>Luis Pérez</td>
<td align="right">980.00</td>
</tr>
</table>Data in the notation you already know
Records and lists as JSON, right in the code and with expressions inside. No classes, no mappings, no ceremony.
new order
{$$
"customer": "John",
"items": [{"product": "P-01", "quantity": 2}],
"total": 150.5 * 2
$$}
do print(to.json(order))
Output
{
"customer": "John",
"items": [
{
"product": "P-01",
"quantity": 2
}
],
"total": 301.0
}A language that adapts to you
DKL lets you create your own syntax. Define phrases tailored to your business and the language understands them. It's not a trick: all of DKL's syntax (if, for, new…) is defined this way.
#def product (code, price) "product"
#pattern product "PRODUCT '$code' COSTS '#price'"
catalog
{
PRODUCT pencil COSTS 5.50
PRODUCT notebook COSTS 38
}
Output
<catalog>
<product code="pencil" price="5.50" />
<product code="notebook" price="38" />
</catalog>A tree, like XML
Just like XML, a DKL document is a tree of nested nodes under a single root. Each node can have attributes and contain other nodes or blocks of text. That's why DKL translates completely to XML and can define data or other dialects.
People(count="3")
{
Person(name="John")
Person(name="Peter")
Person(name="Camila")
}
Output
<People count="3">
<Person name="John" />
<Person name="Peter" />
<Person name="Camila" />
</People>Influenced by the best of several worlds
XML
From which it takes the representation of hierarchical data.
C
Whose widely known syntax makes coding and learning easier.
PHP
For its ability to make documents generate themselves.
JavaScript
For its dynamic typing and data structures (JSON).
One query, one JSON service
Open the connection, take the URL parameters, run the query and respond in JSON: a single statement. Parameters travel separately from the SQL, so the query is protected against injection.
do httpres.json(dbr.list(dbr.open("store@myapp"), "
SELECT sku, name, price FROM product
WHERE name LIKE CONCAT('%', @q, '%')", httpreq.get()))
/products.dkl?q=coffee
[
{
"sku": "P-01",
"name": "Coffee 1 kg",
"price": 189.90
},
{
"sku": "P-03",
"name": "Ground coffee",
"price": 95.00
}
]The everyday work, already done
Almost every system repeats the same things: sign in, create, read, edit, delete, list, upload files, show reports. Devkron ships those pieces ready, so you only code what makes your application unique.
CRUD-L: one table, a complete system
Publish a table with one routing rule and a configuration file, and get a JSON REST service, HTML forms and lists, and master-detail saved in a transaction.
/store/{_entities_type}/{_entity_id?} > store/entry-point.dkl
Templated sites
The common structure of every page, and a new site from a template with one command.
Authentication
Sessions, cookies, tokens and permission checks.
Files
Upload, download and organize files from the browser.
Tables with totals
Grouping, subtotals and totals for on-screen reports.
Libraries that do the heavy lifting
Included in the download. Each one solves in a line what other platforms need an external package for.
Talk to other systems
ref r = http.post_json(url, http.bearer(token), order)Sign in with Google
ref u = jwt.verify_rs256(credential, jwks, issuer, client_id)Parallel batches
ref r = threads.pool("invoice.dkl", "number", numbers, threads.cpus())In-memory cache
do cache.set("catalog", products, 300)Plus: locks against duplicate numbers, OAuth 2.0, hashes and signatures, dates and time zones, regular expressions, zip and logs. As optional packages: Excel, PDF, Word, CSV, images and Markdown.
Your database, written as text
Describe your tables with DDM, install them with one command and update production databases applying only safe changes, without deleting data. Connections are requested by name: passwords never live in the code, and they can be encrypted.
dkl install-model db=store@myapp model=store.ddm
#include "ddm.dkh"
model "Store"
{
#include "induxsoft.abstracts.ddm"
entity "customer" : "TableModel"
{
@"code" string(15) required unique
@"name" string(150) required
@"email" string(100)
@"credit_limit" decimal(14,2)
@"icity" ref:"city"
}
}
Why use DKL?
Because it means independence. DKL preserves knowledge about things: all code is a structured document that can be translated to other languages and technologies.
Because it's fun to use a language you can evolve yourself.
And simply because we can, and we want to.
About Devkron
Devkron is a project by Induxsoft, a Mexican software company. It was designed to shorten programmers' learning time and make them productive quickly at building business applications.
Today it is a language with general-purpose libraries, extensible, with database access and execution on Linux and Windows web servers. Induxsoft uses it for the applications, services and websites that serve thousands of users in several countries.
Start today, for free
Download, unzip and run your first program in minutes. No license, no sign-up and no time limit to develop on your machine.
