h / language
The language, not the applications

The h Language

Express the work plainly. Put complexity in implementations, libraries, and the compiler—not in compulsory types and hierarchies.

Text, including nullsOne expression modelFunctions at every layerHTTP-native applications
THE FOUNDATION

h is an executable language that can also deliver a document.

An .ht file begins in literal-output context. It can serve HTML, JSON, CSS, an image, or anything an HTTP response can carry. A .lib begins in execution context. Both are compiled as h; what differs is where execution begins.

Outside executionSource text is response content.
Inside executionExpressions and statements run.
At the HTTP boundaryHeaders describe the content.
01 / SOURCE CONTEXT

Literal output and execution

The file boundary answers one question: should source begin as content, or as instructions?

Application: .ht

<<
name='Ada'
>>
<!doctype html>
<h1>Hello, <<name>></h1>

Literal output until an execution block is opened. The block computes the value inserted into the output.

Library: .lib

function greeting(name) do
 return 'Hello, '+name /return
/function

The library is already execution context. There is no need to surround every function with << and >>.

The extension does not mean “HTML.” .ht is an HTTP application: literal output can be any response body. Named overlays provide additional HTTP resources through selectors.
02 / CONTROL FLOW

If, then, else, for, while

There are clear names for conditions and repetition. Statements close explicitly, so neither braces nor indentation are required to define their scope.

Conditional logic

if amount>0 then
 status='Balance due'
else
 status='Settled'
/if

The conditional says what changes when a condition is true.

Counted iteration

total=0
for name=i value=1 to 5 do
 total=(total+i)
/for

Iteration is ordinary control flow, with explicitly named bounds.

While

pending=3
while pending>0 do
 pending=(pending-1)
/while

The loop continues while its condition remains true.

Logic and arithmetic are not data types. They are operations applied to h values. The dedicated logic document will examine the full reasoning model independently.
03 / EXPRESSIONS

Text, concat, math and logic

The same fundamental value can be treated differently by an operation. Interpretation is deliberate, not a declaration that the value has become an object.

One fundamental value

h understands length-aware text, including null bytes. The value can represent letters, a JPEG, a network packet, a compiled bytecode stream, or any other content. No separate core table or image type is necessary.

Concatenation is visible

a=1+2
# text: 12

b=(1+2)
# arithmetic: 3

label=concat('Order ',order_id)

Outside mathematical parentheses, + joins text. concat() makes that intention unambiguous when values might look numeric.

Math is explicitly requested

total=(items+tax+shipping)

third=(1/3,20,19)

remainder=(total%3)

Arithmetic is parenthesized. Precision can be specified per expression; the dedicated math document covers accuracy, rounding, and proposed defaults.

Logical conditions

if active='yes' and attempts<3 then
 allowed='yes'
/if

if not(authorized()) then
 allowed='no'
/if

Logical operators describe decisions. Application-defined functions can participate in the condition.

Interpret a value when needed

person='{"name":"Ada"}'
name=person.json.['name']

JSON structure can be interpreted through a library-defined accessor. h itself does not need to make JSON objects a fundamental type.

04 / FUNCTIONS & EXTENSION

Functions are both the foundation and the extension point

An h function expresses PARMS → PROCESSING → RETURN. Nothing about that shape demands an object instance or an inheritance hierarchy.

Public nameWhat callers rely on
function balance() do
 return orders_cost() /return
/function
↓
Inner layerWhat the implementation is free to change
function orders_cost() do
 return items_cost()+taxes_cost()+shipments_cost() /return
/function

Functions can be named to create as many useful layers as the engineer wants. They can be shallow or deep, directly implemented or composed of other functions. The name balance() stays stable while rules, algorithms and representations evolve beneath it.

Defined by the language and runtime

length(data)
concat(first,last)
locate(data,needle)

Common operations have built-in implementations that the runtime can optimize.

Extended by the engineer

function balance() do
 return orders_cost() /return
/function

expand file='pricing.lib' /expand

A library supplies more functions and special-purpose interpretations. These are still ordinary h calls.

05 / HTTP RESOURCES

Functions and HTTP use the same simple shape

HTTP already gives us the request → processing → response model. h adopts it where it helps, without making additional object structure compulsory.

REQUEST
→
PROCESSING
→
RESPONSE
PARMS
→
PROCESSING
→
RETURN

HTTP gives h an established resource and service model, including media types and character encoding. This is not an exclusive capability of h: an object-oriented application can use the same HTTP mechanisms.

One application, multiple resources

<<overlay balance
 webpush(balance(),'text/plain; charset=UTF-8')
>>

<<overlay profile
 webpush(profile,'application/json; charset=UTF-8')
>>

The public HTTP selector provides a service entry, not an instance method.

HTTP tells the receiver what it got

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{"name":"Ada"}

The same h value can be interpreted according to the media type. A charset is meaningful where the representation defines one.

06 / LAYERS & AUTHORITY

Extend at the layer that needs the capability

The engineer chooses how much of the system is expressed as ordinary h and how much capability is granted to each execution environment.

H1

Foundational execution and lower-level capabilities. It need not know what a file is.

H2

Filesystem and storage capability can be implemented over more fundamental operations.

H3

HTTP application execution, response production and service composition.

The h source language remains the same. The execution environment governs which operations are available. The compiler should optimize h, not force a data structure or an object model onto programmers.

Complexity belongs in the implementation, not in the programmer’s expression of the problem.
07 / COMMENTS

Comments

Questions, corrections and arguments are welcome. Signing in with an email address is enough to leave one.

No comments yet.

Sign in to leave a comment. An email address is all it takes.