-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
topic: dynamic thumbnail gallery layout #7
Comments
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? |
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. |
@ashleydavis I've assigned this one to you - can you please create a subdirectory under the project root called |
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. |
@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: |
@ashleydavis Does the workaround Anton posted in that issue get it running? (That is, adding |
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 |
I tried setting $ 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> |
I suspect installing Ubuntu 22.04 (still under WSL) will be the easiest fix. The installation through the microsoft store works great. |
@ashleydavis Was the |
I'm running under Ubuntu WSL2 under Windows. |
I've tried running it on my quite old MacBook Air. But it seems like I'm missing something:
|
I think |
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 Bear in mind that my Mac is quite old now and possibly @rtfeldman you don't want to support it anymore. |
Can you try running:
|
@Anton-4 I did that. I still get an error, but it looks a bit different now: % roc build main.roc |
Brian Carroll has experienced this issue before, I've now asked if he was able to solve it. |
Brian just confirmed he was not able to solve the issue on MacOS. |
@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!" |
Thanks for sticking with us @ashleydavis :)
|
I have a photo gallery layout algorithm that I'd like to port from TypeScript to Roc.
It is capable of doing incremental layout (as new assets are downloaded in the background) which allows it to do the layout for 100k images without the user even noticing.
Live demo with 100k assets: https://photosphere-100k.codecapers.com.au
The TypeScript type signature looks like this:
It will be interesting to benchmark the TypeScript code against the Roc code.
It would be nice to do the entire gallery frontend in Roc, but for the book it is possible to demonstrate the layout algorithm in code that is runnable from the CLI.
Here are some other ideas related to this that might also be worth considering:
The text was updated successfully, but these errors were encountered: