Maximum Tension

From machine code to glass.

We're Maximum Tension. We build software, algorithms and circuits from the lowest level up, do our own 3D, art and animation, and design websites with Apple-level care at small-studio prices.

Maximum Tension builds products with maximum efficiency and maximum performance, on minimum needs.

What we do

Software
Desktop applications, tools and libraries. Small, fast, and a single file wherever we can manage it.
Research and algorithms
Compilers, JIT code generation, neural networks and rendering. We publish the papers.
Hardware and circuits
Circuit design, and the low-level code that runs on it.
3D, design and animation
3D modelling, illustration, motion, and the visual design of everything we make.
Websites
Design and code with Apple-level care, at prices a small business can pay.
C:\CMT
AddressC:\CMT

CMT

C Maximum Tension

A header-only C library that aims to be a complete ecosystem for C. Copy one folder into a project, include what you need, and it works on anything with a C compiler: from K&R and DOS-era compilers up to C23, C++20 and modern 64-bit systems.

Select an item to view its description.

16 object(s)My Computer
CMT Setup

Built from the bottom up

Instead of relying on what each compiler or operating system happens to provide, CMT builds its own foundations from the lowest level, so everything above them is written once and runs everywhere.

  1. Environment detectionPlatform, CPU, architecture, ABI, and K&R or ANSI, all detected at compile time.
  2. Language helpersTRY, CATCH and CANCEL for C, portable types, booleans, variadic arguments, and a large set of compiler attributes and calling conventions.
  3. Assembly in C macrosx86 instructions written as macros like MOV_RAX_RBX, with exact byte sizes. Inline assembly on GCC and MSVC; machine code written into memory on everything else.
  4. Operating system servicesMemory, including executable memory, threads and mutexes on Windows, Linux, OS/2, Haiku, real-time systems and more, plus instruction cache control.
  5. Windows without importsKERNEL32 and USER32 functions are found at runtime by walking the process's own internal structures. No windows.h, no linking.
  6. ObjectsObjects with bound methods in C: console.print("Hi") with no self argument, through small machine code trampolines generated at runtime.
  7. CONSOLEA full terminal UI module: colours, cursor, shapes, mouse and keyboard input on Windows, Linux and macOS. Usable from plain C, CMT objects or C++ classes.
  8. Core modulesDisk and file I/O, environment variables, signals and exit handling, NEAR and HUGE pointers, and CMT's own STDLIB, STDIO and MATH.
  9. GRAPHICSFull window control on WebView, OpenGL, Vulkan, DirectX, Core Graphics, Metal and VGA, with true cross-platform behaviour.

Works today

Environment detection

Platform, CPU, architecture, ABI, and K&R or ANSI, all detected at compile time.

Installing: Environment detection

Scroll to stack the layers.

b.c - C:\CMT\EXAMPLES
#include "CMT/CMT.H" // Header only, even though it has linkable objects: CMT's auto-linker handles that
#include "CMT/CONSOLE.HPP" // *.HPP gives C++ classes in C++, and CMT's own object model in C

SECTION (int, TEST, (int test)) // Assembly DSL. Also works on compilers that don't support inline assembly at all
	MOV_EAX_ARG1
	ADD_EAX_(22)
	RET
END

int main(void)
{
	var error_message = 0;

	try
	{
		if (error_message == 0)
			throw ((var)"It falls here");

		console.log("You won't see me no matter what");
		cancel ;
		return (1);
	}
	catch (error_message)
	{
		console.print("[%s]\n", (char *)error_message);
	}

	console.log("A text with newline")
		->log(" continued till here.")
		->log(" Then another line started")
		->log(" thanks to the log function")
		->log(" and ended there again.\n");
	console.warning_here("Test\n"); // "b.c (33): WARNING: Test"
	console.print("%d\n", 42) // 42
		->put.colored.frame('#', 0X0A, 18, 5, 34, 11)
		->put.colored.frame_radius('*', 0X0E, 38, 5, 54, 11, 3)
		->put.colored.rectangle('.', 0X09, 58, 5, 68, 11)
		->put.colored.rectangle_radius('o', 0X0D, 72, 5, 88, 11, 2)
		->put.colored.circle('O', 0X0B, 2, 14, 24, 26)
		->put.colored.ellipse('e', 0X4F, 28, 14, 50, 26)
		->put.colored.curve('~', 0X06, 54, 14, 96, 14, 6.0F, -6.0F)
		->input.wait.key()->clear();

	console.print("TESTING ASM - %d\n", TEST(50)); // TESTING ASM - 72

#ifdef __PLATFORM_WINDOWS__ // Windows API without windows.h or import libraries
	KERNEL32.Sleep(1000);
	USER32.MessageBoxA(0, "Hello, World!", "CMT", 0);
#endif /* __PLATFORM_WINDOWS__ */

	return (0);
}
Ln 1, Col 1C (CMT)
Command Prompt

A real CMT program, coloured the way CMT's own editor files colour it. Press Build and run.

Compatibility

One folder, from K&R to C23

Systems it already talks to

  • Windows
  • Linux
  • macOS
  • OS/2
  • Haiku
  • Real-time systems

Documentation in Markdown and man pages, an article on the bound method technique, and syntax highlighting for about 15 editors, including VS Code, Vim, Emacs, Helix, Kate and Sublime.

Where it stands: the design is solid and the GCC and Clang 64-bit path is the most mature. Several older and rarer platforms are still being completed and tested, and automated cross-compiler testing is planned.

CMT on GitHub

Visual Universe

A design editor in the spirit of Figma, written in plain JavaScript with no frameworks and no build step. The goal is one editor for web design, vector art, images, animation, video and documents.

The canvas is real HTML and CSS. Every object on it is a real web element, so what you design already is a web page, not a picture of one.

Untitled CMT docs maximum-tension.com

A real element

Select me, then drag a corner.

Button
Aa

Drag, resize and rotate. Everything in this window is a real HTML element, just like in Visual Universe.

Works today

  • An infinite canvas with smooth pan and zoom, a dot grid, and a pixel grid up close.
  • Boxes, text, images, SVG, video, audio, PDFs and whole web pages that hold other objects.
  • Move, resize, rotate around a movable pivot, corner radius, flip, smart guides, groups, undo and redo.
  • Padding, margin and gap handles you drag right on the object.
  • Auto layout: turn objects into flex or grid containers and drag items in and out.
  • Animated cursors with a spring swing. Smooth with thousands of objects on screen.

Coming next

  • A toolbar for creating objects.
  • Layers and properties panels.
  • Saving, loading and export.
  • A brush editor that reads and writes Photoshop and Procreate brushes.
  • A bone system for animation, extended beyond DragonBones.
  • Free to use.

The whole editor is one executable of about 4 MB. Its window is a WebView made in C, with CMT.

D.R.O.N.E.

Dynamic Responsive Optimized Neural Engine

A neural network engine written from scratch in C, with no AI libraries or frameworks. Each AI built on it is called a drone.

Its own JIT compiler
While it runs, it writes x86-64 machine code for the neuron math using the CPU's vector instructions. Every compiled routine is checked against a plain C version.
A network that grows
When learning stalls, it adds neurons, attention heads, layers and room for new words. New parts start silent, so nothing it already learned breaks.
New kinds of neurons
Neuron recipes can be defined and placed where they fit best, and the JIT compiles them too.
Small on purpose
The engine and a trained network together are tens of megabytes. It runs offline on an ordinary PC, on every CPU thread.
Self-contained
Its own trainer, its own tests, and saving and loading of the whole network state. Built on CMT.

This network grows while you watch. New neurons start silent.

0 neurons0 layers

Instead of one huge fixed model trained on massive data: a compact engine that grows and reshapes itself as it learns, using the most efficient technique in each place.

Read the technical papers

Websites

The care of a product launch, at a price a small business can pay. A few we built:

Point at a site to read about it. Click to visit.

Ask for a website

Tell us what you want to build.

A website, a tool, a strange idea. Write to us and we will answer.

teo@maximum-tension.com Our code on GitHub