SPWN-language icon indicating copy to clipboard operation
SPWN-language copied to clipboard

[Help wanted] Where do I put the libraries folder?

Open realhackcraft opened this issue 2 years ago • 18 comments

I have to manually install SPWN. I finished all the steps except the last one(to Copy the libraries folder to $HOME/.cargo/bin/spwn). .cargo/bin/spwn is not a directory but a UNIX executable. I currently have the library folder in .cargo/bin.

realhackcraft avatar Sep 21 '22 22:09 realhackcraft

The easiest way, is to copy the libraries folder into your current working directory, but this may be annoying if you have multiple folders where you develop spwn files.

Btw, the best way to run SPWN manually is to run cargo run --release test/your_file.spwn onto a clone of the repository, so you're 100% sure it will be the latest version, because if you did cargo install spwn then you are back by 3 versions iirc

SpeckyYT avatar Sep 22 '22 05:09 SpeckyYT

When I run this, I get

Error: Syntax error ╭─[src/test.spwn:1:1] │ 1 │ $.print("Hello SPWN!") · ───────────┬──────────
· ╰──────────── 1: Error when running this library/module │ ├─[/Users/Hackcraft_/IdeaProjects/Spwn/libraries/std/lib.spwn:2:17] │ 2 │ let constants = import "constants.spwn" · ───────────┬───────────
· ╰───────────── 2: Error when parsing this library/module │ ├─[/Users/Hackcraft_/IdeaProjects/Spwn/libraries/std/constants.spwn:4:1] │ 4 │ type @comparison · ──┬─
· ╰─── 3: Expected a value, found keyword: "type" ───╯

realhackcraft avatar Sep 22 '22 19:09 realhackcraft

What version of spwn do you have and what version of the std libraries do you have?

SpeckyYT avatar Sep 23 '22 06:09 SpeckyYT

If the std libraries are giving you too many issues, you can add #[no_std] to your spwn file and it won't load the std library.

SpeckyYT avatar Sep 23 '22 06:09 SpeckyYT

I use 0.8 beta and the library included. I followed the instructions in README.md to install.

realhackcraft avatar Sep 23 '22 12:09 realhackcraft

cargo run --release test/your_file.spwn

If I do this, will it install spwn or run the spwn command because I want to install spwn and use the shorthand.

realhackcraft avatar Sep 23 '22 12:09 realhackcraft

if you want to use the shorthand try looking at the generic linux install

zTags avatar Sep 23 '22 13:09 zTags

aren't the std libs supposed to add more features?

realhackcraft avatar Sep 23 '22 19:09 realhackcraft

When I run this, I get

Error: Syntax error ╭─[src/test.spwn:1:1] │ 1 │ $.print("Hello SPWN!") · ───────────┬────────── · ╰──────────── 1: Error when running this library/module │ ├─[/Users/Hackcraft_/IdeaProjects/Spwn/libraries/std/lib.spwn:2:17] │ 2 │ let constants = import "constants.spwn" · ───────────┬─────────── · ╰───────────── 2: Error when parsing this library/module │ ├─[/Users/Hackcraft_/IdeaProjects/Spwn/libraries/std/constants.spwn:4:1] │ 4 │ type @comparison · ──┬─ · ╰─── 3: Expected a value, found keyword: "type" ───╯

realhackcraft avatar Sep 23 '22 19:09 realhackcraft

aren't the std libs supposed to add more features?

basically yes, everything what is in the std can easily be reproduced and all of them are just to provide some easier abstractions of quite complex systems, just like @counter

SpeckyYT avatar Sep 23 '22 19:09 SpeckyYT

When I run this, I get

Error: Syntax error ╭─[src/test.spwn:1:1] │ 1 │ $.print("Hello SPWN!") · ───────────┬────────── · ╰──────────── 1: Error when running this library/module │ ├─[/Users/Hackcraft_/IdeaProjects/Spwn/libraries/std/lib.spwn:2:17] │ 2 │ let constants = import "constants.spwn" · ───────────┬─────────── · ╰───────────── 2: Error when parsing this library/module │ ├─[/Users/Hackcraft_/IdeaProjects/Spwn/libraries/std/constants.spwn:4:1] │ 4 │ type @comparison · ──┬─ · ╰─── 3: Expected a value, found keyword: "type" ───╯

that means that the std version and your spwn version don't match.

SpeckyYT avatar Sep 23 '22 19:09 SpeckyYT

Ok. so how do I install spwn v0.8 on my mac?

realhackcraft avatar Sep 23 '22 19:09 realhackcraft

because the instructions said to use a .pkg but there is not .pkg in release

realhackcraft avatar Sep 23 '22 19:09 realhackcraft

Compile from source, and then add the compiled file to the environment variables.

SpeckyYT avatar Sep 23 '22 19:09 SpeckyYT

Where does the executable end up in? Which folder?

realhackcraft avatar Sep 24 '22 16:09 realhackcraft

/target/(release / debug)/spwn

SpeckyYT avatar Sep 24 '22 16:09 SpeckyYT

well i only have target/debug. how do I get release?

realhackcraft avatar Sep 25 '22 13:09 realhackcraft

I did cargo build -r and now I have the release folder, but it doesn't contain the spwn executable

realhackcraft avatar Sep 25 '22 14:09 realhackcraft