cubix-framework / cubix-tutorial

Tutorial exercises for Cubix framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

These are the exercises accompanying the Cubix tutorial. They are found in the tutorial folder.

  • Exercise 1: Language fragments: Creating a toy language using the style of representation used by Cubix
  • Exercise 2: Parametric syntax: Writing a small transformation that runs on multiple languages
  • Exercise 3: Incremental parametric syntax: Expressing a language using a hybrid of language-specific and generic parts
  • Exercise 4: Language-parametric transformation: Writing a sanitization transformation that runs on C, Java, JavaScript, Lua, and Python

Getting started

Open the documentation for Cubix.Essentials. This is a companion to this tutorial. It contains everything you will need to complete the exercises, organized in a tutorial form.

For exercise 2 and later, you'll also want to open the documentation for Cubix.Language.Parametric.Syntax, which contains the generic nodes shared across language representations.

Now, open up tutorial/ex1/Main.hs and start following along.

To build:

./scripts/fastbuild.sh # Normal "stack build" also suffices

To run your exercises

stack exec tut1 # Or tut2, tut3, tut4

To run the standard solutions

stack exec soln1 # Or soln2, soln3, soln4

About

Tutorial exercises for Cubix framework

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Haskell 95.3%Language:C 1.3%Language:Lua 1.0%Language:Java 0.9%Language:JavaScript 0.8%Language:Python 0.7%Language:Shell 0.1%