Introducing Rockstar 2: The Difficult Second Version
Rockstar 2 takes center stage as an enhancement to the original Rockstar programming language, featuring an intricate but polished upgrade process. This version focuses on creating a more seamless and efficient build process for the platform codewithrockstar.com. Here's a detailed overview of how Rockstar 2 works and the steps involved in its deployment.
The Build Process
The build process for the Rockstar 2 project is a well-orchestrated series of steps tailored for different operating systems. It starts with creating and testing the core components of the language and continues through to full deployment on various platforms. Here’s how it is structured:
-
Build and Test Rockstar Engine:
- Platform: This process is set to run on Linux.
- Actions: It compiles the parser and interpreter of Rockstar.
- Testing: A comprehensive test suite is run to ensure everything functions properly.
- Artifacts Produced:
- A Linux native binary.
- A WASM (WebAssembly) interpreter specifically meant for the website.
-
Build Windows Binary:
- In this stage, the Windows-specific Rockstar binary is created, ensuring compatibility with Windows OS.
-
Build macOS Binary:
- Similarly, a binary for macOS is built, catering to Mac users.
-
Build and Deploy the Website:
- Artifact Downloads: It gathers the Linux WASM artifact from the first step, and Windows and macOS binaries from previous steps.
- Website Construction: Utilizes Jekyll to build the site, deploying it with all functionalities integrated.
Debugging and Development Setup
For developers working in a debug or development environment, Rockstar 2 offers an efficient setup method. By using symbolic directory links (symlinks), different components can communicate seamlessly, simplifying the development process:
- These symlinks connect the necessary directories within the project (.NET Solutions and WASM interpreter).
- When the .NET solution is rebuilt, it concurrently updates the WASM interpreter, prompting Jekyll to automatically rebuild the website.
- All Rockstar code excerpts are interconnected with both the
Rockstar.Test
.NET test suite and thecodewithrockstar.com
website.
Function Currying
In Rockstar syntax and operations, a noteworthy feature is function currying, which ensures functions are correctly interpreted and executed. Here's an illustrative process:
- Functions such as
sum
andproduct
need to be evaluated based on their parameters' arity (the number of arguments they take). - For example, the expression
product(sum(2,4,sum(5,6)))
must be transformed toproduct(sum(2,4),sum(5,6))
. - The challenge lies in evaluating parts of the expression like
sum(2,4)
first and correctly positioningsum(5,6)
within the broader operation, ensuring accurate results.
Rockstar 2 represents a sophisticated, efficient approach to building and deploying programming language features suited for diverse platforms. It balances complexity with functionality, offering developers and users a robust toolset for varied applications.