Building Stanza compiler from Source


sgn.hamilton+lbstanza@...
 

Perfect, this worked for me, thanks ! I can even build stanza with it.


 

Hi Scott,

Sorry for the delay in replying. I just pushed a new version of Stanza (0.14.31) to the website that adds an additional hook to help you in your NixOS setup.

After standard installation, the default Stanza installation creates a .stanza file in your home directory that contains something like this:

install-dir = "/Applications/stanza"
platform = linux

You can edit that and add this additional option:

install-dir = "/Applications/stanza"
platform = linux
aux-file = "mystanza.aux"

which allows you to provide a custom location for the auxiliary file. This will allow you to keep the installation directory for Stanza on a read-only filesystem.

Hope this helps! Patrick


sgn.hamilton+lbstanza@...
 

Ok, I've downloaded 0.14.28 and it worked. But know I have another issue.
I can't build anything because the builder tries to alter the installation directory which is in a read-only partition.

```

Error occurred when attempting to open file

 

/nix/store/0i7br9xr9g8fvrwmb2z0wjww7brp560h-lbstanza-bin-0.14.28/stanza.aux. Read-only file system.
```
I created a simple Nix package for lbstanza and it works well but the way Nix works doesn't allow anything to alter the final packages so the compiler is not allowed to alter anything in the installation dir, instead it should use either the current directory or a local state directory like other programs do.

Maybe you'd like me to open an issue on the github repo ?


 

Oh that's great! Okay, very easy fix.

Go to lbstanza.org and download version 0.14.27 instead of what is currently marked as "Stable".

The "experimental" line of bundles are now quite stable, and are much more feature-ful.


sgn.hamilton+lbstanza@...
 

I actually have a build-stanza.proj file in the root directory of the source directory. I didn't clone the entire github repo because of bandwidth issues but I downloaded the master tree zip from github.

ls

bin                ChangeLog.txt  core  examples  License.txt  notes.doc  README.md  scripts      tests
build-stanza.proj  compiler       docs  include   notes        oldtests   runtime    stanza.proj
Anyway, here is the output of the command:

stanza build-stanza.proj stz/driver -s stanza.s -optimize -verboseAnyway, here is the output of the command:

EXTEND-HEAP-ID = 1000000
EXTEND-STACK-ID = 1000001
VARIABLE-UNINITIALIZED-ERROR-ID = 1000002
TUPLE-LENGTH-ERROR-ID = 1000003
NO-BRANCH-ERROR-ID = 1000006
AMB-BRANCH-ERROR-ID = 1000007
CAST-ERROR-ID = 1000008
ARITY-ERROR-ID = 1000009
BYTE-TYPE-ID = 1000013
CHAR-TYPE-ID = 1000014
INT-TYPE-ID = 1000015
LONG-TYPE-ID = 1000016
FLOAT-TYPE-ID = 1000017
DOUBLE-TYPE-ID = 1000018
STRING-TYPE-ID = 1000019
SYMBOL-TYPE-ID = 1000020
LIST-TYPE-ID = 1000021
ARRAY-TYPE-ID = 1000022
CHAR-ARRAY-TYPE-ID = 1000023
TRUE-TYPE-ID = 1000024
FALSE-TYPE-ID = 1000025
TUPLE-TYPE-ID = 1000026
FN-TYPE-ID = 1000027
STACK-TYPE-ID = 1000028
TYPE-TYPE-ID = 1000029
BOX-TYPE-ID = 1000030
BYTE-VALUE-FIELD-ID = 1000031
CHAR-VALUE-FIELD-ID = 1000032
INT-VALUE-FIELD-ID = 1000033
FLOAT-VALUE-FIELD-ID = 1000034
HEAP-PTR-LBL = 1000044
HEAP-LIM-LBL = 1000045
STACK-PTR-LBL = 1000046
STACK-LIM-LBL = 1000047
STACK-POOL-LBL = 1000048
NUM-FREE-STACKS-LBL = 1000049
FREE-STACKS-LBL = 1000050
STACK-LBL = 1000051
RETRACT-STACK-LBL = 1000052
EXTEND-STACK-LBL = 1000053
FLOAT-ZERO-LBL = 1000054
DOUBLE-ZERO-LBL = 1000055
ARG-LBL = 1000056
SWAP-LBL = 1000057
C-RSP-LBL = 1000058
OBJECT-TABLE-LBL = 1000059
GLOBAL-TABLE-LBL = 1000060
GLOBAL-MAP-LBL = 1000061
CONSTANT-TABLE-LBL = 1000062
INFO-TABLE-LBL = 1000063




============================================================
=========================== Check ==========================
============================================================
Could not locate package build-stanza.proj.
 


 

Actually, now that I read your specific error message more carefully, it does look a little strange. I wonder if I'm assuming about the file system that is done differently in NixOS.

Can you try this?

stanza build-stanza.proj stz/driver -s stanza.s -optimize -verbose


 

Hi Scott!

Hmm, it might be because you are trying to build Stanza using the source code provided in the lbstanza.org bundle. That bundle is missing some files such as build-stanza.proj needed to build Stanza from scratch.

The source code repo on GitHub should have that file.

Let me know if that works for you,

Patrick


sgn.hamilton+lbstanza@...
 

Thanks for the reply !

I tried this command in the root source directory :
```
stanza build-stanza.proj stz/driver -s stanza.s -optimize
```
But I got this output:
```
Could not locate package build-stanza.proj
```

Scott H.


 
Edited

Hello!

Stanza is fully-bootstrapped which means that you need an existing Stanza compiler to compile itself. Here's the steps to take however:

1) Download Stanza from lbstanza.org and install it.

2) Grab the source code from GitHub (https://github.com/StanzaOrg/lbstanza)

3) cd into the Github source directory and run

stanza build-stanza.proj stz/driver -s stanza.s -optimize
scripts/lfinish.sh

Hope that helps! Patrick


sgn.hamilton+lbstanza@...
 

Hello, I'm very interested in Stanza and would like to start using it on my NixOS machine. I didn't find any package for it on the nixpkgs repo so I guess I'll have to package it myself.

I found that the stanza compiler is configured with .proj files. https://github.com/StanzaOrg/lbstanza I'm not very familiar with this build system, would give me some hints on how I should build it from source ?