Skip to main content

Ash

A simple language transpiling to Python or interpreted. The default implementation of the transpiler and interpreter are written in Python 3.

Summary

Introduction

  1. First step with Ash 1.A Hello World! 1.B Comments 1.C Keywords
  2. Variables and constants
  3. Types and operators
  4. Functions and procedures
  5. Classes and objects
  6. Modules
  7. Exceptions
  8. Standard library
  9. Interacting with Python
  10. Links

Conclusion

Introduction

Todo

1. First steps with Ash

1.A Hello, World!

This program writes on the standard output the string Hello, World!

ash> writeln("Hello, World!")

The function writeln writes on the standard output one or more arguments, goes to the next line and come back at its first position, on the left. It takes here only one argument, the string "Hello, World!". The entire line is a statement.

This second program below writes on the standard output the string What is your name? then reads a string stored in the variable name.

ash> name = read('What is your name?')
ash> writeln("Hello", name)

The function read reads a string on the standard input. This code is composed of two lines, each line being a statement. But you can write the same example this way also:

ash> name = read('What is you name?') ; writeln("Hello", name)

This time, we have only one line composed of two statements separated by a ;, called the statement separator. For both ways, the function writeln is called this time with two arguments, the string literal "Hello" and the variable name. This function accepts a variable number of arguments.

1.B Comments

A comment is a text ignored by the interpreter. It does nothing. The transpiler with recopy the text in the transpiled output.

-- This is a comment

1.C Keywords

Ash uses 26 keywords which mustn't be used as variable or constant names:

  • Nil literal: nil
  • Boolean literals: true, false
  • Operators: and, or, not, xor
  • Choice: if, then, elif, else, end
  • Loop: while, do, end, break, next
  • Subprogram: fun, pro, return
  • Class: class
  • Module: import
  • Exceptions: try, when, finally, raise

2. Variables and constants

Declare and assign a variable: a = 5

Declare, assign and restrict a variable to a type: a : int = 5

A constant starts with a capital letter and cannot be changed through the execution of the script: A = 5

3. Types and operators

  • int for integer
  • flt for float
  • bool for boolean
  • "..." or '...' for strings
  • [a, b] for list
  • [a = 5, b = 34] for hash

4. Functions and procedures

Todo

5. Classes and objects

Todo

6. Modules

Todo

7. Exceptions

Todo

8. Standard library

Todo

9. Interacting with Python

Todo

Todo

Conclusion

Damien Gouteux 2020

Metadata

Release files for ashlang 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ashlang 0.0.2
File Size Uploaded Provenance Actions
ashlang-0.0.2.tar.gz 18.3 kB Without provenance Details for ashlang-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ashlang 0.0.2
File Interpreter ABI Platform Actions
ashlang-0.0.2-py3-none-any.whl Python 3 none any Details for ashlang-0.0.2-py3-none-any.whl

Total release size: 37.1 kB

Release files / ashlang-0.0.2.tar.gz

Download URL ashlang-0.0.2.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a21e9494fe478d680cfeafa5cf190092f77d30b0b5f35cfc15707a33bad1ee11
BLAKE2b-256 checksum
How to use checksums
20d582f92eae1bb2163c01894183fa7b454fa769782acfdfb7350b67c4db577b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

Release files / ashlang-0.0.2-py3-none-any.whl

Download URL ashlang-0.0.2-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df9a3fab1c22e90ecaa77015fb78168a51e1c56f86c139422bbcc7db9c31e721
BLAKE2b-256 checksum
How to use checksums
a5bf4575cd7348c6959d34b0f4c0be6802324c9888153e5840a8fe0d328ead5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

Security for ashlang 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page