Comments (20)
This is cool, but is it one chapter or two? I.e., is the actual positioning of visible assets simple enough that the focus would be on the paging/download/etc.? The JS and Py versions each devote a chapter to row-and-column box layout, but maybe the layout itself here is simpler?
from book-of-examples.
Just one chapter and I'll only do one chapter myself. The related items could be for other chapters.
I just wanted to get a few ideas down just in case the first one wasn't enough.
from book-of-examples.
@ashleydavis I've assigned this one to you - can you please create a subdirectory under the project root called gallery
and put your work there as a standalone Roc project for now? Cheers - Greg
from book-of-examples.
Will do, first thing for me is to figure out how to get Roc to work. It doesn't work under Windows yet and it seems to hang on Ubuntu under WSL2.
from book-of-examples.
@rtfeldman @gvwilson I'm keen to get started but Roc doesn't run on Windows and there's a problem running it under WSL2.
I found an issue already logged and added my details to it:
roc-lang/roc#5887
from book-of-examples.
@ashleydavis Does the workaround Anton posted in that issue get it running? (That is, adding --linker=legacy
to roc dev
)
from book-of-examples.
Thanks @rtfeldman, but doesn't seem to have helped.
Getting this error now:
$ roc build --linker legacy main.roc
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` failing to spawn.', crates/compiler/build/src/program.rs:1053:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I get a similar error for roc dev --linker legacy
.
from book-of-examples.
I tried setting RUST_BACKTRACE=full
for extra details, but not sure it helps:
$ roc build --linker legacy main.roc
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` failing to spawn.', crates/compiler/build/src/program.rs:1053:30
stack backtrace:
0: 0x562da85053b6 - <unknown>
1: 0x562da784e2cf - <unknown>
2: 0x562da8500b77 - <unknown>
3: 0x562da85051c5 - <unknown>
4: 0x562da8506963 - <unknown>
5: 0x562da8506724 - <unknown>
6: 0x562da8506e66 - <unknown>
7: 0x562da8506d44 - <unknown>
8: 0x562da85057b6 - <unknown>
9: 0x562da8506af2 - <unknown>
10: 0x562da774ae03 - <unknown>
11: 0x562da7a52f9e - <unknown>
12: 0x562da7a501dc - <unknown>
13: 0x562da7b40b97 - <unknown>
14: 0x562da7a1d0bb - <unknown>
15: 0x562da7a12cf3 - <unknown>
16: 0x562da7a12d13 - <unknown>
17: 0x562da84f7f25 - <unknown>
18: 0x562da7a1f7d5 - <unknown>
19: 0x7f52ba741083 - __libc_start_main
20: 0x562da77e21fe - <unknown>
21: 0x0 - <unknown>
from book-of-examples.
I suspect installing Ubuntu 22.04 (still under WSL) will be the easiest fix. The installation through the microsoft store works great.
from book-of-examples.
@ashleydavis Was the gracefully handle 'ld' failing to spawn
error on normal Windows or WSL? That would be a strange error to see on Windows, because the legacy linker shouldn't be trying to spawn ld
on Windows! 🤔
from book-of-examples.
I'm running under Ubuntu WSL2 under Windows.
from book-of-examples.
I've tried running it on my quite old MacBook Air.
But it seems like I'm missing something:
% roc dev
dyld[49262]: Library not loaded: '/usr/local/opt/z3/lib/libz3.4.12.dylib'
Referenced from: '/Users/ashleydavis/Roc/roc_nightly-macos_x86_64-2024-03-18-14ba398/roc'
Reason: tried: '/usr/local/opt/z3/lib/libz3.4.12.dylib' (no such file), '/usr/local/lib/libz3.4.12.dylib' (no such file), '/usr/lib/libz3.4.12.dylib' (no such file)
zsh: abort roc dev
from book-of-examples.
I think brew install z3 zstd
should fix that (macos x64 getting started).
from book-of-examples.
Thanks @Anton-4 I did that and got a bit further.
But I seem to be getting the same kind of error now on my Mac as on Ubuntu (under WSL2 / Windows).
% roc build main.roc
ld: library not found for -lSystem
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` (or `zig` in the case of wasm with --optimize) returning exit code Some(1)', crates/compiler/build/src/program.rs:1064:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I also tried running roc dev
and roc build --linker legacy main.roc
.
Bear in mind that my Mac is quite old now and possibly @rtfeldman you don't want to support it anymore.
from book-of-examples.
Can you try running:
$ export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
$ export LIBRARY_PATH="$LIBRARY_PATH:$SDKROOT/usr/lib"
$ roc build main.roc
from book-of-examples.
@Anton-4 I did that. I still get an error, but it looks a bit different now:
% roc build main.roc
ld: library not found for -lSystem
thread 'main' panicked at 'not yet implemented: gracefully handle ld
(or zig
in the case of wasm with --optimize) returning exit code Some(1)', crates/compiler/build/src/program.rs:1064:17
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
from book-of-examples.
Brian Carroll has experienced this issue before, I've now asked if he was able to solve it.
Is using Ubuntu 22.04 on WSL not an (attractive) option for you?
from book-of-examples.
Brian just confirmed he was not able to solve the issue on MacOS.
from book-of-examples.
@Anton-4 Success! (at least with the legacy linker)
I can move forward now, so thanks @Anton-4 and @rtfeldman for your help.
I'll document here what works and what doesn't work.
I've upgraded to Ubuntu 22.04 under WSL2:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
This works for me now:
roc build --linker legacy main.roc
Also this:
roc dev --linker legacy
Running the code produced by the legacy link works as expected.
Building normally is ok:
$ roc build main.roc
0 errors and 0 warnings found in 10334 ms
while successfully building:
main
But running the output of the normal build produces a seg fault:
$ ./main
Segmentation fault
Roc dev by itself hangs indefinitely:
$ roc dev
This is the code I'm running:
$ cat main.roc
app "hello"
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.8.1/x8URkvfyi9I0QhmVG98roKBUs_AZRkLFwFJVJ3942YA.tar.br" }
imports [pf.Stdout]
provides [main] to pf
main =
Stdout.line "I'm a Roc application!"
from book-of-examples.
Thanks for sticking with us @ashleydavis :)
I was unable to reproduce the hanging or the segmentation fault on WSL2, Ubuntu 22.04.4 LTS on Windows 11.
Can you share the output of:
roc version
uname -a
lscpu
from book-of-examples.
Related Issues (20)
- infrastructure proposal: create a blog for this book HOT 4
- topic proposal: discrete event simulator HOT 5
- topic: continuous integration HOT 2
- topic proposal: machine learning from first principles HOT 2
- topic proposal: property-based testing framework HOT 3
- topic proposal: a parser with useful error messages
- topic proposal: pseudorandom number generators HOT 1
- topic: regex pattern matching HOT 1
- topic proposal: Redis-like key value store with write-ahead log HOT 7
- topic: JSON ADT and codecs HOT 5
- topic proposal: Parser combinator library HOT 5
- proposal: Prohibit external packages HOT 9
- topic: compression
- proposal: use Jekyll/GitHub Pages _temporarily_ to build a website for this material HOT 2
- Topic proposal: A transpiler to JavaScript HOT 3
- meeting 2024-04-10 HOT 1
- discuss: how to manage inter-chapter dependencies? HOT 1
- topic: package manager
- topic: pretty-printing library HOT 2
- add link to rendered site
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from book-of-examples.