dasic 2.0.3

  • Readme
  • Changelog
  • Installing
  • 40

Dasic - Dart BASIC interpreter #

Dasic is a complete standalone interpreter for a dialect of the original BASIC language. It handles tokenizing, parsing, interpreting, output, variables, expressions, and flow control, like a full-scale compiler or interpreter, just in miniature. I tried to keep the code simple and readable while still being short and readable.

If you've ever wanted a gentle introduction to how a programming languages work under the hood, Dasic is a good place to start.

Sample #

Result of dasic packages/dasic/scripts/mandel.das

                                                ----------
                                          ---------++*+++-------
                                      -------------+++*=*=++-------
                                  ---------------++*==@@@=+++---------
                               -------------++++++=*@@@@@@@+++---------
                            ------------+++++++++===@@@@@@==++++++++++---
                         ------------+++**@@@=*@@@@@@@@@@@@@@@@===*====---
                     -------------++++++==*@@@@@@@@@@@@@@@@@@@@@@@@@*+++---
               -----++++++++++++++++++=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++----
        -----------++=====+=*=+++++++*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*+----
    --------------+++++=@@@@@@@@*@===@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=++-----
  -------------++++++=@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*+------
 ------++++++++++=*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++------
 --++++=+++=+++@=*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=++++------
 ---------+++++++=====@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=++------
   --------------++++===@@@@@@@@@@@==@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++-----
     -------------++++==@*==*@=@==+==@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*=++----
           --------+++=+++++=++++++++=@*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@==*+----
                  --------------++++++=@=@@@@@@@@@@@@@@@@@@@@@@@@@@*=+++----
                       ------------++++++=@@@@@@@@@@@@@@@@@@@@@@*@@@@=+----
                           -----------++=@*==+=@@@**@@@@@@*=*=@=++++==+---
                              ------------++++++++=@@@@@@@@++++++-------
                                 --------------+++*@*@@@*=@++----------
                                    --------------++++=@=+++---------
                                        -----------++==++++-------
                                             -------=+--------

Install #

If you don't have Dart on your machine - Download and install it from here

Install Dasic

    pub global activate dasic

Update Dasic

    # activate dasic again
    pub global activate dasic

Uninstall Dasic

    pub global deactivate dasic   

Usage #

Try


    dasic packages/dasic/scripts/hello.das
    dasic packages/dasic/scripts/hellos.das
    dasic packages/dasic/scripts/mandel.das

More Info #

The real information about Dasic, including the language syntax and how the interpreter works is all in with the code, so go ahead and read through Dasi.

If you have any questions, feel free to get in touch. Cheers!

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Thanks #

I want to thank "Bob Nystrom" for his base-work "JASIC"! You can read more from Bob and about "A Complete Interpreter in One Java File" here on his Blog.
Java-Version of Dasic is Jasic

License #

Copyright 2015 Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited, Austrian Branch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language
governing permissions and limitations under the License.

Change Log for dasic #

Dasic is a complete standalone interpreter for a dialect of the original BASIC language.

v1.1.1 - 2016-11-16

Docs #

v1.1.0 - 2015-12-08

Docs #

v1.0.0 - 2015-06-17

Docs #

This CHANGELOG.md was generated with Changelog for Dart

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate dasic

2. Use it

The package has the following executables:


$ dasic

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dasic: ^2.0.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dasic/dasic.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
79
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
40
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:dasic/dasic.dart with components: io.

Health suggestions

Fix lib/src/Parser.dart. (-6.78 points)

Analysis of lib/src/Parser.dart reported 14 hints, including:

line 22 col 1: Prefer using /// for doc comments.

line 39 col 5: Prefer using /// for doc comments.

line 56 col 47: DO use curly braces for all flow control structures.

line 89 col 18: DO use curly braces for all flow control structures.

line 100 col 5: Prefer using /// for doc comments.

Fix lib/src/Statement.dart. (-3.45 points)

Analysis of lib/src/Statement.dart reported 7 hints, including:

line 32 col 1: Prefer using /// for doc comments.

line 38 col 5: Prefer using /// for doc comments.

line 52 col 1: Prefer using /// for doc comments.

line 67 col 1: Prefer using /// for doc comments.

line 100 col 1: Prefer using /// for doc comments.

Fix lib/cmdline/Application.dart. (-2.48 points)

Analysis of lib/cmdline/Application.dart reported 5 hints:

line 22 col 1: Prefer using /// for doc comments.

line 48 col 61: Use isEmpty instead of length

line 48 col 95: Use isEmpty instead of length

line 59 col 16: Use isNotEmpty instead of length

line 74 col 43: Use isEmpty instead of length

Fix additional 11 files with analysis or formatting issues. (-9.96 points)

Additional issues in the following files:

  • lib/src/Value.dart (5 hints)
  • lib/src/Expression.dart (4 hints)
  • lib/src/Token.dart (3 hints)
  • lib/cmdline/Config.dart (2 hints)
  • lib/src/Interpreter.dart (2 hints)
  • lib/src/Lexer.dart (2 hints)
  • lib/cmdline.dart (1 hint)
  • lib/dasic.dart (1 hint)
  • bin/dasic.dart (Run dartfmt to format bin/dasic.dart.)
  • lib/cmdline/Options.dart (Run dartfmt to format lib/cmdline/Options.dart.)
  • lib/src/Utils.dart (Run dartfmt to format lib/src/Utils.dart.)

Maintenance issues and suggestions

Use analysis_options.yaml. (-10 points)

Change the name of your package's .analysis_options file to analysis_options.yaml.

Read more about the setup of analysis-options.yaml.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and dasic.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args ^1.4.0 1.5.2
console_log_handler ^1.0.0 1.1.6
logging >=0.11.3 <1.0.0 0.11.3+2
validate ^1.0.0 1.7.0
yaml ^2.1.0 2.2.0
Transitive dependencies
ansicolor 1.0.2
charcode 1.1.2
collection 1.14.12
intl 0.16.0
meta 1.1.8
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
Dev dependencies
build_runner any
build_test any
grinder any
test any