Skip to main content

Ascript

Apex Scripting

Ascript is an easy, extensible, fast, free script interpreter.

Where

https://cordialmind.blogspot.com/2021/04/book-and-software-urls.html

Speed

BASH, busybox, C, C++, coreutils, cpio, findutils, kmod, PERL, Python, SED, systemd, util-linux are slower.

Tasks

Boot, shutdown, software logistics are possible.

Stripped Size

ELF ascript 30K! ELFSO 2M! PIC yes! PIE no!.

Compile Duration

10 seconds or less is typical.

Required

cp, gcc, install, ld, Linux, ln, make, mkdir, nm, sed, rm

Debugging

Segfault locations can be reported. Script can be traced.

Optional

Linux-PAM; file; pcre2 if installed optional argot are compiled.

Why

The ascript.5 manual page when read why becomes apparent.

Quality

4th generation revision quality was exceeded.

Fun

For the IT elite the fun noob feeling resumes. FORTRAN and CP/M are not emulated. A simple two register asm language since emulated an asm hacker similar power rush is attained.

Samples

siptest

io
out now		`Which color is pretty? `
out now		`I also like `	sip

meow-world

#!ascript/ascript
io,	out now	`Meow World.\n`

hello

#!ascript/ascript
a,	io
LC		``
target origin	LC_DOMAIN_DIR	`./locale-test\0`,=
#target origin	LC_ALL		`de_DE.utf8\0`,=
target origin	LC_ALL		`es_ES.utf8\0`,=

LC		`Hello world\0`
out		LC
# The following two files are required.
# locale-test/de/LC_MESSAGES/hello.mo
# locale-test/es/LC_MESSAGES/hello.mo
# i18n translation if done
# similar file generation was done.

timertest

#!ascript/ascript
a,	io,	self
name		t,		timer,	scope
target		t.sig,		sig restart
				sig sum
origin		"action",	sig pin
origin		t.sig.sum,	sig target
origin		1 x,		sig init

target origin	t.lull.sec	1 x,	=
target host,			timer init

	'again',		self pause
go	'again'

"action",	test,	go	'tock'
	err now	t.sig.sum	`	tick\n`,	ret
'tock'	err now	t.sig.sum	`	tock\n`,	ret

nodelisttest

a,	io,	stat

name		A
node list
node list with
node list deep
node list full
node list lean
node list less
node list link
node list most
node list name
node list path
node list type
scope
stat sym

target		A.statsym
stat size
node list stat

target		`/usr/share/man`
node list path name

'again'
node list next
go	'done'
out		`deep	`	A.deep	`\n`	\
		`full	`	A.full	`\n`	\
		`lean	`	A.lean	`\n`	\
		`less	`	A.less	`\n`	\
		`link	`	A.link	`\n`	\
		`most	`	A.most	`\n`	\
		`name	`	A.name	`\n`	\
		`path	`	A.path	`\n`	\
		`type	`	A.type	`\n`	\
		`size	`	A.statsym.size	`\n`
go	'again'

'done'
out now		`All done\n`

cpio_make

a,	err,	io

chdir	`/`
name			B,	cpio newc,	scope
name		A,		node list,	scope
node list with
node list most

target	`usr/share/man`
node list path name

target origin	B	A.most
cpio newc push
cpio newc with

'again'
node list next,		go	'done'
out			A.most	`\n`
cpio newc add,		go	'fail'
			go	'again'

'done'
#target origin		`/tmp/man.cpio`	B,	io save,	go	'fail'
target			`/man.cpio`,		cpio newc save,	go	'fail'
ret

'fail'
err not		errtext
ret

envwalk

a,	env,	io,	link

target origin		env	out

'again'
link next,		ret
target origin swap,	byte line
target origin swap
go			'again'

selfargvtest

a,	io,	ray
self,	self argv
target	self.argv

ray with
ray max

out now		`self.argv.max=`	self.argv.max	`\n`
target		out

'again'
ray origin
byte line
ray next
ret
go	'again'

inttest

a,	int,	io

name		A,	int 8,	scope,	set	5 x
name		B,	int 8,	scope,	set	6 x
name		C,	int 8,	scope,	#dex

target origin	C	A,=
       origin		B,+
out now		`C=`	C	`\n`

Style

An   argot:
when reached the     code is  executed;
at   line    start   or   aft comma exist;
by   tab     parameters   are separated;
by   comma   or line feed are ended.

UTF-8             is      supported.
By `` text bytes  are     enclosed.
By '' near lables are     enclosed.
By "" far  labels are     enclosed.
Var   names       are not enclosed.

By space and single byte suffix
such as: b; o; d; f; x
a  numeric constant is indicated.

For argot name  1 to 16 bytes exist.
For near  label 1 to 16 bytes exist.
For far   label 1 to 16 bytes exist.
For var   name  1 to 32 bytes can exist.

Operators

Asm, C, and ascript operators exist. For target data type the operators tacitly overload.

Arithmetic

8 byte and 4 byte integer and 8 byte fixed point are possible. Input output supported formats follow: ASCII binary; ASCII octal; ASCII decimal; ASCII hexadecimal; big endian; little endian.

Flow Control

For  some    argot
with success the next argot is skipped
with failure the next argot is invoked.

Errno Parsing

'EINVAL' 'E2BIG' 'EACCESS' 'ENOENT' ... near labels can be reached or visited.

Cosmetic Boons

do if then else until while [] {} () <> are abstained. In columns names when typed errors seem apparent.

Popular posts from this blog

Self Authored Books and Software URLs

At https://drive.google.com/drive/folders/1pXUmkjun5PKwQldcSRzHZU8Zo-rAb-8v?usp=sharing as google drive hosted content or at https://github.com/kyle-sallee from the git repositories master branch the ascript computer language and the books can be downloaded and viewed. From the google drive the dir content as a zip file when downloaded when extracted each file in a fixed width font terminal emulation window with 80 columns wide and 25 rows high with program less when viewed the best appearance is attained.

Life Purpose

In the book "The Great Creator Emulators" for life the reason is revealed. To do as self pleases if surmised that approximation suffices. Life and humans why create? Companions are desired. On Earth many minds exist, but where is The Great Creator? Atrocious bigoted minds since unpalatable why stay? By departing to all Earth denizens liberty was granted. The Great Creator is not a back seat driver. Heaven to approximate hell to approximate by each mind the life style is shaped. On freedom worlds for all persons liberty is sustained. Creating, giving, and liberty when done The Great Creator's footprints are followed. The Great Creator to find the freedom worlds must first be found. Atrocity and enslavement when desired when done away from The Great Creator the minds travel. On worlds like Earth atrocious minds aggregate the paydom becomes all minds are enslaved and 1% become rich. Is that apex living? On a freedom world 99.9% or more ...