Git Product home page Git Product logo

basic.js's Introduction

This project is a work in progress and is not ready for production

Basic.js

a BASIC interpreter written in JavaScript, using the BASIN runtime.

Basic.js is a transitional language for beginners before learning JavaScript. It keeps the friendly syntax of BASIC, removing archaic ideas like line numbers and labels, while introducing JavaScript-like concepts such as functions and objects.

The core language is small and platform agnostic. As such, there are very few keywords to learn, instead, it relies on external JavaScript libraries for things such as i/o and graphics.

To Do:

  • functions
  • Arrays
  • Bool literals
  • library imports
  • objects

keywords

  • While
  • Wend
  • For
  • To
  • Step
  • Next
  • If
  • elseif
  • else
  • endif
  • print

Operators

  • +
  • -
  • *
  • /
  • :
  • =
  • <
  • >
  • <>
  • %
  • and
  • or

Example

below is an example implementation of Fizz Buzz

for i: 1 to 100
  if i % 15 = 0
    print "FizzBuzz"
  elseif i % 5 = 0
    print "Buzz"
  elseif i % 3 = 0
    print "Fizz"
  else
    print i
  endif
next

Usage

Running a .BAS file via command line: node . [path-to/script.js]

Running internal test script: npm run test

basic.js's People

Contributors

danfessler avatar danmanticore avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

zhro

basic.js's Issues

BASIC 4 US

This project is a work in progress and is not ready for production <

hello ..but that is not excuse if not work in some things properly
if you mean that ..
also looking good ..i will test it

my forum:
http://basic4us.epizy.com/forum/index.php

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.