Compare commits

...

3 Commits

Author SHA1 Message Date
CismonX bbc1f850e5
update ci script
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-02-14 23:40:11 +08:00
CismonX dbce7a5cfc
update test 2022-02-14 23:39:23 +08:00
CismonX 78497a1b55
update documentation
continuous-integration/drone/push Build is failing Details
2022-02-14 23:23:02 +08:00
5 changed files with 68 additions and 46 deletions

View File

@ -12,9 +12,10 @@ name: default
steps:
- name: build
image: pureos/amber-slim
image: pureos/byzantium
commands:
- apt -y install build-essential autoconf automake dejagnu
- apt -y update
- apt -y install wget build-essential autoconf automake dejagnu
- autoreconf --install
- ./configure CFLAGS='-O0 -g -std=c99 -Wall -Wextra -Wpedantic --coverage'
- make

View File

@ -1,42 +1,54 @@
<!--
Copyright (C) 2020,2021 CismonX <admin@cismon.net>
Copyright (C) 2020,2021 CismonX <admin@cismon.net>
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty, provided the copyright notice and
this notice are preserved. This file is offered as-is, without any warranty.
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty, provided the copyright notice and
this notice are preserved. This file is offered as-is, without any warranty.
-->
# U6a
U6a
===
[![Build Status](https://drone.cismon.net/api/badges/esolangs/u6a/status.svg)](https://drone.cismon.net/esolangs/u6a)
[![License](https://img.shields.io/badge/license-GPL--3.0--or--later-blue.svg)](LICENSE)
[![Build Status]](https://drone.cismon.net/esolangs/u6a) [![License]](LICENSE)
Implementation of Unlambda, an esoteric programming language.
## Description
Description
-----------
The U6a project provides a bytecode compiler and a runtime system for the [Unlambda](http://www.madore.org/~david/programs/unlambda/) programming language.
The U6a project provides a bytecode compiler and a runtime system for the
[Unlambda] programming language.
Ideas behind this implementation can be found [here](https://git.cismon.net/esolangs/u6a/wiki/Developer%27s-Notes-on-Implementing-Unlambda).
Ideas behind this implementation can be found [here][U6a wiki].
U6a is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
U6a is free software. You can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
## Getting Started
Getting Started
---------------
To install U6a from source, see [INSTALL](INSTALL).
To install U6a from source, see INSTALL.md.
Usage (See [**u6ac**(1)](man/u6ac.1) and [**u6a**(1)](man/u6a.1) man pages for details):
Usage (See the u6ac(1) and u6a(1) man pages for details):
```bash
# Compile an Unlambda source file into bytecode.
u6ac -o foo.unl.bc foo.unl
# Execute the bytecode file.
u6a foo.unl.bc
```
# Compile an Unlambda source file into bytecode.
u6ac -o foo.unl.bc foo.unl
# Execute the bytecode file.
u6a foo.unl.bc
## Future Plans
Future Plans
------------
* Interactive debugger: `u6adb`
* More compile-time optimizations
* More test cases
* LLVM backend for `u6ac`
* Interactive debugger: u6adb
* More compile-time optimizations
* More test cases
* LLVM backend for u6ac
<!-- Reference Links -->
[Build Status]: https://drone.cismon.net/api/badges/esolangs/u6a/status.svg
[License]: https://img.shields.io/badge/license-GPL--3.0--or--later-blue.svg
[Unlambda]: http://www.madore.org/~david/programs/unlambda/
[U6a wiki]: https://git.cismon.net/esolangs/u6a/wiki/Implementing-Unlambda

View File

@ -1,4 +1,4 @@
.TH "U6A" "1" "Jan 30, 2020" "0.1.1" "U6A User Manual"
.TH "U6A" "1" "Jan 30, 2020" "0.1.1" "U6a User Manual"
.
.SH NAME
u6a - Runtime for the Unlambda programming language
@ -49,8 +49,9 @@ Prints version number, then exit.
.TP
Version compatiblility:
Definition of Unlambda bytecode may differ across multiple versions of u6a.
Execution result is guaranteed to be consistent when both major and minor versions of bytecode file and the interpreter matches.
Otherwise, the code may not work as expected and the interpreter will refuse to execute unless
Execution result is guaranteed to be consistent when both major and minor
versions of bytecode file and the interpreter matches. Otherwise, the code
may not work as expected and the interpreter will refuse to execute unless
.B -f
option is provided.
.TP
@ -72,5 +73,6 @@ they could be read by the current Unlambda program.
.SH COPYRIGHT
Copyright (c) 2020 CismonX <admin@cismon.net>
.PP
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty, provided the copyright notice and this notice are preserved.
This file is offered as-is, without any warranty.
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty, provided the copyright notice and
this notice are preserved. This file is offered as-is, without any warranty.

View File

@ -1,4 +1,4 @@
.TH "U6A" "1" "Jan 30, 2020" "0.1.1" "U6A User Manual"
.TH "U6A" "1" "Jan 30, 2020" "0.1.1" "U6a User Manual"
.
.SH NAME
u6ac - Bytecode compiler for the Unlambda programming language
@ -14,7 +14,8 @@ Read and compile Unlambda code from the given
or
.B STDIN
if "-" is given.
Compilation result is saved in a special bytecode format, which can be executed with
Compilation result is saved in a special bytecode format, which can be executed
with
.BR u6a (1).
.
.SH OPTIONS
@ -38,15 +39,17 @@ to the beginning of
.IR out-file .
Defaults to "#!/usr/bin/env u6a\\n".
.TP
\fB\-O[\fIoptimization-level\fR]
\fB\-O\fR[\fIoptimization-level\fR]
Compile-time optimization level.
.BR \-O0 :
Turn off optimization.
.BR \-O1 (default):
Turn on basic optimizations, including constant folding & propagation, dead code elimination, etc.
Turn on basic optimizations, including constant folding & propagation,
dead code elimination, etc.
.TP
\fB\-\-syntax\-only\fR
Only check for lexical and syntactic correctness of the source file, and skips bytecode generation.
Only check for lexical and syntactic correctness of the source file, and skips
bytecode generation.
.TP
\fB\-S\fR
Produce mnemonic pseudo-instructions instead of bytecode.
@ -69,21 +72,24 @@ Prints version number, then exit.
.SS Unlambda
.TP
Language features:
All features of Unlambda 2.0 are supported, including I/O functions, continuations and promises.
All features of Unlambda 2.0 are supported, including I/O functions,
continuations and promises.
.TP
Comments:
Text in line comments is not restricted to ASCII only. UTF-8 format is also supported.
Text in line comments is not restricted to ASCII only. UTF-8 format is also
supported.
.TP
Function names:
Charactor X in functions
.B .X
and
.B ?X
must be printable ASCII or "\\n" (beware if you are using Windows-style newlines), and are case-sensitive.
Other builtin function names are case-insensitive.
must be printable ASCII or "\\n" (beware if you are using Windows-style
newlines), and are case-sensitive. Other builtin function names are
case-insensitive.
.SS Code Size
Unlambda code size should not be larger than 4MiB (not counting comments and whitespaces).
You may change this limit in
Unlambda code size should not be larger than 4MiB (not counting comments and
whitespaces). You may change this limit in
.B defs.h
and rebuild U6a for larger code to compile.
.
@ -93,5 +99,6 @@ and rebuild U6a for larger code to compile.
.SH COPYRIGHT
Copyright (c) 2020 CismonX <admin@cismon.net>
.PP
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty, provided the copyright notice and this notice are preserved.
This file is offered as-is, without any warranty.
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty, provided the copyright notice and
this notice are preserved. This file is offered as-is, without any warranty.

View File

@ -10,7 +10,7 @@ set tool "default"
set timeout 20
puts "Downloading files..."
exec wget --quiet "http://www.eleves.ens.fr:8080/home/madore/unlambda-2.0.0.tar.gz"
exec wget --quiet "ftp://ftp.madore.org/pub/madore/unlambda/unlambda-2.0.0.tar.gz"
puts "Extracting archive..."
exec tar -zxvf "unlambda-2.0.0.tar.gz" >& /dev/null