User:YamTokTpaFa/sandbox4

From Esolang
Jump to navigation Jump to search

Pxemf̃(officially pronounced [pekiˈeːmufuː] in IPA), official alternative notations are Pxem3, Pxem 3, ぺきえーむふー, is a programming language designed by User:YamTokTpaFa, derived from Pxem, an esoteric programming language that file names for a part of its code. This programming language's name and its pronunciation come from Babm, an international auxiliary language. In Babm f̃ of the name "Pxemf̃" means number three, which implies this language is the third version of Pxem[1].

Language overview

Memory system

Pxemf̃ program is operated on a virtual machine with a set of two registers: a temporary register that can have only a value and a stack, just like Pxem has.

How the file gets read

Unlike to original one, you can choose where to write your code.

  • Write on file name and on content of file, if necessary.
  • Write on content of file only.

When you run, you have to specify how your code is consist of. If your file's extension is .pxe or .pxem, former one's default while .txt and others are defaults for latter one.

Commands

In addition to 24 original commands some new commands are available:

Arithmetic operation

Unlike to original one, Pxemf̃ has two arithmetic mode that affects to subtraction .- and division .$, .%: classic mode and new mode. Switch the mode with .k and .l respectively.

  • Classic mode: No matter where they are first or second item, subtracts/divides larger item by smaller one.
  • New mode: Subtracts/Divides first item by second item.

Commenting

This command works only in content of file. Put a .# at the beginning line to write a line comment.

Control structure

Replace .a with .b to make an if-statement. .H halts the program, no matter where you are.

A for-loop statement is also available: surround the code with .u and .a. When the interpreter finds a .u,

  1. pops a value (let it ) once
  2. loops for times.

If the stack has no content, the interpreter ignores what says between .u and .a.

.# and .@ in the loop works for break and continue statements respectively.

Others

.j pushes number of items the stack currently has. .g pushes a commandline argument. The usage is:

  1. Pops an item .
  2. Pushes back the th commandline argument as a string. If the argument is not given, a single -1 gets pushed.

Finally, .q pushes filename as a string.

References

  1. Though second version hasn't been created, as on the time when this language got designed. This comes from that original designer of Pxem had an idea of the language Pxem2, which the interpreter reads not only file name, but also several meta datum, such as owner of the file, last edited time, etc. This idea had got rejected because of uselessness.