联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2020-08-15 11:07

CourSys - Project: the Polyglot

Project: the Polyglot

This is project is to be completed individually.

As usual, you should clearly cite the source of any code (or other content) you use from outside sources.

Project Requirements

The goal of this project is to build a single system that uses multiple languages to do its work.

It is very difficult to quantify the “size” of a project, but it should be enough to justify marks for 26% of a 3rd year CMPT course. In particular for

this project, you should have:

several pieces of interacting functionality (which give us the excuse to use multiple languages);

overall complexity that leads to a thousand to several thousand lines of code (while also noting that lines of code is a horrible way to measure

complexity of software);

complexity added by the technical challenge of getting multiple languages to work together;

a system that can be easily deployed and actually works.

A couple of possible topics for the project can be found on the project ideas page. You do not have to choose from those ideas and are free to

choose any topic if it meets the requirements specified below.

Language Requirements

You project must be implemented using three different languages. The focus of the project will be cross-language implementations and

communicating between languages. Some restrictions on your language choices:

At least one “systems” language (like C, C++, Go, Rust).

At least one “scripting” language (like Bash, JavaScript, Julia, Perl, PHP, Python, R, Tcl).

C and C++ count as one language.

Only programming languages count toward your language count (e.g. not SQL, HTML, CSS, etc).

Languages should be reasonably appropriate to the work done with them.

It is expected that you write some code in each of the three languages, but not that you write an equal amount in each language. It is reasonable to

have one language that is used fairly little (possibly just a little code to connect a library from that language), and possibly another that is a relatively

minor part of the system.

Cross-Language Communication

You must use two different ways to communicate between languages your languages. These might include:

A foreign function interface (https://en.wikipedia.org/wiki/Foreign_function_interface) where you can somehow call a function from one language

in another. If you search for “call language1 function from language2”, you'll probably find something (if it exists). See also

SWIG (http://www.swig.org/) which helps call C/C++ from many languages.

A message queue such as RabbitMQ (https://www.rabbitmq.com/) or ZeroMQ (https://zeromq.org/) . The RabbitMQ

tutorials (https://www.rabbitmq.com/getstarted.html) give good RPC (remote procedure call) examples in many languages: you can use one

language as the client and the other as the server.

8/12/2020 CourSys - Project: the Polyglot

https://coursys.sfu.ca/2020su-cmpt-383-d1/pages/Project 2/3

Create an RPC (XML-RPC or REST) server in one language and make a request to it from another. You can probably find an XML-RPC or REST

library for either language and write relatively little code to connect them to your function/function call.

A compiler toolchain that will compile both languages and let you call one from the other, like the GraalVM polyglot

features (https://www.graalvm.org/docs/reference-manual/polyglot/) or the various languages that compile to the

JVM (https://en.wikipedia.org/wiki/List_of_JVM_languages) .

Run the other language's code as an executable (exec (https://linux.die.net/man/3/exec) and friends, or often a “system” function in many

languages) and capture its output (stdout) into a string. Or have it write a temporary file and read it from the other program.

Implementation and Deployment

Your code must be in a repository on the CS GitLab server (https://csil-git1.cs.surrey.sfu.ca/) . Your final submission will be a tag in this repository

that we will check out.

We need to be able to run your system to test it. Add the instructor and TAs as “developers” on your repository: ggbaker, amutasim, mshojayi. [On

your project page: Settings → Members → Invite]

We have provided you with a template for the project (https://csil-git1.cs.surrey.sfu.ca/ggbaker/383-project) that contains (mostly commented-out)

setup for running code in many languages in a virtual machine. You can modify the setup recipe (cookbooks/polyglot/recipes/default.rb)

to install whatever tools you need so your system can run.

By the time you're done, starting the VM (with vagrant up) should get your system into a runnable state. You may have a few components that

need to be started by hand (like an RPC server). That is fine, but only one or two, and make sure they are clearly documented in your project

summary (described below).

See the Project Deployment page for more information on working with the virtual machine and Chef recipes.

Project Summary

In your project repository, include a file cmpt383.txt or cmpt383.md and briefly summarize:

What is the overall goal of the project (i.e. what does it do, or what problem is it solving)?

Which languages did you use, and what parts of the system are implemented in each?

What methods did you use to communicate between languages?

Exactly what steps should be taken to get the project working, after getting your code? [This should start with vagrant up and can include one or

two commands to start components after that.]

What features should we be looking for when marking your project?

The purpose of this is not to make you write an essay, just to guide the marking so we don't miss anything important. (There will be many projects,

and the TAs are human.)

Marking

The marking scheme will include marks for: [These may change, but will give an idea of what we're looking for.]

Problem: Is the problem you are solving interesting and appropriate to a polyglot system?

Languages: Three appropriate languages have been used meeting the requirements of the project.

Cross-Language Communication: Two different methods to communicate between languages have been used appropriately.

Difficulty: The project includes features that required non-trivial implementations or techniques.

8/12/2020 CourSys - Project: the Polyglot

https://coursys.sfu.ca/2020su-cmpt-383-d1/pages/Project 3/3

Extras: The project includes interesting features, or uses techniques that go beyond the minimum requirements.

Submitting

Create a Git tag (named final or similar) in your project repository:

git tag final

git push origin --tags

Make sure you add the instructor and TAs as “developers” on your repository: ggbaker, amutasim, mshojayi.

Submit a link to that tag in your repository through CourSys for the Project activity.

Updated Tue Aug. 04 2020, 19:43 by ggbaker.


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp