hypo

module
v0.0.0-...-444f7c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2023 License: BSD-2-Clause

README

Hypo

Hypo is a hyper-fast runtime for HTML, the programming language.

Run HTML, the programming language code outside of the browser.

Installation

Requirements: Go 1.21 or later

git clone https://github.com/angelofallars/hypo
cd hypo
go install ./cmd/hypo

Usage

With no arguments, Hypo will spin up a REPL for you to type and run HTML, the programming language code. You can execute an .html file by passing the file name as an argument to Hypo.

$ hypo example/helloworld.html
Hello world!

Status

Currently implemented commands:

Literals

  • <s>
  • <data>
  • <ol>
  • <table>

Math Commands

  • <dd> - Supported for types Number and String (string concatenation)
  • <sub> - Supported for type Number
  • <ul> - Supported for type Number
  • <div> - Supported for type Number

Stack Manipulation Commands

  • <dt>
  • <del>

Comparison Commands

  • <big>
  • <small>
  • <em>

Logical Operators

  • <b>
  • <bdi>
  • <bdo>

Control Flow

  • <i>
  • <rt>
  • <a>

Variables

  • <var>
  • <cite>

I/O

  • <input>
  • <output>
  • <wbr>

Properties

  • <rp>
  • <samp>

Arrays/Dynamic Properties

  • <address>
  • <ins>

Functions

  • <dfn>

Programs

  • <main>
  • <body>

Types

Internally, Hypo has these types for values. Note that they may act differently to the original JavaScript-based implementation of HTML, the programming language. Most importantly, you cannot ever add two values of different types, unlike JavaScript.

  • Number - Number type, created by <data>
  • String - String type, created by <s>
  • Bool - String type, created by using <cite>true</cite> and <cite>false</cite>
  • Obj - Object type, TODO
  • Array - Array type, created by using <ol>

Directories

Path Synopsis
cmd
internal
ast
cmd
errors
package errs provides error types that occur in the runtime.
package errs provides error types that occur in the runtime.
parser
package parser provides a parser that has two stages:
package parser provides a parser that has two stages:
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL