It's Just Perl!

From Esolang
Jump to navigation Jump to search

It's Just Perl is a dumb OISC by User:BoundedBeans where It's Just Perl!

The instruction

It's Just Perl! A B C D E F

(where A-F are numbers)

  • Using A as a starting address, with B pointing to a number of characters to read, do a Perl eval and return a string
    • Characters are interpreted as abs(num) modulo 256
    • If A does not point to valid Perl code, error
  • Write the string to consecutive bytes in C, and the length to D. Stop writing if the string reaches n characters, where n is the number pointed to by E
  • If the first byte of the string is between 0-127 inclusive, goto F

The arguments are directly stored in memory, so they can be self-modified by Perl. Nothing else is initially stored. Pre-loading byte-by-byte is severely necessary since otherwise no Perl code will be able to run.

Perl contents

Perl has access to the full standard library, and a filesystem to read and write to and load packages from. This filesystem is consistent across evals. Variables cannot be guaranteed consistent, though they might be. Additional packages can be extensions.

Also, there is one extra package available: It::sJustPerl (a.k.a. It'sJustPerl). It contains the following subroutines:

  • readMem, accepts a number as a memory index, returns the number at that It's Just Perl memory address