EsoKit

From Esolang
Jump to navigation Jump to search

EsoKit is a collection of esoteric APIs, Libraries, and other fun things designed for programming languages. It provides a series of unique APIs, entirely unlike their traditional equivalents, for doing things not in a language's standard library. Some of these features are feature-dependent (not available in languages without certain features, e.g. OO).

Library Structure

This section lays out EsoKit's library structure.for use in languages supporting imported libraries.

  • EsoKit: The base EsoKit library. Not much.
    • EsoKit.ek: The main EsoKit directory, containing traditional libraries that can be used in normal languages
      • EsoKit.ek.io: Unique ways of doing input and output
      • EsoKit.ek.esocket: Socketry in a non-BSD fashion
      • EsoKit.ek.math: Mathematical libraries, including normal math and more esoteric things
        • EsoKit.ek.math.mm: Material Measurements, a library for dealing with (including converting) measurements in a strange way involving lists
        • EsoKit.ek.math.geom: A geometry-based library. Allows you to create lines and stuff.
      • EsoKIt.ek.gui: GUI applications
        • EsoKit.ek.guwhy: A strange, Qt5-based GUI library.
        • EsoKit.ek.simplegui: The most basic GUI available.
      • EsoKit.ek.var: Variables stored in the interpreter. Designed for tapey languages.
    • EsoKit.nsi: The directory containing nonstandard interfaces (things which aren't just a collection of functions) for interacting with the EsoKit.
      • EsoKit.nsi.io: The IO-based interface, targeted at languages for which normal libraries are not supported (e.g. brainfuck.) (similar to PSOX, from my understanding)
        • EsoKit.nsi.io.*: All the same libraries as in EsoKit.ek, along with the standard equivalents (for example, normal socketry) and normal features that esolangs using it may not support already (for example, printing to the stderr), but with the EsoKit.nsi.io prefix
        • EsoKit.nsi.io.err: Exactly the same as EsoKit.nsi.io, except messages being sent to the layer are sent via the stderr instead of the stdout.
      • EsoKit.nsi.file: The interface involving writing to/retrieving data from files. To, for example, calculate sine of a given number, you import EsoKit.nsi.file.math.standard (the file-based interface for doing math using standard mathematics libraries) and write the desired number to EsoKit.nsi.file.math.standard.sine then read that file, which now contains the correct number. Useful for a more logical way of dealing with libraries than IO, but not all languages support file IO.
        • EsoKit.nsi.file.*: All the same libraries as in EsoKit.ek, along with the standard equivalents (for example, normal socketry) and normal features that esolangs using it may not support already (for example, printing to the stderr), but with the EsoKit.nsi.file prefix.
    • EsoKit.dev: The implementer's tools.
      • EsoKit.dev.*: Tool libraries made for implementing all features included in EsoKit.ek.* and in EsoKit.nsi.*. For example, an EsoKit.dev.nsi.io.putch() command that allows EsoKit.nsi.io to be used more easily. EsoKit.dev is entirely optional for usage in implementation, of course, so you can roll your own EsoKit toolset if you desire.

Primary Submodules

EsoKit has three primary submodules: EsoKit.ek, the main one for languages with libraries, EsoKit.nsi, which in turn has more submodules for different interfaces, for languages that do not. There is also EsoKit.dev, which includes tools for implementation.

EsoKit.ek

EsoKit.ek is the standard EsoKit library, designed to be used in languages that can support it. Languages that can support it include most normal programming languages (such as Python and Java) along with many advanced EsoLangs (that implement library usage). EsoKit.ek includes esoteric equivalents of many standard libraries, along with completely alien libraries that still have a usage.

EsoKit.nsi

EsoKit.nsi is a module within EsoKit designed to be used with languages that don't support normal libraries, such as brainfuck, though it is also supported in implementations for libraries that do such as to allow Python users, for example, to play with it. The desired (hopefully most logical, given the language in question) submodule of EsoKit.nsi should be built-in to the language interpreter, possibly accessible by a separate command (though this is not recommended). It contains a set of substitute interface for dealing with EsoKit things, which are made to cater to languages' abilities. the EsoKit.nsi submodules for dealing with these are:

Each of these is designed to play to the desired languages' strengths, and supports all the features that EsoKit.ek does in their own unique way. They also include features that languages implementing them will tend not to include (for example, printing to the stderr as in brainfuck) along with the normal equivalents of EsoKit.ek libraries for simplicity, such as BSD sockets to complement esockets.

EsoKit.dev

EsoKit.dev is a submodule made to better enable users creating EsoKit-enabled languages within other EsoKit-enabled languages. Including EsoKit.dev is entirely optional for an officially-complete EsoKit implementation, and really is only meant to be included in normal language implementations.

EsoKit.dev includes basic functions and classes for users to implement EsoKit in, such as a putch() command that automatically respects EsoKit.nsi.io printing, which will be invaluable in implementing a brainfuck interpreter.

Libraries

Because libraries in EsoKit will be large-ish, their documentation will be put on subpages of this page for a more logical arrangement.

Functions in the EsoKit.ek Module

EsoKit.ek contains a small number of toplevel functions mostly targeted at usage with a non-standard interface. These functions are:

  • EsoKit.ek.t: return NUL (via the standard input, in an NSI). Used solely to test if EsoKit is available in the current installation.
  • EsoKit.ek.v: Return the version as a string of ASCII characters corresponding to the version (so version 33.35 returns !#).
  • EsoKit.ek.err: A nice little function for outputting to the stderr for languages without that feature. Included here for convenience.

Implementations

None yet! Python coming someday, along with an EsoKit.nsi.io-enabled brainfuck interpreter.

TODO

  • Design all the EsoKit.ek submodules
  • Design the way the EsoKit.nsi.* interfaces work, specifically.
  • Implement in Python
  • Write an EsoKit.nsi.io-enabled BF interpreter

Contributing

You can contribute in various ways: You can fork/make a pull request (or whatever that's called) to an implementation on GitHub in an effort to make it more complete, you can start your own implementation, you can fix any major errors (not in design, but in grammar and such) in these articles, you can submit suggestions about what to add or alerts about an inconsistency on a relevant talk page, or many other things that I cannot think to list here. Just don't change anything about the EsoKit itself unless you are on board on its development and design team.

Licensing

Since the EsoKit is being designed entirely on the wiki, all known specifications are Public Domain, and as such the EsoKit itself is pretty much necessarily public domain. However, we would greatly appreciate a comment in your source code and a link to this article or some other thing to point people in our direction when you talk about or use the EsoKit.