Skip to main content

Rapid scripting in English

Project description

Introduction

EasyCoder is a high-level English-like scripting language suited for prototyping and rapid testing of ideas. It operates on the command line and a graphics module is under construction. The language is written in Python and it acts as a fairly thin wrapper around standard Python functions, giving fast compilation and good runtime performance for general applications.


There is also a JavaScript version of EasyCoder, which provides a full set of graphical features to run in a browser. For this, please visit

Repository: https://github.com/easycoder/easycoder.github.io
Website: https://easycoder.github.io


Quick Start

Install EasyCoder in your Python environment:

pip install requests pytz easycoder

Test the install by typing the command easycoder.


On Linux, this will probably fail as the installer places the executable file in the `$HOME/.local/bin` directory. So give the command ``` export PATH=$HOME/.local/bin:$PATH ```

To make this change permanent, edit your .profile file, adding the following:

# set PATH so it includes user's private .local/bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

Now write a test script, 'hello.ecs', containing the following:

print `Hello, world!`
exit

(Note the backticks.) This is traditionally the first program to be written in virtually any language. To run it, use easycoder hello.ecs.

The output will look like this (the version number will likely differ):

EasyCoder version 250403.1
Compiled <anon>: 1 lines (2 tokens) in 0 ms
Run <anon>
Hello, world!

Why the exit? Because EasyCoder can't tell that the program is finished. It might contain elements that are waiting for outside events, so without exit it just stops and waits. You can kill it by typing Control-C.

It's conventional to add a program title to a script:

!   Test script
    script Test
    log `Hello, world!`
    exit

The first line here is just a comment and has no effect on the running of the script. The second line gives the script a name, which is useful in debugging as it says which script was running. I've also changed print to log to get more information from the script. When run, the output is now

EasyCoder version 250403.1
Compiled Test: 3 lines (4 tokens) in 0 ms
Run Test
16:37:39.132311:    3-> Hello, world!

As you might guess from the above, the log command shows the time and the line in the script it was called from. This is very useful in tracking down debugging print commands in large scripts.

Here in the repository is a folder called scripts containing some sample scripts:

fizzbuzz.ecs is a simple programming challenge often given at job interviews
tests.ecs is a test program containing many of the EasyCoder features
benchmark.ecs allows the performance of EasyCoder to be compared to other languages if a similar script is written for each one.

Graphical programming

EasyCoder includes a graphical programming environment based on PySide6, that is in the early stages of development. Some demo scripts will be included in the scripts directory as development proceeds.

Significant features

  • English-like syntax based on vocabulary rather than structure. Scripts can be read as English
  • Comprehensive feature set
  • Runs directly from source scripts. A fast compiler creates efficient intermediate code that runs immediately after compilation
  • Low memory requirements
  • Minimim dependency on other 3rd-party packages
  • Built-in co-operative multitasking
  • Dynamic loading of scripts on demand
  • The language can be extended seamlessly using plugin function modules
  • Plays well with any Python code
  • Fully Open Source

Programming reference

EasyCoder comprises a set of modules to handle tokenisation, compilation and runtime control. Syntax and grammar are defined by packages, of which there are currently two; the core package, which implements a comprehensive set of command-line programming features, and and the graphics package, which adds graphical features in a windowing environment.

Extending the language

EasyCoder can be extended to add new functionality with the use of 'plugins'. These contain compiler and runtime modules for the added language features. EasyCoder can use the added keywords, values and conditions freely; the effect is completely seamless. There is an outline example in the plugins directory called example.py, which comprises a module called Points with new language syntax to deal with two-valued items such as coordinates. In the scripts directory there is points.ecs, which exercises the new functionality.

A plugin can act as a wrapper around any Python functionality that has a sensible API, thereby hiding its complexity. The only challenge is to devise an unambiguous syntax that doesn't clash with anything already existing in EasyCoder.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easycoder-250423.2.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easycoder-250423.2-py2.py3-none-any.whl (38.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file easycoder-250423.2.tar.gz.

File metadata

  • Download URL: easycoder-250423.2.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for easycoder-250423.2.tar.gz
Algorithm Hash digest
SHA256 8a82645dd9810f1f2ca0ea2b949171a234e398e389c7d0fd0fbcf941e94d065f
MD5 279b7de6fa82102f8a2055be0e52310d
BLAKE2b-256 c897c3d0cafa8fab2762d63a0c98e36382667ab89ffe2d74c69909faf9288b8c

See more details on using hashes here.

File details

Details for the file easycoder-250423.2-py2.py3-none-any.whl.

File metadata

  • Download URL: easycoder-250423.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 38.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for easycoder-250423.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 95d7daa30f2175c90346d5808f55c5b3947b87200e3fd2e657af207a6920fcd1
MD5 638770967e50ca1e46b5cc351a1bd99a
BLAKE2b-256 ac1f206bd938d8cd56a265f5e5af7de05659e70e90bec98170ad767d082c3b80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page