Giter Site home page Giter Site logo

fishlanguage.com's Introduction

The Online ><> Interpreter

fishlanguage.com has been reborn! Rewritten completely from scratch after first having been abandoned, because apparently you guys were not happy with TIO.

It features a number of improvements, like the ability to view output as hex, or view input as numbers or text. Also, pretty much instant code execution without hanging the entire browser

The interpreter itself is also available as an npm package, should you suddenly get the urge to interpret ><> in your JavaScript application

Usage

The interpreter is used much like the old one. Just fool around with it, and you will figure it out

Initial stack

You can give an initial stack to your program, so you don't have to initialize it in the code. Before the program is started, there is an input field for setting it.

It has two buttons related to it: "Interpret as text" and "Interpret as array".

The stack holds numbers only. Writing text in the input and clicking "Interpret as text" will convert your text to an array of numbers based on the characters' unicode values. You can, however, give it arbritary numeric values. Writing 1, 2, 3, 85, 869543723, 3.14159 and clicking the "Interpret as array" button will give you exactly that: The stack [1, 2, 3, 85, 869543723, 3.14159]. Just keep in mind that no matter how you give it, it will be interpreted bt the program as numbers

Giving input

This works much the same way as setting the initial stack, except the input stream works on characters, not numbers. Basically, this means you can only give it integers in the range 0-65535. Just as with the initial stack, however, you can give it as text or an array. Just keep in mind that no matter how you give it, it will be interpreted by the program as characters

Execution speed

This should be fairly intuitive. The farther to the left, the slower the program runs. The farther to the right, the faster it runs. It basically controls the timeout between two steps of the program

Setting the slider to the far right, however, will set the program to immediate execution. It will do batches of 10 000 steps instead of one and one. After each batch it will yield, so it can be paused if you accidently made an infinite loop or something.

Data view

The program's data can be viewed in four fields: Input queue, stack, output and steps. You will notice the three former have a small button next to the labels. Clicking it toggles the view mode of the data.

For the input buffer and the stack, it toggles between viewing the data as numbers or characters. It will NOT change the way the program uses these data; they will still be consumed as characters (input) and numbers (stack) no matter which view mode you use

For the output, it toggles between text mode and hex mode. The text mode is what you usually want, but you can also see the outputted bytes as a hex dump if you so wish

Building

This is an open source project, so of course I will provide build instructions if you want to build it yourself

It's quite simple. The code is a JavaScript project built with WebPack. To get started, simply run npm install followed by npm run build. You now have a directory called build/ which contains the file index.html. Click it, and you have your very own version of fishlanguage.com!

fishlanguage.com's People

Contributors

suppen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.