The Hello, World! application

Here is a preview of the famous "Hello, World!" program made with the Atlas toolkit:

Hello World! preview

Like all "Hello, World!" applications, this one focuses on the basics too. For a live demonstration:

Below the source code of this application for the different available languages:

Java source code

import info.q37.atlas.*;
import java.util.HashMap;
import java.nio.file.*;

class Hello extends Atlas {
  public void handle(DOM dom, String action, String id) {
    switch (action) {
    case "":  // Special action launched on each new session.
      try {
        dom.setLayout("", new String(Files.readAllBytes(Paths.get("Main.html"))));
      } catch (Exception e) {
    case "Typing":
      dom.setContent("name", dom.getContent(id));
    case "Clear":
      if (dom.confirm("Are you sure ?"))
        dom.setContents(new HashMap<String, String>() {
            put("input", "");
            put("name", "");

  public static void main(String[] args) throws Exception {

    for (;;)
      new Hello();

To install this example, among others:

JavaScript source code for Node.js

const atlas = require('atlastk');
const fs = require('fs');

const callbacks = {
  "": (dom, id) => dom.setLayout("", fs.readFileSync("Main.html", "utf8"),
    () => dom.focus("input")),
  "Typing": (dom, id) => dom.getContent(id,
    (name) => dom.setContent("name", name)),
  "Clear": (dom, id) => dom.confirm("Are you sure ?",
    (answer) => { if (answer) dom.setContents({ "input": "", "name": "" }) })

atlas.launch(() => new atlas.DOM(), callbacks);

To install this example, among others:

You can also launch npm install, create a Hello.js file with above source code, or retrieve this file at, and then launch node Hello.js.

PHP source code

require "phar://Atlas.phar/Atlas.php";

class Hello extends Threaded {
 public function handle($dom, $action, $id) {
  switch ($action) {
  case "":  // Special action launched on each new session.
   $dom->setLayout("", file_get_contents("Main.html"));
  case "Typing":
   $dom->setContent("name", $dom->getContent($id));
  case "Clear":
   if ($dom->confirm("Are you sure?")) {
    $dom->setContents(["input" => "", "name" => ""]);

function hello() {
 return new Hello();

Atlas::launch('hello'); // 'hello' refers the above function.

To install this example, among others:

Python source code

import Atlas

def acConnect(this, dom, id):
  dom.setLayout("", open("Main.html").read())

callbacks = {
    "": acConnect,
    "Typing": lambda this, dom, id:
      dom.setContent("name", dom.getContent(id)),
    "Clear": lambda this, dom, id:
      dom.setContents( {  "input": "", "name": ""} )
      if dom.confirm( "Are you sure ?" ) else None


To install this example, among others:

HTML file

This is the content of the Main.html file, which content is given as parameter to the setLayout(...) function in above source codes.

 <input id="input" maxlength="20" placeholder="Enter a name here" type="text" data-xdh-onevent="input|Typing" />
 <button data-xdh-onevent="Clear">Clear</button>
 <hr />
  <span>Hello </span>
  <span style="font-style: italic;" id="name"></span>