calcium-js
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

Calcium is run based on commands.

Each command is represented as a JSON array.

[
  [1, [], "=", ["var", "message"], "Hello, World."],
  [1, [], "print", ["var", "message"]],
  [1, [], "end"]
]

Basically, the commands are equivalent to statements. The meaning of each element in the command is as follows:

  1. Indent (integer)
  2. Option (any)
  3. Command keyword (string)
  4. (After that) Arguments (array)

What is the "indent"?

Indent in Calcium is what the Python language calls indentation. Increase the value of the indent if you need a block, for example if or while.

[
  ...
  [1, [], "if", ["==", ["var", "i"], 10]],
  [2, [], "print", ["var", "i"]],
  ...
]

The code above corresponds to:

if i == 10:
    print(i)

Is the Calcium an esoteric language or just a joke?

No, I don't think so. Here is one of the applications. It is suitable for environments that generate code programmatically.

Package Sidebar

Install

npm i calcium-js

Weekly Downloads

1

Version

0.3.1

License

Apache-2.0

Unpacked Size

33.3 kB

Total Files

48

Last publish

Collaborators

  • 0xcaf2