Date   

Re: Building Stanza compiler from Source

sgn.hamilton+lbstanza@...
 

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


Re: Building Stanza compiler from Source

 

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


Re: Building Stanza compiler from Source

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 ?


Re: Building Stanza compiler from Source

 

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.


Re: Building Stanza compiler from Source

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.
 


Re: Building Stanza compiler from Source

 

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


Re: Building Stanza compiler from Source

 

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


Re: Building Stanza compiler from Source

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.


Re: Building Stanza compiler from Source

 
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


Building Stanza compiler from Source

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 ?


Re: 2020 Status

 

I do agree that pure functions are super useful if the analysis is accurate enough. The main reason that we deferred this feature was that without a lot of work, our analysis would be way too conservative. Almost everything would be flagged as potentially impure because Stanza is too flexible in what it allows users to do.

I'll add the Stanza thesis to the website. Thanks for the suggestion!


Re: 2020 Status

Eric Toombs
 

Ah yeah, here it is, Philip: https://github.com/StanzaOrg/lbstanza/issues/43

*Somebody* closed the feature request :D

As for a full use case, huh, that will take longer. I have struggled
before trying to convince people that hey pure functions are actually
super useful, always thinking the usefulness was self evident.

The biggest resistance I always get is "BUT MUH PRINTF!!!1!" basically.
(see https://github.com/vlang/v/issues/3090)

That and, "I just wanna change my variables!" I get that one a lot from
game devs.

The worst effects are typically only truly unmanageable at scale, so I
will need some time to think, but I will try to cook up some really
good, plausible, but still small-scale bugs that could have been easy to
fix, or perhaps avoid altogether with pure functions. Also, lol, cooking
up bugs. Tasty. Actually, though. Fried mealworms are delicious. But I
digest.

On 2020-01-07 18:37, p.z.trotter@gmail.com wrote:
*hi Eric , * *re: pure  function annotations*

D-lang also has a pure function attribute thats proved very helpful for
debugging and thinking about code  side effects -

so agree its very valuable feature for stated reasons, but also agree
with Patrick on priority. 

Once the LLVM backend is in place - I  think this should be relatively
straightforward to add via existing  LLVM  infrastructure for function
attributes. 
(if interested - Seth Goldstien@ Carnegie Melon uni has a good write up
of how add function attributes  when going through clang to llvm
see http://www.cs.cmu.edu/~seth/llvm/llvmannotation.html )
<http://www.cs.cmu.edu/~seth/llvm/llvmannotation.html>

Not sure at this point, how to port to existing backends - but thats
just a matter of getting used to codebase - so I'll have a think on this
- since its something I would like as well

*Eric*  - can you create  an issue on github , so it doesnt get
forgotten and add your use case info then we can see if its doable as a
community contrib?

 

*Patrick* - *re; Dylan and Jonathan* : Yup - I knew of Jonathan's work
at Harlequin, and your thesis nicely covers supporting influences and
related works.

BTW - Would it be possible to add your thesis to the Stanza website
documentation ?- its a good read and might be very helpful for folks
discovering Stanza.

 

- Phillip

 


Re: 2020 Status

p.z.trotter@...
 

hi Eric ,  re: pure  function annotations

D-lang also has a pure function attribute thats proved very helpful for debugging and thinking about code  side effects -

so agree its very valuable feature for stated reasons, but also agree with Patrick on priority. 

Once the LLVM backend is in place - I  think this should be relatively straightforward to add via existing  LLVM  infrastructure for function attributes. 
(if interested - Seth Goldstien@ Carnegie Melon uni has a good write up of how add function attributes  when going through clang to llvm see http://www.cs.cmu.edu/~seth/llvm/llvmannotation.html )

Not sure at this point, how to port to existing backends - but thats just a matter of getting used to codebase - so I'll have a think on this - since its something I would like as well

Eric  - can you create  an issue on github , so it doesnt get forgotten and add your use case info then we can see if its doable as a community contrib?

 

Patrick - re; Dylan and Jonathan : Yup - I knew of Jonathan's work at Harlequin, and your thesis nicely covers supporting influences and related works.

BTW - Would it be possible to add your thesis to the Stanza website documentation ?- its a good read and might be very helpful for folks discovering Stanza.

 

- Phillip

 


Re: 2020 Status

Eric Toombs
 

The optimisation thing, yeah, that's not too important compared to LLVM.
But knowing a function is guaranteed not to have side effects would be
nice for code reasoning and debugging purposes.

On 2020-01-07 02:10, Patrick S. Li wrote:
Hi Eric,

The purity annotations has been deferred until later. One of the primary
reasons for adding it is to give the optimizer more information to make
more aggressive transformations. However, there's a number of other
optimizations that will have more impact that we decided to prioritize
first. (Such as the LLVM backend).

Patrick


Re: 2020 Status

 

Hi Eric,

The purity annotations has been deferred until later. One of the primary reasons for adding it is to give the optimizer more information to make more aggressive transformations. However, there's a number of other optimizations that will have more impact that we decided to prioritize first. (Such as the LLVM backend).

Patrick


Re: 2020 Status

Eric Toombs
 

I asked a few years ago about guarantees for pure functions. Any work
happening there?

On 2020-01-05 13:21, Patrick S. Li wrote:
Cool, a Dylan fan! Jonathan Bachrach, my advisor, was one of the early
people to work on that system. It influenced Stanza's design greatly.

Sounds good. Just post here if you have any questions.

Patrick


Re: 2020 Status

 

Cool, a Dylan fan! Jonathan Bachrach, my advisor, was one of the early people to work on that system. It influenced Stanza's design greatly.

Sounds good. Just post here if you have any questions.

Patrick


Re: 2020 Status

p.z.trotter@...
 

Hi Patrick,

Thanks for the quick response - very helpful and very encouraging.

I use LLVM iwith OpenDylan and its proved very useful for C/C++  libray  and platform integration

Stanza is a already a lovely language to work with and I can see LLVM backend and LSP support will  help drive a lot of adoption.

I'll dig into the experimental branch and post to the forums if i have any questions.

thanks much.

P,

 


Re: 2020 Status

 

Hello!

Stanza development is active however the website has definitely fallen behind just because I have been so busy. The short of it is that I founded a company called JITX when I graduated, where we are writing a programming language for designing electronics, and Stanza is our main development language. So development on Stanza is proceeding along because of that. The experimental branch has a REPL now (quite a fancy one too, that I need to write about) and a very convenient built-in build system and test framework.

The main features slated for development are an LLVM backend for Stanza, and Language Server Protocol support. We're very excited for both of them. The LLVM port should allow Stanza to run on just about every platform under the sun, and the LSP support will allow Stanza to be nicely integrated into most of the major IDEs.

This forum is still the best place for discussions/questions.

Cheers, Patrick


2020 Status

p.z.trotter@...
 

Hi, all.

I am thoroughly enjoying going through L.B.Stanza's codebase and interested in contributing.

There appears to be semi-regualr activity in the git repo but fewer regular announcements here and the website news section is now a few years old.

What is the best place to learn what is happening/status/roadmap? orr just to ask questions? (e.g. REPL status for example)
or to discuss areas to contribute/contribute - beyond current github issues?

thanks much.

p.

 

 

1 - 20 of 245