Repository navigation
EnderScript 1.2.1 fixes the issues found in the 1.2.0 review. Windows x86 (32-bit) and x64 only. ARM64 builds but has not been run on real ARM hardware yet, so it is not included.
The syntax has not changed. Existing programs run as before.
Download
| File | For |
|---|---|
enderscript-1.2.1-windows-x86.zip |
Windows 32-bit |
enderscript-1.2.1-windows-x64.zip |
Windows 64-bit |
Extract it and run ender.exe <file.es>. Nothing to install. Use SHA256SUMS.txt to check the download.
Fixes
- Source files saved with a UTF-8 BOM (Notepad, PowerShell 5.1) are now accepted. 1.2.0 stopped with
unexpected byte 0xEF. - A program too large for the output buffer now stops with
error: program too largeinstead of writing past the buffer. - Reading strings with
inputno longer stops after about 4 MB in total. When the input area fills up, the runtime asks Windows for a new block, and strings already read stay valid.
Performance
- x86 loop heads are aligned to 16 bytes. Without it, fizz on x86 went from 198 ms to 276 ms depending on where the loop landed in memory.
- The x64 SSE zero-count loop handles 4 vectors per pass.
Tests
The compiler test suite is now in the repository under tests/ (152 cases, run with tests/run_tests.ps1). Three new cases cover the fixes above; they fail on 1.2.0 and pass on 1.2.1.
Benchmarks
C and C++ are now built with clang on both x86 and x64. The x64 numbers in 1.2.0 used gcc, which made C look slow on lcg. Sources, flags, and the runner are in enderscript-bench.
Windows 32-bit (ms, fastest run):
| Benchmark | EnderScript | C | C++ | Zig |
|---|---|---|---|---|
| hello | 4.2 | 5.2 | 5.4 | 4.6 |
| lcg | 110.7 | 142.4 | 139.5 | 219.2 |
| fizz | 197.6 | 306.9 | 306.2 | 303.7 |
| modchain | 274.8 | 360.6 | 357.3 | 356.3 |
| sieve | 50.5 | 52.9 | 53.1 | 56.4 |
| 20.9 | 95.4 | 102.0 | 23.3 | |
| pipe | 30.9 | 243.3 | 1460.2 | 31.4 |
Windows x64 (ms, fastest run):
| Benchmark | EnderScript | C | C++ | Rust | Zig | Python |
|---|---|---|---|---|---|---|
| hello | 3.2 | 3.9 | 3.9 | 4.3 | 3.5 | 16.8 |
| lcg | 151.9 | 177.5 | 176.1 | 175.0 | 172.9 | 30571.9 |
| fizz | 175.7 | 264.8 | 263.3 | 260.5 | 277.1 | 17061.0 |
| modchain | 235.8 | 388.4 | 384.3 | 393.0 | 416.5 | 12392.2 |
| sieve | 50.7 | 51.7 | 51.2 | 51.2 | 53.2 | 2629.8 |
| 11.3 | 69.4 | 83.4 | 21.6 | 12.0 | 583.4 | |
| pipe | 16.6 | 162.8 | 1081.6 | 34.3 | 20.3 | 352.2 |
Every language produces exactly the same output.
Where EnderScript is still slower
The benchmarks above match loop patterns the compiler has dedicated optimizations for. On ordinary code EnderScript is still 1.3 to 4.5 times slower than C. These three programs were never tuned for (sources in enderscript-bench):
Windows 32-bit (ms, fastest run):
| Benchmark | EnderScript | C | C++ | Zig |
|---|---|---|---|---|
| gcd | 691.3 | 391.0 | 395.3 | 352.5 |
| collatz | 669.2 | 319.3 | 315.5 | 348.3 |
| matrix | 280.3 | 61.9 | 58.8 | 90.8 |
Windows x64 (ms, fastest run):
| Benchmark | EnderScript | C | C++ | Rust | Zig |
|---|---|---|---|---|---|
| gcd | 436.7 | 330.7 | 330.6 | 310.6 | 254.6 |
| collatz | 445.6 | 315.7 | 316.9 | 306.9 | 287.2 |
| matrix | 238.8 | 58.3 | 57.6 | 59.6 | 56.7 |
Improving general code generation is the next step.