|
1 | 1 | # Introduction
|
2 |
| -This is the Python version of EasyCoder, a high-level English-like scripting language suited for prototyping and rapid testing of ideas. It operates on the command line. |
| 2 | +This is the Python version of **_EasyCoder_**, a high-level English-like scripting language suited for prototyping and rapid testing of ideas. It operates on the command line. |
3 | 3 |
|
4 |
| -The JavaScript version of EasyCoder, which provides a full set of graphical features to run in a browser, is at [https://easycoder.github.io](https://easycoder.github.io) |
| 4 | +The JavaScript version of **_EasyCoder_**, which provides a full set of graphical features to run in a browser, is at |
| 5 | + |
| 6 | +Repository: [https://github.com/easycoder/easycoder.github.io](https://github.com/easycoder/easycoder.github.io) |
| 7 | +Website: [https://easycoder.github.io](https://easycoder.github.io) |
5 | 8 |
|
6 | 9 | ## Quick Start
|
7 |
| -1: Install EasyCoder in your Python environment: |
| 10 | +Install **_EasyCoder_** in your Python environment: |
8 | 11 | ```
|
9 | 12 | pip install easycoder
|
10 | 13 | ```
|
11 |
| -2: Write a test script, 'hello.ecs': |
| 14 | +Write a test script, 'hello.ecs', containing the following: |
12 | 15 | ```
|
13 | 16 | print `Hello, world!`
|
14 | 17 | ```
|
15 |
| -This is traditionally the first program to be written in virtually any language. To run it, use the following command: |
16 |
| -``` |
17 |
| -easycoder hello.ecs |
18 |
| -``` |
| 18 | +This is traditionally the first program to be written in virtually any language. To run it, use `easycoder hello.ecs`. |
| 19 | + |
19 | 20 | The output will look like this:
|
| 21 | + |
20 | 22 | ```
|
| 23 | +EasyCoder version 5 |
21 | 24 | Compiled <anon>: 1 lines (2 tokens) in 0 ms
|
22 | 25 | Run <anon>
|
23 | 26 | 1-> Hello, world!
|
24 | 27 | ```
|
25 |
| -To avoid having to use REPL you can set up a simple executable command such as this Python script. On Linux the first line will ensure it runs as a command if given execute permission. You can name it 'easycoder' - there's no need for a '.py' extension. |
26 |
| -``` |
27 |
| -#!/bin/python3 |
28 |
| -
|
29 |
| -from sys import argv |
30 |
| -from easycoder import Program |
31 |
| -
|
32 |
| -if (len(argv) > 1): |
33 |
| - Program(argv[1:]) |
34 |
| -else: |
35 |
| - print('Syntax: easycoder <scriptname> [plugins]') |
36 |
| -``` |
37 |
| -With this you can run your script with the command `easycoder hello.ecs`. You can place `easycoder` anywhere on your system execution path, such as in a local `bin` directory. |
38 |
| - |
39 | 28 | It's conventional to add a program title to a script:
|
| 29 | + |
40 | 30 | ```
|
41 | 31 | ! Test script
|
42 |
| -
|
43 | 32 | script Test
|
44 |
| -
|
45 | 33 | print `Hello, world!`
|
46 | 34 | ```
|
47 | 35 | 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. When run, the output is now
|
| 36 | + |
48 | 37 | ```
|
| 38 | +EasyCoder version 5 |
49 | 39 | Compiled Test: 5 lines (4 tokens) in 0 ms
|
50 | 40 | Run Test
|
51 | 41 | 5-> Hello, world!
|
52 | 42 | ```
|
53 | 43 | As you can guess from the above, the print command gives the line in the script it was called from. This is very useful in tracking down debugging print commands in large scripts.
|
54 | 44 |
|
55 |
| -In the repository is a folder called `tests` containing a couple of sample scripts. `benchmark.ecs` allows the performance of EasyCoder to be compared to other languages if a similar program is written for each one. `tests.ecs` is a test program containing many of the EasyCoder features. |
| 45 | +Here in the repository is a folder called `scripts` containing some sample scripts: |
| 46 | + |
| 47 | +`benchmark.ecs` allows the performance of EasyCoder to be compared to other languages if a similar program is written for each one |
| 48 | +`tests.ecs` is a test program containing many of the EasyCoder features |
| 49 | +`fizzbuzz.ecs` is a simple programming challenge often given at job interviews |
56 | 50 |
|
57 | 51 | ## The EasyCoder programming language
|
58 | 52 | There are three primary components to the language:
|
59 |
| - 1 Keywords |
60 |
| - 2 Values |
61 |
| - 3 Conditions |
62 | 53 |
|
63 |
| -All program lines start with a keyword - a command to EasyCoder to do something |
| 54 | + - Keywords |
| 55 | + - Values |
| 56 | + - Conditions |
64 | 57 |
|
65 |
| -(Under construction) |
| 58 | +[Keywords](doc/keywords.md) |
0 commit comments