Code Monkey home page Code Monkey logo

fiveth's Introduction

Fiveth

A stack-based language implemented in RISC-V assembly.

Building and running Fiveth

  • Edit config.mk to suit your environment
  • make to build the program

With the default config this should end a message like:

* Build complete: build/fiveth

The default configuration is to run an interactive Fiveth shell that works under a 64-bit RISC-V Linux environment. You can now:

  • make qemu to run it in QEMU user-mode emulation
  • make run to run it directly, if you are actually on RISC-V

Try typing some simple Fiveth programs. Outputs are shown after a semicolon.

0 > 1 2 + .  ; 3
0 > 10 [ . ] count  ; 0 1 2 3 4 5 6 7 8 9
0 > "Hello, world!" s.  ; Hello, world!

Press Ctrl-D to quit. docs/shell.md has more details on running and using the Fiveth interactive shell.

Installing the required tools

On Ubuntu 22.04:

# apt install qemu-user make
# # If using GNU toolchain
# apt install gcc-riscv64-linux-gnu
# # If using LLVM toolchain
# apt install clang lld

If you have Nix, you can try to use the provided shell.nix or flake.nix.

On other systems, you can try to acquire a LLVM toolchain or a RISC-V toolchain, as well as GNU make. To run Fiveth in an emulator, qemu-riscv64 can be used to emulate a Linux binary but is only supported on Linux hosts.

fiveth's People

Contributors

dramforever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.