Giter Site home page Giter Site logo

lab-1's Introduction

Lab 1

Refer to the lab handout lab1.pdf for details about the assignment. This file provides some information to help you get started with setting up your development environment for the labs.

Important Files

├── README.md  (this file)
├── grader  (autograder project files)
├── koans  (Scala Koans)
├── src
│   ├── main
│   │   ├── java
│   │   └── scala
│   │       ├── Lab1.scala  (implementation template to submit)
│   │       └── jsy
│   │           └── lab1
│   │               └── ast.scala  (JavaScripty AST classes)
│   └── test
│       ├── java
│       └── scala
│           └── Lab1Spec.scala  (ScalaTest unit tests)
└── testjsy  (some JavaScripty test cases)
    ├── test01_arith.jsy
    └── test02_divbyzero.jsy

Scala Development Tools

We will use a slightly older version of Scala (at least for Lab 1), namely 2.10.3. The provided build.sbt uses this dependency.

The TAs will support Scala IDE for Eclipse for Scala development in this course. You are welcome to use any development environment, but we may not be able answer questions in your particular environment.

To install Scala IDE, first download and install Eclipse. The standard package is sufficient. For Fall 2014, we suggest installing Eclipse Kepler (the latest supported version). Then, follow the directions for installing Scala IDE.

Eclipse Import

To import the Lab 1 project files into Eclipse, go to

File > Import > Existing Projects into Workspace (under General)

and then select

Select archive file:

and browse to the lab1.zip that you downloaded from the course website.

Command-Line Tools

While not required if you have installed Scala IDE, you may also want to install the command-line Scala compiler and tools. If you would like to build the project on the command-line, you should install sbt. Scala and sbt is available in many OS-specific package managers.

For your convenience, an sbt script (build.sbt) is included. You can issue the following commands to compile, run and test your code:

$ sbt run

runs your project (after compiling).

$ sbt clean

deletes the previous compilation.

It is often convenient to run sbt interactively

$ sbt

and then run via

> run

at the sbt prompt.

Scala Interpreter

From the command-line, you can start the scala interpreter using the command

$ scala

and can import the functions in your lab in the following way

scala> import Lab1._

Note that you will need to run the scala interpreter in the same directory as the compiled version (lab1/bin/).

In Scala IDE, you can start a Scala interpreter with the project files available by selecting

Window > Show View > Scala Interpreter

ScalaTest

We will be using the ScalaTest framework for unit testing. Using this framework, we practice test-driven development (TDD), a standard practice in industry.

We suggest you install the ScalaTest plugin for Scala IDE.

You do not need to explicitly download ScalaTest.

We provide some unit tests in Lab1Spec.scala to drive your implementation. To run tests, right-click on the file and select

Run As > ScalaTest - File

You can also run tests via

$ sbt test

JavaScripty Interpreter

You can run your JavaScripty interpreter with a file (e.g., tests in testjsy/) in Eclipse by right-clicking on Lab1.scala by setting up a Run Configuration:

Run As > Run Configuration ...

For quick experimentation, it is more convenient to use the Scala Interpreter window.

Autograder

A part of your lab grade is determined by passing a set of grading tests. To run the autograder, do

$ sbt "project lab1-grader" run

For Lab 1, the grading tests are those in Lab1Spec.scala. In future labs, these test sets may diverge.

lab-1's People

Contributors

azizdayel avatar

Stargazers

Gabriela Mendoza avatar

Watchers

James Cloos 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.