Stream: contributing

Topic: Pull Request for Review


view this post on Zulip Luke Boswell (Oct 25 2022 at 06:10):

Can someone kick of CI for #4387?

I think it needed roc format to be ran on the file, although I can't see any differences in the diff.

view this post on Zulip Brian Carroll (Oct 25 2022 at 06:13):

Running now

view this post on Zulip Luke Boswell (Oct 25 2022 at 07:03):

Should be good for a review and merge; passed CI.

view this post on Zulip Luke Boswell (Oct 25 2022 at 07:24):

Also can someone please kick off CI for the docs for Box.roc and Dict.roc 4392? Thank you

view this post on Zulip Anton (Oct 25 2022 at 07:28):

I'll do a review first, that might save us some CI time :)

view this post on Zulip Luke Boswell (Oct 26 2022 at 19:10):

Can someone please look at these PRs? Please let me know if they need anything before we can merge them. :smiley:

view this post on Zulip Brendan Hansknecht (Oct 26 2022 at 19:16):

general question, do expects in comments run with roc test? If not, I think we should either fix that or not have expects in comments. That is just asking for them to get out of date with real implementation and expects in the file.

view this post on Zulip Richard Feldman (Oct 26 2022 at 21:01):

yeah I agree

view this post on Zulip Richard Feldman (Oct 26 2022 at 21:02):

I'd rather use expect outside the docs, and then have the docs focus on looking as nice as possible

view this post on Zulip Luke Boswell (Oct 26 2022 at 21:24):

To confirm, you would like me to remove all the expects from the docs PRs here? This is an example of how it looks, I added it because I thought it helps to convey what the example means. Happy to remove and redo examples here and update PR.

Screen-Shot-2022-10-27-at-08.21.24.png

view this post on Zulip Brendan Hansknecht (Oct 26 2022 at 21:54):

I agree that it looks great. I think that we either should make roc test test doc comments, or we should we should add some expects right after the function and have docs generation grab them by default and add them.

view this post on Zulip Brendan Hansknecht (Oct 26 2022 at 21:55):

I just think that they likely to become stale if they are docs alone.

view this post on Zulip Luke Boswell (Oct 26 2022 at 22:17):

Maybe there is a bigger story here. Should expects at document level be thought of as unit tests? Would it be helpful to have roc docs pull these in and show them separately? Instead of having code in comments, which mixes concerns, have a more natural way to capture intent. Can we have the expects have doc comments themselves? Then they get displayed in the docs, and we could refrrence them somehow in the doc comments for the function? This would also make it much nicer to have one test that shows multiple concepts. To reference an expectation in doc comments maybe you can use # title or some kind of convention. I have been thinking about a similar need for doc comments to have headings and this would solve both of those use cases. I think a great doc experience is looking more like a document with really contextual code examples and interactive experiences.

view this post on Zulip Brendan Hansknecht (Oct 26 2022 at 22:19):

Totally. I do think it is a bigger story. Where it lands, idk. Where it currently is definitely has problems.

view this post on Zulip Joshua Warner (Oct 31 2022 at 20:53):

Curious why I'm still seeing this when submitting a PR (https://github.com/roc-lang/roc/pull/4443)?

 7 workflows awaiting approval
First-time contributors need a maintainer to approve running workflows. Learn more.

I have a "contributor" badge on that PR, and the last step that I _thought_ might be the case, was having a signed commit in the repo which I do as of my last PR.

It seems the detection system for "First time contributors" is a little wonky...

view this post on Zulip Richard Feldman (Oct 31 2022 at 23:53):

Joshua Warner said:

I have a "contributor" badge on that PR, and the last step that I _thought_ might be the case, was having a signed commit in the repo which I do as of my last PR.

It seems the detection system for "First time contributors" is a little wonky...

wow, I have no idea what's up with that...you now have write access to the repo, so lmk if it happens again!

view this post on Zulip Brian Carroll (Nov 01 2022 at 00:03):

Has anyone else had the same issue?

view this post on Zulip Anton (Nov 01 2022 at 08:02):

The message is wrong, this has nothing to do with being a first-time contributor. Only when you are explicitly granted write permission will you be able to start CI.

view this post on Zulip Chris Duncan (Nov 03 2022 at 13:47):

Here's a short PR to review.
https://github.com/roc-lang/roc/pull/4307

view this post on Zulip Luke Boswell (Nov 03 2022 at 19:28):

And another round of Rust Docs should be good for review #4462 :smiley:

view this post on Zulip Joshua Warner (Nov 04 2022 at 13:53):

Fixing a broken test I accidentally added: #4469. Whoops!

view this post on Zulip Anton (Nov 04 2022 at 13:55):

Thanks @Joshua Warner, I reviewed and merged it :)

view this post on Zulip Joshua Warner (Nov 04 2022 at 22:32):

Fixing test_mono again, after what I suspect is a race between two PRs: https://github.com/roc-lang/roc/pull/4471

view this post on Zulip Chris Duncan (Nov 05 2022 at 10:24):

@Richard Feldman
Got the table parser working without using HTML
https://github.com/roc-lang/roc/pull/4382

view this post on Zulip Joshua Warner (Nov 05 2022 at 19:29):

Some more parser refactoring and small bugfix, ready for review: https://github.com/roc-lang/roc/pull/4470

view this post on Zulip Luke Boswell (Nov 06 2022 at 19:57):

Rust docs PR 4462 is ready for review. Request further assistance adding more documentation here; so if you see something you would like added happy to take a message in chat or comment and I will update the docs. :smiley:

view this post on Zulip Anton (Nov 07 2022 at 08:37):

Luke's PR failed on apple silicon but there were no code changes:

---- cli_run::test_benchmarks::astar stdout ----
thread 'cli_run::test_benchmarks::astar' panicked at '`roc` command had unexpected stderr: An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: https://github.com/roc-lang/roc/issues/new/choose
thread 'main' panicked at 'failed to truncate shared file, are the permissions wrong?', crates/repl_expect/src/run.rs:64:17
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: roc_repl_expect::run::ExpectMemory::mmap_help
   3: roc_cli::roc_dev_native
   4: roc_cli::roc_run
   5: roc_cli::build
   6: roc::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
', crates/cli/tests/cli_run.rs:129:13
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: cli_run::cli_run::check_output_with_stdin
   3: cli_run::cli_run::test_benchmarks::test_benchmark
   4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- cli_run::test_benchmarks::base64 stdout ----
thread 'cli_run::test_benchmarks::base64' panicked at '`roc` command had unexpected stderr: An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: https://github.com/roc-lang/roc/issues/new/choose
thread 'main' panicked at 'failed to truncate shared file, are the permissions wrong?', crates/repl_expect/src/run.rs:64:17
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: roc_repl_expect::run::ExpectMemory::mmap_help
   3: roc_cli::roc_dev_native
   4: roc_cli::roc_run
   5: roc_cli::build
   6: roc::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
', crates/cli/tests/cli_run.rs:129:13
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: cli_run::cli_run::check_output_with_stdin
   3: cli_run::cli_run::test_benchmarks::test_benchmark
   4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    cli_run::test_benchmarks::astar
    cli_run::test_benchmarks::base64

test result: FAILED. 38 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 232.76s

view this post on Zulip Folkert de Vries (Nov 07 2022 at 09:20):

didn't this happen before when the disk was full?

view this post on Zulip Anton (Nov 07 2022 at 09:24):

That might be it, I'll check it out...

view this post on Zulip Anton (Nov 07 2022 at 09:31):

I have 46 GB available, I do expect that to be enough.

view this post on Zulip Folkert de Vries (Nov 07 2022 at 09:43):

hmm, are they somehow fighting over the same file?

view this post on Zulip Folkert de Vries (Nov 07 2022 at 09:45):

I bet the issue is in here somewhere https://github.com/roc-lang/roc/pull/4220

view this post on Zulip Folkert de Vries (Nov 07 2022 at 09:46):

@Ayaz Hafiz found that you cannot truncate the same file twice on mac

view this post on Zulip Folkert de Vries (Nov 07 2022 at 09:46):

so I guess that is what is happening? but then why did CI not catch that on that PR?

view this post on Zulip Anton (Nov 07 2022 at 10:59):

Could it be dependent on which cli_run tests run in parallel?

view this post on Zulip Folkert de Vries (Nov 07 2022 at 11:02):

in theory, yes

view this post on Zulip Folkert de Vries (Nov 07 2022 at 11:03):

though, do we run cli tests in roc dev mode now?

view this post on Zulip Anton (Nov 07 2022 at 11:07):

No, it does not look like it

view this post on Zulip Folkert de Vries (Nov 07 2022 at 11:19):

so how does it end up in replexpect territory?

view this post on Zulip Anton (Nov 07 2022 at 12:05):

I'll check that out, does that mean it is trying to use the unfinished macos surgical linker?

view this post on Zulip Folkert de Vries (Nov 07 2022 at 12:09):

no, this is not a linker thing

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 14:37):

those tests do run “roc foo.roc” which is dev mode right?

view this post on Zulip Anton (Nov 07 2022 at 14:39):

Has that been recently changed to dev mode by default?

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 14:40):

I believe so. Away from my computer right now though so might be wrong

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 14:41):

but macOS libc behavior is sometimes suprinsingly subtle so definitely could be the problem

view this post on Zulip Anton (Nov 07 2022 at 14:49):

Yes, dev is the default:

let opt_level = if let BuildConfig::BuildAndRunIfNoErrors = config {
        OptLevel::Development
    }
matches.subcommand() {
        None => {
            if matches.is_present(ROC_FILE) {
                build(
                    &matches,
                    BuildConfig::BuildAndRunIfNoErrors,
                    Triple::host(),
                    LinkType::Executable,
                )
            }

view this post on Zulip Folkert de Vries (Nov 07 2022 at 14:52):

can you look at what the value of the CString actually is in this case

    fn mmap_help(cstring: std::ffi::CString, shm_flags: i32) -> Self {
        let ptr = unsafe {
            let shared_fd = libc::shm_open(cstring.as_ptr().cast(), shm_flags, 0o666);
            if shared_fd == -1 {
                internal_error!("failed to shm_open fd");
            }

            // NOTE: we can only call `ftruncate` once on this file descriptor on mac
            if libc::ftruncate(shared_fd, Self::SHM_SIZE as _) == -1 {
                internal_error!("failed to truncate shared file, are the permissions wrong?");
            }

I suspect the same name is used multiple times

view this post on Zulip Folkert de Vries (Nov 07 2022 at 14:52):

so maybe we need to explicitly close the file descriptor?

view this post on Zulip Anton (Nov 07 2022 at 16:45):

I've checked it on the CI machine when the error occurs and the printed cstrings do not have any duplicates.

view this post on Zulip Folkert de Vries (Nov 07 2022 at 16:50):

hmm, maybe printing https://doc.rust-lang.org/std/io/struct.Error.html#method.last_os_error in the branch that panics?

view this post on Zulip Folkert de Vries (Nov 07 2022 at 16:50):

may tell us a bit more

view this post on Zulip Anton (Nov 07 2022 at 17:31):

The last os error is always:

code: 35
kind: WouldBlock
message:"Resource temporarily unavailable"

This also shows up when doing successful cli_run tests but then again this error may stem from a previous run that did fail or be from something else entirely...

view this post on Zulip Folkert de Vries (Nov 07 2022 at 17:50):

yeah based on https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/ftruncate.2.html ftruncate does not cause that

view this post on Zulip Anton (Nov 07 2022 at 18:35):

I'm going to do a bisect

view this post on Zulip Anton (Nov 07 2022 at 19:33):

The first bad commit is Resolve ability specializations looked up in expects.

view this post on Zulip Folkert de Vries (Nov 07 2022 at 19:38):

is it really? I'd guess it just straight up didn't work before that commit

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 22:20):

It's probably actually https://github.com/roc-lang/roc/pull/4220/commits/c5cdab1ff9bd7305d4a0d4a2569224ad302e9733

view this post on Zulip Folkert de Vries (Nov 07 2022 at 22:54):

yes but why?

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 23:14):

why was this done? https://github.com/roc-lang/roc/pull/4220/commits/84178c66e1a026cb431193935f66877e8e90226e

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 23:16):

That might be the problem, because if we reuse the file descriptor that will truncate again

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 23:17):

Right, that is the problem, because we call mmap_help before and after the fork

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 23:19):

nvm that is wrong, I was looking at a code path not reachable today (expect-fx)

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 23:20):

In any case, if we end up reusing the shm path that will cause a problem. I still think that commit should be reverted

view this post on Zulip Folkert de Vries (Nov 07 2022 at 23:22):

the path that we open includes the process id

view this post on Zulip Folkert de Vries (Nov 07 2022 at 23:22):

of the parent, but that should just be unique

view this post on Zulip Folkert de Vries (Nov 07 2022 at 23:22):

unless it isn't I guess, then I'd prefer that we shm_unlink at the end

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 23:26):

does the zig side resize it?

view this post on Zulip Folkert de Vries (Nov 07 2022 at 23:29):

no, this is the code (expect.zig)

        const shared_fd = roc_shm_open(@ptrCast(*const i8, &name), O_RDWR | O_CREAT, 0o666);

        const length = 4096;

        const shared_ptr = roc_mmap(
            null,
            length,
            PROT_WRITE,
            MAP_SHARED,
            shared_fd,
            0,
        );

        const ptr = @ptrCast([*]u8, shared_ptr);

        return ptr;

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 23:30):

hmm. maybe CI does recycle pids?

view this post on Zulip Folkert de Vries (Nov 07 2022 at 23:30):

then Anton should have observed repeated CStrings, which did not happen

view this post on Zulip Ayaz Hafiz (Nov 07 2022 at 23:35):

I missed that message, my bad

view this post on Zulip Anton (Nov 08 2022 at 09:15):

Folkert de Vries said:

is it really? I'd guess it just straight up didn't work before that commit

While that was the outcome of the bisect, the truncate error does indeed occur in commits before that.
I was basing myself on nightly apple silicon tests to see how many days I should go back but that recently merged PR has some old commits in it which is why my approach was wrong. This event does make me doubt our merge strategy.
Anyway I'll get onto finding the right commit after walking my dog :)

view this post on Zulip Anton (Nov 08 2022 at 11:08):

Now thoroughly checked; move around some libc code is the first bad commit.

view this post on Zulip Folkert de Vries (Nov 08 2022 at 11:11):

that's weird. That means a file descriptor is re-used. Maybe it is between runs somehow

view this post on Zulip Folkert de Vries (Nov 08 2022 at 11:11):

well we can revert that commit (in spirit, that memset at the bottom should stay)

view this post on Zulip Anton (Nov 08 2022 at 12:10):

Fix confirmed, thanks @Folkert de Vries :) I'll set up a PR.

view this post on Zulip Joshua Warner (Nov 28 2022 at 15:54):

I have a few PRs that are ready for review / merging:

view this post on Zulip Joshua Warner (Dec 10 2022 at 19:08):

I have a pretty large PR that's more or less ready, here: https://github.com/roc-lang/roc/pull/4716
That fixes up the parser fuzzer and fixes a bunch of bugs that fell out.

If someone's up for reviewing as is, great. Otherwise I'm happy to break it into a few smaller PRs for the individual bug fixes.

One of the changes that I'm kinda conflicted about is removing the SSE optimizations for quickly skipping past spaces/comments. I have some local changes to do some re-optimization of those routines - for now in a platform-neutral way that doesn't actually require SIMD at all!

On my M1 mac, the new version is ~25% faster at parsing Num.roc than the current (main) code is - but that's not apples-to-apples, since nobody wrote NEON optimizations for arm.

view this post on Zulip Joshua Warner (Dec 10 2022 at 19:08):

Actually...

view this post on Zulip Joshua Warner (Dec 10 2022 at 19:08):

Huh

view this post on Zulip Joshua Warner (Dec 10 2022 at 19:09):

Running the new optimizationed version on my x86_64 linux box also shows it being a net win relative to the SIMD version, which doesn't make a whole lot of sense.

view this post on Zulip Joshua Warner (Dec 10 2022 at 19:11):

New plan: going to clean up my parser benchmarking fixes, put a PR out for that, and then maybe a few folks can try to repro my numbers.

view this post on Zulip Joshua Warner (Dec 10 2022 at 19:12):

The new code is in this branch: https://github.com/roc-lang/roc/tree/faster-spaces-experiment

view this post on Zulip Joshua Warner (Dec 10 2022 at 19:15):

Benchmark fix here: https://github.com/roc-lang/roc/pull/4730

view this post on Zulip Joshua Warner (Dec 10 2022 at 19:16):

Going to fold in the faster spaces improvements into the fuzzing PR, so (I think?) we won't have a net perf regression

view this post on Zulip Folkert de Vries (Dec 11 2022 at 12:33):

so, what should we run to benchmark?

view this post on Zulip Joshua Warner (Dec 11 2022 at 16:46):

Check out the current main, then cd crates/compiler/parse/, then run the benchmarks:

env RUSTFLAGS='-C target-cpu=native' cargo bench --bench bench_parse -- --save-baseline main

After that, check out my PR with: git fetch origin pull/4716/head:josh-swar-update; git checkout josh-swar-update, and run the benchmarks again with:

env RUSTFLAGS='-C target-cpu=native' cargo bench --bench bench_parse -- --baseline main

view this post on Zulip Joshua Warner (Dec 18 2022 at 15:42):

Fuzzing the formatter is (finally) ready for review again: https://github.com/roc-lang/roc/pull/4758

view this post on Zulip Joshua Warner (Jan 12 2023 at 05:05):

Looking for quick review here: https://github.com/roc-lang/roc/pull/4820
(This was previously approved, but it turns out I had forgotten to sign the commit)

view this post on Zulip Luke Boswell (Feb 26 2023 at 01:10):

Request someone review and kickoff CI for PR5052. It should be minor as it is only markdown updates for the tutorial. Thanks :smiley:

view this post on Zulip Luke Boswell (Feb 28 2023 at 06:17):

Can someone kick-off CI for #5051? I just squished the commit that wasn't signed, and merged latest main.

view this post on Zulip Luke Boswell (Feb 28 2023 at 10:08):

I've drafted #5077 [WIP] to add support for escapes in the JSON decoder. I've got a few questions and would appreciate some guidance or assistance.

Additional Q: does my Roc test even cover escapes correctly? It's a bit murky with all the conversions between utf8, looking for ideas to do this better.

view this post on Zulip Brendan Hansknecht (Mar 01 2023 at 23:40):

#5076 is ready for review and a pretty small PR. It just causes a ton of mono tests to be updated. Fundamentally, the real changes are just in List.roc.

view this post on Zulip Luke Boswell (Mar 05 2023 at 06:08):

#5077 is ready for review. I've added a few more tests and fixed some decoding bugs/todos for JSON. This implementation is less strict with whitespace than the spec I'm referencing describes, but this feels more reliable than crashing. We could add more Error tags to handle these cases instead, but feels ok to just continue and parse the input.

view this post on Zulip Luke Boswell (Mar 05 2023 at 07:31):

@Ayaz Hafiz why do the tests fail for ^^^? Are the internal tests for Abilities hardcoded somehow?

view this post on Zulip Brendan Hansknecht (Mar 05 2023 at 07:34):

The failing tests are for mono, that is expected. Whenever builtins change, mono changes.

view this post on Zulip Brendan Hansknecht (Mar 05 2023 at 07:34):

Just run the mono tests in release build and then add the updated files

view this post on Zulip Ayaz Hafiz (Mar 05 2023 at 14:17):

btw you don’t need to run them in release mode anymore

view this post on Zulip Brendan Hansknecht (Mar 05 2023 at 16:26):

It looks like the new json encoder hits an issue with the surgical linker. So it is breaking the ruby interop test

view this post on Zulip Brendan Hansknecht (Mar 05 2023 at 16:27):

Probably can set the test to use the legacy linker only and file a bug for this.

view this post on Zulip Brendan Hansknecht (Mar 05 2023 at 16:28):

Oh, actaully, I think it is a simple bug

view this post on Zulip Brendan Hansknecht (Mar 05 2023 at 16:29):

Just need to add roc_memmov to the platform for ruby interop.

view this post on Zulip Agus Zubiaga (Mar 08 2023 at 13:30):

Found a discrepancy in the docs for List.splitFirst and List.splitLast: https://github.com/roc-lang/roc/pull/5108

view this post on Zulip Luke Boswell (Mar 21 2023 at 18:08):

I have a PR for Json which is ready for review 5163. Somehow CI was cancelled at the final hour, Im not sure how, maybe it timed out?

view this post on Zulip Ayaz Hafiz (Mar 21 2023 at 18:15):

yeah looks like a timeout - they appear every so often. I've kicked it off again

view this post on Zulip Anton (Mar 21 2023 at 18:16):

Looks like cli_run::parse_letter_counts or cli_run::parse_movies_csv got stuck

view this post on Zulip Luke Boswell (Mar 26 2023 at 10:12):

Can someone please review 5163 for me?

This PR now includes the Number and String primitives, and List decoding that comply with RFC 8259. I'm hoping it passes all of CI on this run. A review and some feedback would be most appreciated before I commit too much further down this path.

I added a number of tests to catch different edge cases, and confirm decoders function correctly, including the composition of Lists with Numbers and Strings.

I added a number of TODO's to highlight out areas for future work. Some additional notes;

view this post on Zulip Agus Zubiaga (Mar 30 2023 at 22:53):

@Ayaz Hafiz suggested I make a custom result type so I can ship the Tcp module for basic-cli.

After some glue trickery, here it is: https://github.com/roc-lang/basic-cli/pull/29

view this post on Zulip Agus Zubiaga (Mar 30 2023 at 22:55):

Thanks @Ayaz Hafiz for all the help with glue :heart:

view this post on Zulip Richard Feldman (Apr 03 2023 at 18:50):

@Agus Zubiaga FYI https://github.com/roc-lang/roc/pull/5248 should fix glue generation for Result once it lands!

view this post on Zulip Agus Zubiaga (Apr 03 2023 at 19:15):

Ooh perfect!

view this post on Zulip Agus Zubiaga (Apr 03 2023 at 19:19):

I see the tests return Result from main but does this also fix returning RocResult from roc_fx functions in the platform?

view this post on Zulip Folkert de Vries (Apr 03 2023 at 20:32):

nothing changed there (in that PR, anyway).

view this post on Zulip Folkert de Vries (Apr 03 2023 at 20:32):

what is the problem there? if you want to send a Result a [] value from rust to roc, you can just pretend that it is an a value on the rust side

view this post on Zulip Agus Zubiaga (Apr 03 2023 at 20:35):

Right. However, last time I tried this, Roc would always think Oks were Errs.

view this post on Zulip Agus Zubiaga (Apr 03 2023 at 20:35):

I mean in cases where the error type variable is not []

view this post on Zulip Agus Zubiaga (Apr 03 2023 at 20:36):

https://roc.zulipchat.com/#narrow/stream/231634-beginners/topic/Sockets.20on.20basic-cli/near/339600427

view this post on Zulip Folkert de Vries (Apr 03 2023 at 20:41):

hmm, ok

view this post on Zulip Folkert de Vries (Apr 03 2023 at 20:41):

I'll have to test some more with that result type then

view this post on Zulip Brendan Hansknecht (Apr 03 2023 at 20:57):

iirc, the issue is that rust takes the two u8s and densely packs them into 1 u16.

view this post on Zulip Brendan Hansknecht (Apr 03 2023 at 20:58):

So we expect 2 registers to be used, but rust compresses even more and that breaks our generic roc result layout for anything smaller than a u16

view this post on Zulip Luke Boswell (Apr 09 2023 at 07:20):

Request a review for basic-cli#32 which adds a Time.now function which returns milliseconds since UNIX EPOCH using std::time::SystemTime.

view this post on Zulip Jonas Schell (Apr 09 2023 at 16:31):

I opened a small PR to make an example more clear: https://github.com/roc-lang/roc/pull/5267
This confused me a bit and I thought it might prevent more confusion in the future.

view this post on Zulip Luke Boswell (Apr 16 2023 at 04:51):

Looking for feedback on roc-lang/examples#14 which adds an example for Graph Traversal, specifically Breadth First Search, and Depth First Search using an adjacency list representation. Thank you

view this post on Zulip Luke Boswell (Apr 16 2023 at 04:55):

I uploaded a copy to github pages if anyone would like to see it rendered which might be easier. now outdated, see PR for latest version

view this post on Zulip Luke Boswell (Apr 16 2023 at 05:01):

I think I may have messed up the implementation of BFS by using a stack instead of a queue, but I'm not sure. All nits welcome.

view this post on Zulip Brendan Hansknecht (Apr 16 2023 at 05:05):

I think your "stack" in bfs is a queue. You always load the first element in the list and you always add the new elements to the end of the list. So FIFO instead of LIFO.

view this post on Zulip Brendan Hansknecht (Apr 16 2023 at 05:07):

In dfs it is a stack because you put the new elements at the beginning and load from the beginning. That said, it is also the slow version of a stack. You really want to use the other end of the list. Put the new elements at the end and load from the end.

view this post on Zulip Luke Boswell (Apr 16 2023 at 05:20):

Thanks brendan, I updated the PR.

view this post on Zulip Agus Zubiaga (Apr 29 2023 at 00:35):

Small docs issue: https://github.com/roc-lang/roc/pull/5342

view this post on Zulip Agus Zubiaga (May 14 2023 at 00:32):

Record Builder syntax: https://github.com/roc-lang/roc/pull/5389
Context: https://roc.zulipchat.com/#narrow/stream/316715-contributing/topic/Record.20Builder.20Syntax

view this post on Zulip Luke Boswell (May 15 2023 at 22:59):

Json updates https://github.com/roc-lang/roc/pull/5163 now passes CI :tada:

view this post on Zulip Luke Boswell (May 15 2023 at 23:53):

And a follow-up to bump the basic-cli version and improve Json for Examples https://github.com/roc-lang/examples/pull/28

view this post on Zulip Luke Boswell (May 16 2023 at 00:14):

I think that CI is held up because the latest roc nightly doesn't yet have the Json update in it. It will just need to be restarted sometime tomorrow. All tests pass locally for me.

view this post on Zulip Richard Feldman (May 16 2023 at 00:14):

nice! Do you have thoughts on pulling out Json into its own standalone package at this point?

view this post on Zulip Richard Feldman (May 16 2023 at 00:14):

instead of having it in builtins

view this post on Zulip Richard Feldman (May 16 2023 at 00:14):

e.g. github.com/roc-lang/json

view this post on Zulip Luke Boswell (May 16 2023 at 00:20):

That's the plan. I'm happy to build it into a package, I've basically already done that. I thought @Ayaz Hafiz had some things that needed to be updated internally so that it can be removed from builtins. It doesn't work well as a package right now as the name conflicts, so I usually rename it to Jason when I use it.

view this post on Zulip Ayaz Hafiz (May 16 2023 at 00:29):

Yeah we need to address https://github.com/roc-lang/roc/issues/5373 first

view this post on Zulip Richard Feldman (May 16 2023 at 00:54):

nice! @Luke Boswell do you think you'd be able to tackle that issue?

view this post on Zulip Agus Zubiaga (May 16 2023 at 02:01):

Prevents Record Builder fields from shadowing other symbols: https://github.com/roc-lang/roc/pull/5415

view this post on Zulip Agus Zubiaga (May 17 2023 at 17:32):

New Record Builder field syntax (context): https://github.com/roc-lang/roc/pull/5421

view this post on Zulip Luke Boswell (Jun 09 2023 at 04:44):

PR #5488 to remove Json from builtins has passed CI, request a review please :smile:

view this post on Zulip Luke Boswell (Jun 09 2023 at 04:45):

Scope of the change is just to change the name of Json builtin, but that touches a lot of tests and other files.

view this post on Zulip Richard Feldman (Jun 09 2023 at 04:47):

merged, thanks!

view this post on Zulip Luke Boswell (Jun 10 2023 at 02:32):

Added Task.batch in #45 with an example for CI to basic-cli and it should be ready for review.

view this post on Zulip Luke Boswell (Jun 10 2023 at 02:51):

Also updated #28 which adds modules to exports so that Docs gen works correctly for basic-cli. There appears to have been a flaky test in the past, but it seems to be working well now. I updated to include recently added modules.

view this post on Zulip Richard Feldman (Jun 10 2023 at 02:55):

oh wow, awesome - reviewed and approved!

Does this mean we can finally re-enable basic-cli docs generation and deployment as part of our roc-lang.org builds? :smiley:

view this post on Zulip Luke Boswell (Jun 10 2023 at 03:25):

I think so, but @Anton will be interested in this.

view this post on Zulip Luke Boswell (Jun 10 2023 at 06:05):

Ok, so I started adding some minor fixes, which snowballed into PR #46 for basic-cli. Visual fixes fro generated html docs across various modules, and starting content for Task module. Might stop here before this gets too big.

view this post on Zulip Anton (Jun 10 2023 at 08:01):

Amazing @Luke Boswell :)

view this post on Zulip Luke Boswell (Jun 10 2023 at 23:50):

I know I said I would stop here above, but I've got a few hours today so I might just keep going on basic-cli docs updates. I'll just keep working on the same PR.

view this post on Zulip Luke Boswell (Jun 11 2023 at 03:09):

I think I'm done with #46 for now. Completed multiple passes and cleaned a lot of things up. I might have a stab at fixing the types for docs gen over in roc-lang/roc so I will leave this for now. Ready for a review. Apologies for such a massive PR, it's just easier to do all these minor changes in one go.

view this post on Zulip Luke Boswell (Jun 11 2023 at 03:26):

Along with the above also some fixes for docs gen in PR #5537 ;

view this post on Zulip Luke Boswell (Jun 14 2023 at 08:37):

I've submitted a PR #48 which adds a Utc.sleepMillis effect for basic-cli. I probably should have raised this as an Idea first, but I needed it for another thing I'm working on and it was simple to implement.

view this post on Zulip Luke Boswell (Jun 14 2023 at 09:05):

And another PR #49 to add Stdin.byte for basic-cli to read a single byte at a time.

view this post on Zulip Norbert Hajagos (Jun 17 2023 at 16:11):

Hi! Here is my first PR #5549. Just a couple of docs example for the List builtin. Checked the generated html and it looked Ok.

view this post on Zulip Anton (Jun 17 2023 at 17:03):

Awesome @Norbert Hajagos, I'll take a look

view this post on Zulip Luke Boswell (Jun 18 2023 at 03:40):

PR #53 for basic-cli changes main to Task {} U32 is ready for review

view this post on Zulip Luke Boswell (Jun 20 2023 at 00:25):

PR #55 for basic-cli adds a new Command module which enables running commands like ls -al or FOO=BAR env -v using roc. Thank you

view this post on Zulip Luke Boswell (Jun 20 2023 at 23:18):

For ^^^ I'm not sure what the status of this is. I see @Ayaz Hafiz approved it but GH still has the PR as requiring an approving review. Can someone please have a quick look and see if there is anything outstanding?

view this post on Zulip Richard Feldman (Jun 20 2023 at 23:36):

I dunno, but merged!

view this post on Zulip Luke Boswell (Jun 24 2023 at 21:15):

Two PR's that are ready for review

view this post on Zulip Luke Boswell (Jun 24 2023 at 21:15):

@Folkert de Vries are you able to review these?

view this post on Zulip Folkert de Vries (Jun 24 2023 at 21:16):

I don't have commit rights for that repo. maybe @Brendan Hansknecht or @Ayaz Hafiz do?

view this post on Zulip Ayaz Hafiz (Jun 24 2023 at 21:47):

approved :approved:

view this post on Zulip Richard Feldman (Jun 24 2023 at 21:55):

Luke Boswell said:

Two PR's that are ready for review

oh, I missed this - actually part of the motivation of the change to have main return an exit code was to remove Process.exit :big_smile:

view this post on Zulip Luke Boswell (Jun 24 2023 at 21:58):

So you could just return Task.err -1 etc... I guess Process.exit -1 is clearer. Would you like me to remove it?

view this post on Zulip Richard Feldman (Jun 24 2023 at 21:59):

yeah let's remove it! :thumbs_up:

view this post on Zulip Luke Boswell (Jun 25 2023 at 00:36):

PR #68 to remove Process module from basic-cli

view this post on Zulip Anton (Jun 25 2023 at 09:00):

@Folkert de Vries you now have commit rights to basic-cli

view this post on Zulip Luke Boswell (Jul 26 2023 at 07:39):

#5694 is a draft PR that fixes (workarounds) for zig builtins tests on Windows. Request a review and some feedback.

view this post on Zulip Anton (Jul 26 2023 at 08:36):

Thanks @Luke Boswell :)
I'll take a look today

view this post on Zulip Anton (Jul 26 2023 at 08:55):

I can take a look at the test failures, but someone with actual zig experience should probably look at the zig code :p

view this post on Zulip Luke Boswell (Jul 26 2023 at 09:03):

Oh yeah, I haven't bothered with the test failures. It looks like clippy/fmt etc

view this post on Zulip Luke Boswell (Jul 31 2023 at 08:17):

#92 is a PR to rename the Command module to Cmd in basic-cli, and change the functionality of the Cmd.output.

view this post on Zulip Anton (Jul 31 2023 at 08:40):

I'll check it out :)

view this post on Zulip Luke Boswell (Aug 06 2023 at 03:36):

PR #97 add new features for basic-cli to the Directory module, essentially mkdir mkdir -p rmdir rm -rf.

view this post on Zulip Luke Boswell (Aug 13 2023 at 20:43):

Failures on #5741 seem unrelated to this change, is it worth re-running do you think?

view this post on Zulip Richard Feldman (Aug 13 2023 at 22:00):

re-ran :thumbs_up:

view this post on Zulip Luke Boswell (Sep 04 2023 at 08:11):

Is the failure on 5780 a flake?

view this post on Zulip Anton (Sep 04 2023 at 08:45):

I think so, re-running now

view this post on Zulip Anton (Sep 04 2023 at 09:28):

merged :)

view this post on Zulip Brian Carroll (Sep 16 2023 at 09:48):

#5802 makes some simple HTML & JS changes to the REPL page on the website. Just fixing a line-wrapping issue.

view this post on Zulip Brian Carroll (Sep 16 2023 at 10:09):

I'd appreciate a review because I am preparing slides for my talk about the web REPL and it would be nice to have screenshots that are not from localhost!

view this post on Zulip Folkert de Vries (Sep 16 2023 at 10:45):

done

view this post on Zulip Brian Carroll (Sep 16 2023 at 14:14):

Thanks Folkert!

view this post on Zulip Luke Boswell (Sep 27 2023 at 07:50):

CI failure on #5858 is a flake; worth re-running?

---- cli_run::hello_world_no_url stdout ----
thread 'cli_run::hello_world_no_url' panicked at '
error: test failed, to rerun pass `-p roc_cli --test cli_run`
___________
The roc command:

  "/home/small-ci-user/actions-runner/_work/roc/roc/target/release/roc --max-threads=1 /home/small-ci-user/actions-runner/_work/roc/roc/examples/helloWorldNoURL.roc --"

had unexpected stderr:

  🔨 Rebuilding platform...
thread 'main' panicked at 'range start index 109041880 out of range for slice of length 99054856', crates/linker/src/elf.rs:1268:18

view this post on Zulip Anton (Sep 27 2023 at 07:57):

Yeah re-running is fine, we don't want to get in the habit of skipping tests

view this post on Zulip Agus Zubiaga (Sep 30 2023 at 17:26):

Allow where to be used as an identifier: https://github.com/roc-lang/roc/pull/5869

view this post on Zulip Brian Carroll (Oct 01 2023 at 19:32):

Tiny fix for the web REPL JS. Not crucial, just makes the code clearer. https://github.com/roc-lang/roc/pull/5873

view this post on Zulip Elias Mulhall (Oct 07 2023 at 16:13):

Added List.chunksOf as a builtin https://github.com/roc-lang/roc/pull/5893

view this post on Zulip Anton (Oct 07 2023 at 16:15):

Thanks @Elias Mulhall :) I'll take a look

view this post on Zulip Luke Boswell (Oct 13 2023 at 07:06):

@Richard Feldman roc-lang/unicode #1 - added the basic infrastructure and cleaned up some things so it at least compile and tests pass. Added a basic example.

view this post on Zulip Isaac Van Doren (Oct 14 2023 at 20:03):

Hi folks, I opened a PR to add Str.contains https://github.com/roc-lang/roc/pull/5905

view this post on Zulip Luke Boswell (Oct 16 2023 at 08:29):

I have added #95 to roc-lang/examples which provides a demonstration and explanation for how to use the record builder pattern. @Agus Zubiaga could you please review this for me?

I have also pushed a copy of the page to here which includes syntax highlighting etc as I find that easier to read.

view this post on Zulip Luke Boswell (Oct 17 2023 at 07:09):

https://github.com/roc-lang/examples/pull/95 updated with @Agus Zubiaga feedback, and should be ready for approving. @Anton are you able to assist here?

view this post on Zulip Anton (Oct 17 2023 at 08:19):

Yes :) I'll look at it in a bit

view this post on Zulip Agus Zubiaga (Oct 17 2023 at 10:06):

@Luke Boswell I approved it!

view this post on Zulip Luke Boswell (Oct 17 2023 at 10:11):

Thank you Agus, I can see that. Unfortunately it looks like we still need someone else to approve it before we can merge :sad:

view this post on Zulip Anton (Oct 17 2023 at 11:50):

I'm making some edits now...

view this post on Zulip Luke Boswell (Oct 22 2023 at 03:20):

Add text segmentation for extended grapheme clusters - part 1 is ready at roc-lang/unicode #2

view this post on Zulip Luke Boswell (Oct 27 2023 at 09:28):

Added roc-lang/unicode #3 to actually implement the text segmentation for Grapheme's. It covers most sequences correctly, but not Emoji :cry: or Flags :flag_australia:, or combinations of Indic_Conjunct_Break (which I have no idea how to do yet).

Current progress agains the unicode test suite is 328 failed and 912 passed in 4548 ms..

view this post on Zulip Declan Joseph Maguire (Oct 27 2023 at 09:33):

How do you intend for flags to work? Because they are, by design, not single symbols in unicode. As far are the consortium is concerned they don't want to bake things as fickle as flags into permanent standards, so the way it's implemented is conceptually closer to a ligature. At least, last I checked. Do you want to count flags as one grapheme, or the several symbols that encode it? Like the later is less intuitive, but it's unintuitiveness is directly tied to the intent and function.

view this post on Zulip Luke Boswell (Oct 27 2023 at 09:35):

Basically don't break within two Regional Indicator symbols. This is the text segmentation algorithm https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules. See here for more detail https://www.unicode.org/reports/tr51/#Flags

view this post on Zulip Luke Boswell (Oct 27 2023 at 09:36):

That said, I haven't spent any time on implementing that. I've spent a couple hours on emoji sequences, which looked straightforward, but turns out I don't really understand the notation they are using in the standard. So when I plugged the test cases back into my state machine I am getting incorrect results.

view this post on Zulip Declan Joseph Maguire (Oct 27 2023 at 09:37):

I didn't know there was a standard it. I guess it makes perfect sense that they'd give a guide to something like that.

And yeah, that sounds like a massive pain to implement.

view this post on Zulip Isaac Van Doren (Oct 29 2023 at 18:30):

Hi folks, I just opened up a PR to make List.dropFirst and List.dropLast accept the number of elements to be dropped https://github.com/roc-lang/roc/pull/5941.

Related to this thread https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/Drop.20n.20elements.20from.20the.20end.20of.20a.20list

view this post on Zulip Anton (Oct 30 2023 at 09:41):

Thanks @Isaac Van Doren! I'll do the review

view this post on Zulip Isaac Van Doren (Nov 01 2023 at 02:39):

Just opened a pr to change the type of Stdin.line to Task [Input Str, End] *. Looking forward to this so I can pipe input into programs :big_smile:. https://github.com/roc-lang/basic-cli/pull/114

view this post on Zulip Anton (Nov 01 2023 at 09:34):

Thanks @Isaac Van Doren :)
I'll take a look later today

view this post on Zulip Brendan Hansknecht (Nov 06 2023 at 17:06):

Two simple PRs for review: #5955 and #5956

view this post on Zulip Ayaz Hafiz (Nov 06 2023 at 17:08):

Approved, looks like the first has CI failures

view this post on Zulip Brendan Hansknecht (Nov 06 2023 at 17:30):

Apparently using the Github UI to rebase a branch ends up removing commit verification...that's annoying

view this post on Zulip Brendan Hansknecht (Nov 12 2023 at 16:30):

#5978 rust glue generation changes to fix closures.

view this post on Zulip Luke Boswell (Nov 14 2023 at 05:21):

We have a web server that compiles and runs now :tada: https://github.com/roc-lang/basic-webserver/pull/2

@Brendan Hansknecht's workaround is required for now whenever re-generating glue. There is still a lot of polish required to make this more user friendly, but at least it serves requests.

view this post on Zulip Luke Boswell (Nov 14 2023 at 06:25):

I think this is pretty cool... added the Command effect and an example which reads todos from an SQLite3 database and then send a JSON encoded response. :smiley:
Screenshot-2023-11-14-at-17.23.39.png
Screenshot-2023-11-14-at-17.23.47.png

view this post on Zulip Luke Boswell (Nov 14 2023 at 10:25):

Definitely getting carried away over here... it's very quick an easy to add new features.

basic-webserver-2.gif

view this post on Zulip Richard Feldman (Nov 14 2023 at 12:13):

yoooooooo :heart_eyes: :heart_eyes: :heart_eyes: :heart_eyes: :heart_eyes:

view this post on Zulip Richard Feldman (Nov 14 2023 at 12:29):

amazing work, @Luke Boswell @Brendan Hansknecht!!!

view this post on Zulip Agus Zubiaga (Nov 15 2023 at 05:05):

I copied the TCP implementation I did for basic-cli to basic-webserver: https://github.com/roc-lang/basic-webserver/pull/4

view this post on Zulip Agus Zubiaga (Nov 15 2023 at 05:16):

This unblocks us from trying things like roc-pg on top of it. However, in the long term, the API should look a little different, including the ability to maintain TCP connections across requests and potentially some pooling primitives.

view this post on Zulip Richard Feldman (Nov 15 2023 at 11:50):

yeah I have some ideas about a pooling API design! We should chat about that at some point, make sure they'd be a good fit for roc-pg

view this post on Zulip Richard Feldman (Nov 15 2023 at 11:51):

@Luke Boswell is probably the best person to review this one!

view this post on Zulip Brendan Hansknecht (Nov 15 2023 at 15:57):

Super simple review, just adding a few trait to RocResult such that it has them when needed in glue generation: #5986

view this post on Zulip Luke Boswell (Nov 16 2023 at 03:20):

#5989 adds a Table of Contents for the WIP Tutorial page.

view this post on Zulip Luke Boswell (Nov 16 2023 at 03:21):

^^ also formats some css as I ran Prettier on the file.

view this post on Zulip Luke Boswell (Nov 16 2023 at 05:41):

basic-webserver#5 Updates the README and improves the examples making them more beginner friendly, cleaner, with improved error handling

view this post on Zulip Luke Boswell (Nov 16 2023 at 07:21):

Also @Richard Feldman Im not sure if you wanted anything in that main.roc example, so I've just left it and the comments for now. It looks like your doing something with secrets or tokens.

view this post on Zulip Agus Zubiaga (Nov 18 2023 at 18:13):

https://github.com/roc-lang/basic-cli/pull/132

view this post on Zulip Luke Boswell (Nov 19 2023 at 07:12):

basic-webserver#8 is ready for review. It's a pretty massive improvement and should make the platform significantly more capable.

view this post on Zulip Brian Carroll (Nov 19 2023 at 08:47):

21k lines of diff, wow. How much of that is generated code that doesn't need review?

view this post on Zulip Luke Boswell (Nov 19 2023 at 09:02):

Shouldnt be too much. Almost all of those lines are probably the generated glue.

view this post on Zulip Luke Boswell (Nov 19 2023 at 09:17):

@Agus Zubiaga do you have any examples with roc-pg? I don't have a great way to test the Tcp module.

I added the types for Tcp to platform/main-manual-glue.roc so they are (re)generated the same as all the others, and am 99% confident this will not have broken anything as the changes to glue since you generated that tcp_glue.rs were very minor.

view this post on Zulip Luke Boswell (Nov 19 2023 at 09:42):

@Anton @Brian Carroll would either of you mind looking through the PR for me?

view this post on Zulip Luke Boswell (Nov 19 2023 at 09:43):

I modified the way glue is generated so that the one script platform/glue-gen.sh will generate it all.

view this post on Zulip Luke Boswell (Nov 19 2023 at 09:44):

There are two parts to glue because glue only generates for some of the types, so I added platform/main-manual-glue.roc which I've called the crate glue_manual and use that to generate the missing types

view this post on Zulip Luke Boswell (Nov 19 2023 at 09:44):

If you re-generate glue there are a few issues that have to be manually fixed by hand, I logged https://github.com/roc-lang/roc/issues/6012 to capture those.

view this post on Zulip Brian Carroll (Nov 19 2023 at 09:46):

OK I can have a look but I'm going to need your help to narrow down which files are actually to be reviewed! 22k lines is not realistic for a person to look at. Could you spell that out for us?

view this post on Zulip Luke Boswell (Nov 19 2023 at 09:47):

I'll go through an make a bunch of comments in the PR

view this post on Zulip Luke Boswell (Nov 19 2023 at 09:48):

platform/src/lib.rs and the examples are the places to focus.

view this post on Zulip Luke Boswell (Nov 19 2023 at 09:48):

And almost all of that lib.rs file is copied from basic-cli and updated to point to the correct glue types.

view this post on Zulip Agus Zubiaga (Nov 19 2023 at 17:27):

Luke Boswell said:

Agus Zubiaga do you have any examples with roc-pg? I don't have a great way to test the Tcp module.

I gave a demo at work the other day using roc-pg + basic-webserver and it worked great. I can’t upload that example because it used our real db, but when I’m back home from a trip tomorrow, I’ll make a public one.

view this post on Zulip Elias Mulhall (Nov 19 2023 at 21:08):

I made some updates to the examples repo:

This was prompted by a conversation at the end of the meeting yesterday, where I mentioned that a few of the examples seemed a bit rough/confusing.

view this post on Zulip Brendan Hansknecht (Nov 21 2023 at 03:37):

#6034 should be ready to review. It just deletes the old copy of basic-cli from the roc repo and updates all of the examples to use the basic-cli platform via url. I copied over an version of each example from the basic-cli repo to update them. I also added roc check tests to each file that doesn't have a full test to avoid them going stale. Overall, it is a pretty direct PR mostly deleting things.

view this post on Zulip Brendan Hansknecht (Nov 21 2023 at 04:11):

#6030 should now also be ready for review.

It does 2 main things:

  1. it adds code gen for the .. as rest syntax (just a call to List.sublist).
  2. it fixes a bug in list exhaustiveness checking such that matching [1, ..] and [.., 1] is not considered a redundant pattern.

view this post on Zulip Luke Boswell (Nov 21 2023 at 21:56):

basic-cli#136 implements Dir.list effect

view this post on Zulip Brendan Hansknecht (Nov 21 2023 at 22:01):

Yay

view this post on Zulip Luke Boswell (Nov 21 2023 at 22:01):

I've kicked of CI for #6054, it looks good to me but I am not familiar with this part of the code base. It's a very small change.

view this post on Zulip Luke Boswell (Nov 22 2023 at 03:23):

#6061 replaces the stale webserver implementation in examples with two example that point to roc-lang/basic-webserver URL package

view this post on Zulip Anton (Nov 22 2023 at 09:33):

Thanks @Luke Boswell :)
I'll review basic-cli#136 and #6061

view this post on Zulip Luke Boswell (Nov 22 2023 at 22:10):

Just a random GH related question, not necessarily specific to this PR or anything. What is should be the process for when we get a PR to this stage?

It's been reviewed, I've made changes and pushed those. I clicked "resolve conversation" on the individual comments. Should I "Dismiss Review" or "Re-request Review" now?

I would normally just chill here and wait for Anton or someone to re-review and merge the changes. But just interested in how the GH workflow is designed to work.

Screenshot-2023-11-23-at-09.07.28.png

view this post on Zulip Richard Feldman (Nov 22 2023 at 22:26):

I've wondered the same thing :big_smile:

view this post on Zulip John Murray (Nov 22 2023 at 22:27):

At my last job where we used gh we would generally re-request review once it was in a good state to be looked at again

view this post on Zulip Luke Boswell (Nov 24 2023 at 00:01):

PR#6068 adds a section for Abilities to the roc Language Reference

view this post on Zulip Luke Boswell (Nov 24 2023 at 00:02):

PR#6072 updates the @ token from a Keyword/Punctuation to an UpperIdent token for correct styling syntax highlighting.

view this post on Zulip Luke Boswell (Nov 24 2023 at 21:03):

examples PR#112 updates the Task example. I've updated to use the new 0.6.1 release. I think @Anton would also like to review this.

view this post on Zulip Elias Mulhall (Nov 26 2023 at 14:28):

PR#6099 fixes a couple issues by desugaring patterns during canonicalization.

view this post on Zulip Elias Mulhall (Nov 26 2023 at 14:36):

This is my first(!) time writing rust code in anger. I think it turned out alright, but if anyone has time for feedback I'd appreciate it.

view this post on Zulip Ayaz Hafiz (Nov 26 2023 at 16:18):

I left you a couple comments Elias, they're non-blocking and can be addressed later

view this post on Zulip Folkert de Vries (Nov 27 2023 at 23:27):

https://github.com/roc-lang/roc/pull/6108 fixes me mixing up the captures and the actual argument to List.map

view this post on Zulip Luke Boswell (Nov 28 2023 at 21:07):

examples#115 renames Task example to Task & Error Handling to improve discoverability. Super skinny PR.

view this post on Zulip Luke Boswell (Nov 28 2023 at 21:32):

Thank you Brendan, you don't have privileges on Examples. @Folkert de Vries are you able to approve?

view this post on Zulip Luke Boswell (Dec 01 2023 at 00:10):

#6123 fixes css class for error color in REPL on homepage.

view this post on Zulip Luke Boswell (Dec 01 2023 at 00:36):

#6124 prevents spellcheck in web REPL text area

view this post on Zulip Richard Feldman (Dec 01 2023 at 00:41):

it's soooo nice that these changes don't have to run the entire CI suite now

thanks for making that happen, Anton! :heart_eyes:

view this post on Zulip Luke Boswell (Dec 01 2023 at 00:48):

Yeah, it's really great. I don't feel the need to bunch all these minor changes into a massive PR to save on CI.

view this post on Zulip Luke Boswell (Dec 01 2023 at 02:43):

#6126 adds a link to roc-lang/roc to the website footer.

view this post on Zulip Brendan Hansknecht (Dec 03 2023 at 01:00):

Easy review, just +14. The entire change is to ignore the seamless slice bit when calculating the length (that and a test case). So we don't see gigantic incorrect numbers for string length: #6158

view this post on Zulip Brendan Hansknecht (Dec 03 2023 at 16:23):

Easy review, just fixing an off by one error: #6166

view this post on Zulip LoipesMas (Dec 04 2023 at 22:47):

New PR just dropped: #6186
keepIf and dropIf for Set and Dict. Please check if safe and optimal

view this post on Zulip Brendan Hansknecht (Dec 05 2023 at 01:19):

#6184 is now passing tests fully.

It fixes our debug info generation (I think we still only generate on the function level, but better than nothing). Changes some of our flags as mentioned in #ideas > Optimize, but only a little, and removes debugir. It has been broken for a while and we now are able to generate real debug info. We should focus on improving our debug info instead of falling back on the debug ir crutch.

view this post on Zulip Folkert de Vries (Dec 05 2023 at 10:09):

that's only partially true: debugir is useful when the problem is in the code we generate, or when LLVM does something weird

view this post on Zulip Folkert de Vries (Dec 05 2023 at 10:10):

and it's broken because of the llvm upgrade right? that can be fixed

view this post on Zulip Anton (Dec 05 2023 at 11:09):

and it's broken because of the llvm upgrade right?

Yes, debugIR needs to be upgraded to llvm 16. There are some breaking changes in llvm 16 that no longer allow the use of getPointerElementType. To record and share knowledge; here are the migration instructions. The migration is not straight forward. C++ experience is recommended.

view this post on Zulip Luke Boswell (Dec 05 2023 at 12:23):

@Oskar Hahn ostcar/roc-wasi PR#1 - adds an Effect implementation for opening a file using WASI. It's probably not the greatest but it works, and I hope can be an example for how to implement other effects in zig platforms. Also thank you @Folkert de Vries for helping with a zig RocResult.

view this post on Zulip Brendan Hansknecht (Dec 06 2023 at 00:12):

#6176 was already reviewed and just needs approval to be merged. I had to rebase to fix a CI issue which is why the old review got dismissed.

view this post on Zulip Brendan Hansknecht (Dec 06 2023 at 16:25):

#6202 Single function PR. Changes the Str substring builtin to use seamless slices. Noticed a program I wrote spent 98% of its time in memcpy before this.

view this post on Zulip Luke Boswell (Dec 06 2023 at 19:25):

#6210 add plans to remove Nat to the website.

view this post on Zulip Brendan Hansknecht (Dec 08 2023 at 00:36):

Full rewrite of the underlying Dict implementation. 1.5x to 3x faster in my testing: #6216

view this post on Zulip Richard Feldman (Dec 08 2023 at 00:46):

yessssssss I love this!!!

view this post on Zulip Luke Boswell (Dec 09 2023 at 08:52):

#6228 handle a TrailingOperator parse error. I wasn't sure of the difference between Severity::RuntimeError or Severity::Fatal so I chose the former as that sounds less scary.

view this post on Zulip Eli Dowling (Dec 10 2023 at 00:52):

#6134 Support for completion in the language server is ready for some reviewing. It's got some pretty major changes and is the first rust I've written in a long time so I'd love some input :)

view this post on Zulip Ayaz Hafiz (Dec 10 2023 at 02:42):

Thanks for doing this. I’ll take a look at it tonight.

view this post on Zulip Folkert de Vries (Dec 10 2023 at 13:19):

https://github.com/roc-lang/roc/pull/6232 makes it possible to create seamless slices from rust. This is useful for nea.

view this post on Zulip Brendan Hansknecht (Dec 11 2023 at 01:07):

#6238 small change just adds a function to dict and fixes some small follow up suggestions form the last pr. (mostly uitest and mono test updates)

view this post on Zulip Brendan Hansknecht (Dec 11 2023 at 03:58):

#6249 Another small PR. This just renames some things in the bitcode to help with clarity.

view this post on Zulip John Murray (Dec 12 2023 at 02:55):

https://github.com/roc-lang/roc/pull/6146
no rush but could someone kick off tests for this? Trying to see if i can get the mac nix setup to work with the new nixpkgs

view this post on Zulip Brendan Hansknecht (Dec 12 2023 at 03:53):

#6256 - fixes Dict.update

view this post on Zulip Bryce Miller (Dec 12 2023 at 04:09):

#6258 - Adds List.walkWithIndexUntil to builtins

view this post on Zulip Bryce Miller (Dec 12 2023 at 04:12):

(Still waiting for CI to finish, but I need to sleep)

view this post on Zulip Richard Feldman (Dec 14 2023 at 03:18):

#6257 - Replace UNKNOWN.roc in reports with real filename

view this post on Zulip Sahil (Dec 14 2023 at 23:14):

I have created a PR for roc-examples repo, please review it and there's a issue that I want to work on but that's already assigned to someone and that assigned person isn't responding, should I start working and create a PR???

view this post on Zulip John Murray (Dec 14 2023 at 23:56):

https://github.com/roc-lang/roc/pull/6281 updated some of the docs for installing with nix + fixed nix run github:roc-lang/roc

view this post on Zulip Anton (Dec 15 2023 at 09:36):

Thanks @John Murray :) I'll try to review today.

view this post on Zulip Anton (Dec 15 2023 at 09:37):

Thanks for the PR @Sahil! I'll try to review today.
Can you provide a link to the issue where the person was not responding?

view this post on Zulip Sahil (Dec 15 2023 at 09:38):

Anton said:

Thanks for the PR Sahil! I'll try to review today.
Can you provide a link to the issue where the person was not responding?

https://github.com/roc-lang/roc/issues/6260

view this post on Zulip Anton (Dec 15 2023 at 09:43):

oranjan was only assigned two days ago, let's give them two more days to reply :)
The examples repo has a bunch of approachable good first issues if you're on the hunt :wink:

view this post on Zulip Sahil (Dec 15 2023 at 09:46):

Yep just waiting for the first approval on the examples repo as that'll help me realize if I'm going in the right way or not, looking forward to contribue to examples repo and I'll update you after couple of days if there's no response,thanks :grinning_face_with_smiling_eyes:

view this post on Zulip Kilian Vounckx (Dec 15 2023 at 19:20):

#6286 Adds a Num.restrictToInterval function (clamp in other languages)

view this post on Zulip Anton (Dec 16 2023 at 09:18):

Thanks @Kilian Vounckx! I'll review today

view this post on Zulip Sahil (Dec 16 2023 at 14:04):

No rush, just informing that I have made the required changes for this issue, https://github.com/roc-lang/roc/issues/6260

view this post on Zulip Anton (Dec 16 2023 at 14:13):

I'm on it :)

view this post on Zulip Sahil (Dec 16 2023 at 14:14):

Thanks

view this post on Zulip Luke Boswell (Dec 17 2023 at 09:43):

unicode PR #3 implements the text segmentation algorithm for legacy grapheme clusters. This PR is very large. @Richard Feldman if you would like I can arrange a time to talk you through the implementation, I've tried my best to leave comments and lots and lots of tests everywhere.

Anyway all that work means we can now do this :tada: :roc:
291053423-5444a941-41a7-4fd3-9102-fcd63e8cda8d.png

view this post on Zulip Luke Boswell (Dec 17 2023 at 09:50):

And I have to share this part of the internal implementation for anyone who is interested in how complicated it is to segment unicode, after you have parsed into grapheme property break tokens.

This took me a quite while to implement, and it probably needs some more testing against real data before I can be confident it is close to correct, there are so many edge cases and the test suite is missing a lot.

view this post on Zulip Luke Boswell (Dec 17 2023 at 09:54):

Also, if there is anyway to fuzz test this I feel like that would be super helpful.

view this post on Zulip Brendan Hansknecht (Dec 17 2023 at 15:26):

It's probably stale and needs to be upgraded, but I made a platform for fuzzing roc code a while back

view this post on Zulip Isaac Van Doren (Jan 04 2024 at 20:28):

PR to display shadowing error messages last in the CLI https://github.com/roc-lang/roc/pull/6344

view this post on Zulip Eli Dowling (Jan 07 2024 at 03:02):

PR to fix the language server and compiler hangs from bad imports https://github.com/roc-lang/roc/pull/6361

view this post on Zulip Richard Feldman (Jan 07 2024 at 03:06):

wow, amazing!!! :heart_eyes:

This has been a very longstanding bug!

view this post on Zulip Eli Dowling (Jan 07 2024 at 04:01):

Richard Feldman said:

wow, amazing!!! :heart_eyes:

This has been a very longstanding bug!

Look... I spoke a little too soon on that one :sweat_smile: . I "fixed" it by forgetting that interfaces need to be able to import from external packages too. But I can sort that out in a minute.

view this post on Zulip Eli Dowling (Jan 07 2024 at 05:20):

Well, it's definitely going to be more than a minute. I know whats wrong at least, but it's going to be a while to get a solution that fixes it for interfaces. See here https://roc.zulipchat.com/#narrow/stream/316715-contributing/topic/Fixing.20hanging.20due.20to.20incorrect.2Funknown.20shorthands

view this post on Zulip Luke Boswell (Jan 08 2024 at 04:07):

#6363 fixes for bugged setjmp/longjmp on windows/llvm

view this post on Zulip Luke Boswell (Jan 13 2024 at 01:32):

basic-cli #156 add Task.list and Task.forEach

view this post on Zulip Isaac Van Doren (Jan 14 2024 at 22:04):

#6384 Adds --ignore-warnings flag to roc check and roc build

view this post on Zulip Michael Pfeifer (Jan 16 2024 at 20:28):

#6329 allows the embedding of code snippets in markdown files during static site generation.

view this post on Zulip Michael Pfeifer (Jan 24 2024 at 23:16):

#6242 prevents roc format from reading the current working directory if the --stdin or --stdout option is present on the command line.

view this post on Zulip Eli Dowling (Jan 29 2024 at 12:13):

#6134 Support for completion in the language server Is ready for another round of review. I've even got my commit signed. Thanks to @Luke Boswell for pointing that one out :)

view this post on Zulip Anton (Jan 29 2024 at 12:14):

I'll kick off CI

view this post on Zulip Brendan Hansknecht (Jan 31 2024 at 06:50):

I have a handful of really small PRs that could use quick reviews:
#6474
#6477
#6478

view this post on Zulip Brendan Hansknecht (Jan 31 2024 at 06:51):

Also this one, but it is windows specific. So want someone who runs roc on windows to make sure I didn't regress anything. I just changed something to match the windows call conv docs:
#6475

view this post on Zulip Luke Boswell (Jan 31 2024 at 10:26):

I can look at windows, but might take a day to get to it. Work is busy this week.

view this post on Zulip Folkert de Vries (Feb 01 2024 at 13:33):

https://github.com/roc-lang/roc/pull/6481 a fix for inline expects that are hit by a top-level expect

view this post on Zulip Luke Boswell (Feb 05 2024 at 03:09):

#6503 is a fix and new test for generating stub lib for macho. It's my first attempt at something for the macos surgical linker.

view this post on Zulip Luke Boswell (Feb 06 2024 at 21:29):

Does anyone have any ideas what might be causing this issue in CI? I've done some research and I thought it might be intermittent, but I re-ran CI and it popped up again. Specifically the AccessDenied looks to be caused by call zig build-lib on Windows, and I suspect it may be related to using a temporary file.

---- generate_dylib::tests::check_exports_macho stdout ----
thread 'generate_dylib::tests::check_exports_macho' panicked at 'Failed to link dummy shared library - stderr of the `zig build-lib` command was:
error: AccessDenied
', crates\linker\src\generate_dylib\macho.rs:70:27

view this post on Zulip Folkert de Vries (Feb 07 2024 at 10:18):

isn't this what we often hit on windows and we just need to run the same command again?

view this post on Zulip Luke Boswell (Feb 07 2024 at 10:26):

Yeah thats what I thought so I restarted it... maybe I should try that again?

view this post on Zulip Luke Boswell (Feb 07 2024 at 10:26):

I just didnt want to waste CI

view this post on Zulip Folkert de Vries (Feb 07 2024 at 12:25):

well but restarting CI will start from a clean slate right?

view this post on Zulip Anton (Feb 07 2024 at 13:02):

I did some searching and I've encountered an AccessDenied from zig in the past and I was able to fix it by setting the env var XDG_CACHE_HOME = "xdg_cache". This was with nix, so not on windows but it may work...

view this post on Zulip Trevor Settles (Feb 07 2024 at 17:35):

My first PR here!
https://github.com/roc-lang/roc/pull/6506
It. adds checks for files extensions. Feel free to let me know what I could do bette in this

view this post on Zulip Anton (Feb 07 2024 at 18:19):

Thanks @Trevor Settles, I'll take a look :)

view this post on Zulip Trevor Settles (Feb 09 2024 at 02:00):

Thanks for your feedback, @Anton! #6506 is ready for another review

view this post on Zulip Eli Dowling (Feb 09 2024 at 07:31):

Hey folks, is there anything more I should do to get this merged?
https://github.com/roc-lang/roc/pull/6134
@Ayaz Hafiz has approved (thanks heaps for all the review :) ). I'm just not sure if there is anything else I should be doing.

view this post on Zulip Luke Boswell (Feb 09 2024 at 07:42):

Oh, can you hit merge?

view this post on Zulip Luke Boswell (Feb 09 2024 at 07:43):

Or is that not available??

view this post on Zulip Luke Boswell (Feb 09 2024 at 07:44):

Done, nice work on this. I look forward to using it.

view this post on Zulip Eli Dowling (Feb 09 2024 at 11:36):

Luke Boswell said:

Oh, can you hit merge?

Oh, maybe I could have? I don't think so though.

view this post on Zulip Eli Dowling (Feb 09 2024 at 11:38):

Either way thanks :). I'll rebase the next pr for module and import conpletion and get that ready soon too.

view this post on Zulip Luke Boswell (Feb 10 2024 at 23:47):

basic-webserver #35 adds basic support for Sqlite3.

view this post on Zulip Luke Boswell (Feb 11 2024 at 03:31):

The key thing here I am unsure about is how the connections are managed wrt multiple threads. I tried to do something that looked ok from some research and asking ChatGPT, but I've not done multithreaded Rust before so that might be all completely wrong or overkill.

view this post on Zulip Brendan Hansknecht (Feb 11 2024 at 03:39):

Should be able to make it a thread local and have one per thread automatically

view this post on Zulip Brendan Hansknecht (Feb 11 2024 at 03:39):

That said, if it is async, might be more complicated.

view this post on Zulip Luke Boswell (Feb 11 2024 at 03:42):

My solution was basically this

struct SQLiteConnection {
     path: String,
     connection: std::sync::Arc<sqlite::Connection>,
 }

 static INIT_GLOBAL_CONNECTION_STORE: std::sync::Once = std::sync::Once::new();
 static mut GLOBAL_SQLITE_CONNECTIONS: *mut std::sync::Mutex<Vec<SQLiteConnection>> =
     std::ptr::null_mut();

fn get_connection(path: &str) -> Result<std::sync::Arc<sqlite::Connection>, sqlite::Error> { //...

view this post on Zulip Brendan Hansknecht (Feb 11 2024 at 03:44):

Maybe a bit defensive, but probably safer.

view this post on Zulip Eli Dowling (Feb 11 2024 at 08:27):

This PR for module completion is ready for review :https://github.com/roc-lang/roc/pull/6347

view this post on Zulip Isaac Van Doren (Feb 13 2024 at 01:50):

This pr makes roc build --lib respect --output https://github.com/roc-lang/roc/pull/6523

view this post on Zulip Gunnar Ahlberg (Feb 14 2024 at 20:07):

My first PR
https://github.com/roc-lang/roc/pull/6524
I think I understood the site.css right.

There was another PR that was fixing the same issue. I am sorry if I overtook it

view this post on Zulip Gunnar Ahlberg (Feb 15 2024 at 16:29):

https://github.com/roc-lang/roc/pull/6526

This adds sorting to the functions mentioned in https://github.com/roc-lang/roc/issues/6494
I am not 100% about the search button layout, I had to resort to margin pushing. Maybe the search button can be simplified?

view this post on Zulip Anton (Feb 16 2024 at 09:50):

Thanks @Gunnar Ahlberg, I'll try to review today :)

view this post on Zulip Richard Feldman (Feb 17 2024 at 19:49):

https://github.com/roc-lang/roc/pull/6422 is finally ready...it's kind of a beast, so I don't expect anyone to do a super thorough review of it, but I'd love it if anyone could glance through it and see if they spot anything concerning!

view this post on Zulip Richard Feldman (Feb 17 2024 at 19:52):

the Zig changes in particular would be nice to have reviewed - they're a pretty small part of it, but they're the changes most likely to impact edge cases that don't have explicit tests (e.g. when numbers are so big they might overflow)

view this post on Zulip Richard Feldman (Feb 17 2024 at 21:02):

also would be good to test some of the wasm4 games and see what impact it has (if any) on the generated wasm code!

view this post on Zulip Luke Boswell (Feb 17 2024 at 23:06):

I can test out wasm4 later

view this post on Zulip Richard Feldman (Feb 18 2024 at 00:58):

nice, thank you!

view this post on Zulip Luke Boswell (Feb 18 2024 at 04:13):

Looks to be working fine with wasm4 on my roc-wasm4/remove-nat branch.

The only issue I have found is that the ZigGlue.roc has a few MODULE NOT IMPORTED in crates/glue/src/../platform/Types.roc warnings which prevent me from regenerating glue for wasm4. This looks to be an unrelated bug to the remove nat changes.

view this post on Zulip Luke Boswell (Feb 18 2024 at 05:52):

basic-webserver #41 simplifies Request API and adds Http.parseFormUrlEncoded helper. These are some changes I've been using locally and wanted to share for others as they are helpful when building a web app.

view this post on Zulip Luke Boswell (Feb 22 2024 at 08:05):

#6533 was contributed by roc-gpt, and ready for human review.

view this post on Zulip Luke Boswell (Feb 22 2024 at 08:09):

I'll clean it up a bit, it's not quite right... but I thought it was an interesting idea.

view this post on Zulip Luke Boswell (Feb 25 2024 at 02:25):

basic-cli#175 change Http.send to return Http.Response instead of Str. Feature requested by @Marten

view this post on Zulip Eli Dowling (Mar 11 2024 at 00:15):

Hey, this has been waiting for review for quite a while now, I'm working on another PR on top of it and it'd be nice to be able to merge it in if it's considered good
https://github.com/roc-lang/roc/pull/6347

view this post on Zulip Luke Boswell (Mar 11 2024 at 02:00):

I kicked of CI, I'm probably not qualified to provide a review and approve though.

view this post on Zulip Eli Dowling (Mar 11 2024 at 14:42):

This PR adding docs for completion is also ready for review and builds atop the previous one adding completions for modules and imports.
https://github.com/roc-lang/roc/pull/6569

view this post on Zulip Anton (Mar 11 2024 at 14:54):

Hey, this has been waiting for review for quite a while now

I'll try to look at it tomorrow if no one else is available

view this post on Zulip Eli Dowling (Mar 17 2024 at 11:44):

This PR for optional record field decoding is ready for some general review:
https://github.com/roc-lang/roc/pull/6587
I also made a thread for it: https://roc.zulipchat.com/#narrow/stream/316715-contributing/topic/Missing.20record.20field.20decoding

view this post on Zulip Luke Boswell (Apr 10 2024 at 02:48):

roc-lang/examples #166 adds an example for Encoding and Decoding abilities

view this post on Zulip Luke Boswell (Apr 10 2024 at 20:50):

Can someone look at ^^^ please, it should be quite small. All the tests are happy.

view this post on Zulip Brendan Hansknecht (Apr 11 2024 at 01:12):

I can look in a minute. Sorry for the delay

view this post on Zulip Eli Dowling (Apr 11 2024 at 01:23):

@Luke Boswell I gave it a skim too :)

view this post on Zulip Luke Boswell (Apr 11 2024 at 01:37):

@Eli Dowling I would appreciate if you could expand on your comments a little. I like the idea of showing both a simpler type and a simpler method, and also a more complicated type with the more complicated approach. I was just trying to capture something for later reference, so happy to polish it so it's clearer for future reference. I'm just not sure what you mean. Do you have access to the examples? Are you able to push to that PR?

view this post on Zulip Luke Boswell (Apr 11 2024 at 01:37):

Even if you flick me some notes, I'll clean it up and add it.

view this post on Zulip Luke Boswell (Apr 11 2024 at 03:02):

Ok, thanks for the review @Brendan Hansknecht and @Eli Dowling. I've updated. ^^^ roc-lang/examples #166 so should be gtg.

view this post on Zulip Eli Dowling (Apr 15 2024 at 00:18):

Teeny tiny PR adding List.getUnchecked: https://github.com/roc-lang/roc/pull/6642

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 00:32):

I don't think we should add that

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 00:32):

We should force the user to add it

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 00:33):

Crash shouldn't be in the standard library in a way that an end user can hit

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 00:33):

Should be equally performant to use list.get and the when ... is and crash

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 00:33):

Last I checked, llvm optimizes them the same

view this post on Zulip Eli Dowling (Apr 15 2024 at 00:34):

Aren't you adding in a a bunch of pointless memory for the tag? or does it just get optimized away?
From reading https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/panic.20on.20out-of-bounds sentiment seemed to be strongly for adding it

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 00:36):

Am I contradicting my past self. Give me a few so I can look this over and think about it more. I do think a better solution would be nice here, but a proper array type would be so many times better....idk....

view this post on Zulip Eli Dowling (Apr 15 2024 at 00:38):

haha, that was my thought too. This seemed like a compromise that doesn't involve significant additions to the compiler. A compile time bounds checked array would be nice though for high performance buffers and LUTs and such

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 01:06):

I guess now I definitely question if this has a gain over forcing the user to do List.get ... |> unwrap

Where unwrap is a when ... is + crash

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 01:06):

Here is the rust equivalent: https://godbolt.org/z/cTEnW8TYq

LLVM should optimize them to the exact same thing

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 01:06):

It will remove the tag fully

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 01:08):

unwrap = \res, msg ->
    when res is
        Ok v -> v
        Err _ -> crash msg

# User can do this inline or make an explicit function for:
List.get list index |> unwrap "Out of Bounds"

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 01:09):

Also since that disassembly is noisy, here is the important part. These are identical

justUnwrap:
        cmp     qword ptr [rdi + 8], rsi
        jbe     .LBB7_2
        jmp     qword ptr [rip + listGetUnsafe@GOTPCREL]
.LBB7_2:
        push    rax
        lea     rdi, [rip + .L__unnamed_4]
        call    std::panicking::begin_panic::he275593115e721e6

listGetUnchecked:
        cmp     qword ptr [rdi + 8], rsi
        jbe     .LBB8_1
        jmp     qword ptr [rip + listGetUnsafe@GOTPCREL]
.LBB8_1:
        push    rax
        lea     rdi, [rip + .L__unnamed_5]
        call    std::panicking::begin_panic::he275593115e721e6

view this post on Zulip Eli Dowling (Apr 15 2024 at 01:09):

Well, I think that basically proves it. Bar having fixed length arrays and avoiding the bounds check, it's not getting any faster

view this post on Zulip Eli Dowling (Apr 15 2024 at 01:10):

So our tags are always equivalent to rust enums? so we can use rust to model roc in Tag/Eunm related scenarios?

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 01:10):

They should be. There is a chance we are modeling something in a way that defeats llvm optimization, but I don't think so.

view this post on Zulip Eli Dowling (Apr 15 2024 at 01:11):

Thankyou, this has been very educational :)

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 01:12):

We do have two other big potential list issues:

  1. The refcounting thing I am working on. A List containing any sort of refcounted data has horrible perf. So List of List, List of Str, List of Dict, List of recusive tag, etc.
  2. We don't have borrow inference, which leads to having list refcounting in places it isn't wanted . Sometimes this can really hurt the perf of a hot loop.

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 01:13):

Not sure specifically what you are working on, but I can take a look with a profiler at some point and try to dig into. There is totally a chance that llvm is failing to optimize away unwrap or some other similar issue. Like it might optimize it away in simple cases but fail for other reasons here.

view this post on Zulip Eli Dowling (Apr 15 2024 at 01:20):

Well I'll do some testing and let you know, it's a tiny optimization for json parsing.
I'm implementing an alternative json parser modeled after RapidJson and other fast json libraries that allow for streaming json parsing.
I need dynamic Json Decoding and encoding from some type of JsonValue:[Object,Array,string,bool,null,number] style type so I need to re-implement it anyway and I thought it would be a good benchmark to compare against the normal decode and encode implementation

view this post on Zulip Brendan Hansknecht (Apr 15 2024 at 01:21):

Sounds exciting

view this post on Zulip Luke Boswell (Apr 17 2024 at 00:18):

#6646 fixes unwrapping for trailing ! suffixed expressions.

view this post on Zulip Luke Boswell (Apr 17 2024 at 22:50):

The following PR's add Task.result

view this post on Zulip Jackson Wambolt (Apr 17 2024 at 23:46):

#6648 converts a bunch of the parser combinators from macros to functions

It's my first roc PR so lmk if I missed anything :)

view this post on Zulip Luke Boswell (Apr 18 2024 at 03:55):

#6649 adds support for suffixed when expressions

view this post on Zulip Luke Boswell (Apr 21 2024 at 08:23):

#6657 fixes parsing lists in tag patterns and resolves issue #6074

view this post on Zulip Luke Boswell (Apr 22 2024 at 01:30):

Luke Boswell said:

#6657 fixes parsing lists in tag patterns and resolves issue #6074

This PR still needs a review/approval. @Joshua Warner and I worked on it together, not sure he can accept?

view this post on Zulip Richard Feldman (Apr 22 2024 at 02:11):

he can, but I just reapproved!

view this post on Zulip Joshua Warner (Apr 22 2024 at 02:19):

Yep; sorry about the delay there. Busy day!

view this post on Zulip Luke Boswell (Apr 22 2024 at 09:08):

#6662 adds additional support for trailing ! in the case where we have a suffixed Apply leaf node.

view this post on Zulip Luke Boswell (Apr 26 2024 at 04:55):

Here are all of the PR's in train that are all ready and correspond to the effort to update the tutorial for the suffix blog article.

https://github.com/roc-lang/roc/pull/6675 - the tutorial update PR

view this post on Zulip Luke Boswell (Apr 28 2024 at 01:09):

Super minor (single line markdown) PR to fix a visual issue in tutorial https://github.com/roc-lang/roc/pull/6689

view this post on Zulip Luke Boswell (May 04 2024 at 19:36):

I've pushed a number of changes to #6696, it might even pass CI but I suspect there'll be issues. It's still WIP, I think I can also write some build scripts for ruby, swift ui, java etc but that was hard to research on the plane without Wifi. And I'm planning on doing some more polish and general cleanup of things.

I would appreciate any comments or thoughts, I apologise in advance how large it is... but making the change to make platforms responsible for building their binaries kind of touches all the examples.

view this post on Zulip Luke Boswell (May 04 2024 at 19:41):

Also - 6712 is relatively small change that fixes dbg when unwrapping suffixed !

view this post on Zulip Luke Boswell (May 05 2024 at 14:57):

#6715 - minor changes to update the Glue platform files to the new syntax.

view this post on Zulip Sam Mohr (May 06 2024 at 07:42):

#202 for basic-cli - changed the broken args example to use Weaver instead, good suggestion from @Luke Boswell

view this post on Zulip rrrodzilla (May 07 2024 at 08:13):

close #6723: Update format_files to list all files by rrrodzilla · Pull Request #6728 · roc-lang/roc (github.com)

Hi folks, let me know if I need to make any changes.

view this post on Zulip Agus Zubiaga (May 08 2024 at 01:46):

Import parsing and reporting improvements:
https://github.com/roc-lang/roc/pull/6717
https://github.com/roc-lang/roc/pull/6732

view this post on Zulip Agus Zubiaga (May 08 2024 at 12:45):

Minor improvement for reporting in the language server:
https://github.com/roc-lang/roc/pull/6734

view this post on Zulip Richard Feldman (May 08 2024 at 14:57):

niiiiice, I was just thinking about this when doing that live-coding demo :big_smile:

view this post on Zulip Richard Feldman (May 08 2024 at 15:01):

an even further improvement would be hiding the inline source code context, since you already have that right there in the editor - including the squiggle

view this post on Zulip Agus Zubiaga (May 08 2024 at 16:02):

Totally. Unfortunately, it’s not something we can do automatically because for a lot of reports, the wording wouldn’t make sense anymore.

view this post on Zulip Agus Zubiaga (May 08 2024 at 16:05):

Eventually, I think we’ll need a separate reporting renderer for the language server, so we can do rust-analyzer-style blue squiggles for related code

view this post on Zulip Ayaz Hafiz (May 08 2024 at 18:02):

We probably want to generate the reports in a more generic manner (e.g. some data structure with message/location/addition notes/etc) and have each consumer decide how they want to render it.

view this post on Zulip Agus Zubiaga (May 09 2024 at 11:24):

The formatter in the language server isn't properly upgrading imports. This fixes that:
https://github.com/roc-lang/roc/pull/6739

view this post on Zulip Agus Zubiaga (May 18 2024 at 00:20):

https://github.com/roc-lang/roc/pull/6757

view this post on Zulip Agus Zubiaga (May 18 2024 at 00:20):

cc @Luke Boswell

view this post on Zulip Luke Boswell (May 20 2024 at 09:56):

#6762 enables a generic default host libhost for prebuilt platform binaries when the more specific host is not found, e.g. macos-arm64.

view this post on Zulip Luke Boswell (May 22 2024 at 05:54):

#6770 moves basic cli tests from examples into crates/cli/tests/cli/

view this post on Zulip Luke Boswell (May 22 2024 at 05:54):

#6769 remove static-site-gen example and replace website with basic-ssg release

view this post on Zulip Luke Boswell (May 22 2024 at 05:56):

#6761 fixes importing ingested file when bundling packages

view this post on Zulip Luke Boswell (May 31 2024 at 03:28):

basic-webserver #54 refactors the host files out into crates, updates configuration, and adds a build.roc to build all the binaries (surgical linking will need the 6696 PR in roc merged -- but this PR should land first).

It's not ready to merge yet, there are at least two blocking issues.

  1. we need to add roc to the build scripts
  2. for some reason we now need to include another framework for this to run on macos e.g. ROC_LINK_FLAGS="-framework SystemConfiguration" roc examples/echo.roc. I haven't changed any dependencies. Should we include this in the default linker flags in roc? or have I done something strange that means we now require this?

view this post on Zulip Luke Boswell (May 31 2024 at 03:33):

@Brendan Hansknecht do you think we could/should include this framework in roc when we link on macos?

view this post on Zulip Luke Boswell (May 31 2024 at 04:37):

basic-cli #194 refactors the host files out into crates. It's stuck on a linux CI issue. This should also be merged before we remove platform rebuilding from roc cli. Surgical linker will need to be added once the PR 6696 in roc is completed.

view this post on Zulip Brendan Hansknecht (May 31 2024 at 04:45):

Not really sure, will take a deeper look tomorrow

view this post on Zulip Luke Boswell (May 31 2024 at 05:12):

basic-cli #210 -- one liner to .gitignore dynamic libraries

view this post on Zulip Luke Boswell (May 31 2024 at 05:32):

basic-cli #211 adds Env.platform effect to get the Arch and OS constants withouth shelling out to uname

view this post on Zulip Kiryl Dziamura (Jun 03 2024 at 15:11):

https://github.com/roc-lang/roc/pull/6785 - fixes await bang desugaring in expect continuation

view this post on Zulip Kiryl Dziamura (Jun 03 2024 at 21:05):

https://github.com/roc-lang/roc/pull/6786 - detect await bang inside of when branches

view this post on Zulip Folkert de Vries (Jun 05 2024 at 15:17):

https://github.com/roc-lang/roc/pull/6788 fixes some clippy errors (for later versions of clippy) and performs a slight cleanup on some language server code. I don't think it's that risky, but I'm not sure how well this logic is tested by automated tests. Who should I tag for a review on this code?

view this post on Zulip Luke Boswell (Jun 05 2024 at 20:33):

Maybe @Eli Dowling would be interested? I can have a look also, though not super familiar with that part of the code base.

view this post on Zulip Luke Boswell (Jun 05 2024 at 21:16):

Nvm, super small change, done :+1:

view this post on Zulip shua (Jun 07 2024 at 17:14):

Hello, I've got a draft PR up for a Str.concatUtf8 builtin. This is my first time contributing, and I've marked as a draft only because there are two places marked with XXX comments I could use help from maintainers to see if what I'm doing is correct, or help writing a comment explaining what's going on. Otherwise the code seems to work and added tests pass.

https://github.com/roc-lang/roc/pull/6791

Should I leave this as a draft PR or should I just open it as a regular PR?

view this post on Zulip Anton (Jun 07 2024 at 17:37):

Thanks @shua, let's keep it a draft PR until your questions are resolved.
Could one of you take a look @Folkert de Vries or @Brendan Hansknecht?

view this post on Zulip Brendan Hansknecht (Jun 07 2024 at 18:00):

Naming thing:
Str.concatUtf8: List U8, Str -> List U8

Definitely feels backwards from what I expected. I would have expected this signature:
Str.concatUtf8: Str, List U8 -> Str

So we may want to consider a different name. Generally speaking, it should be in the List namespace if it takes a list first arg. so maybe List.concatStr or List.concatUtf8?


Also, the built-in will only be faster for small strings. For small strings, it avoids allocating a temporary list of the data in the string. For large strings, it makes no difference. They seamlessly convert to List U8.

view this post on Zulip Luke Boswell (Jun 07 2024 at 21:31):

Yeah, is this adding a Str to a list of bytes, or a list of bytes to a Str?

view this post on Zulip Luke Boswell (Jun 07 2024 at 21:31):

Yeah, is this adding a Str to a list of bytes, or a list of bytes to a Str?

view this post on Zulip Luke Boswell (Jun 07 2024 at 21:32):

What about List.appendStr : List U8, Str -> List U8

view this post on Zulip Brendan Hansknecht (Jun 07 2024 at 21:34):

Should be concat probably. Concat is multi element, append is single element. So append would suggest List Str, Str -> List Str

Could also be List.concatStrBytes or similar.

view this post on Zulip shua (Jun 08 2024 at 11:18):

I think List.concatUtf8 makes sense. It is specifically a string encoded as utf-8 bytes, as there are other possible (not as common, but possible) byte encodings for a string. We also already have Str.fromUtf8 and Str.toUtf8 to indicate as opposed to just Str.fromList or something generic.

view this post on Zulip Agus Zubiaga (Jun 08 2024 at 23:31):

Since I've been stuck for a few days on module params, I decided to take a little break and fix a longstanding issue: https://github.com/roc-lang/roc/pull/6792

view this post on Zulip Agus Zubiaga (Jun 08 2024 at 23:36):

TL;DR: The compiler won't hang when roc test/roc check/the lang server encounters a package import on a module. Instead it will resolve the package from the app, or show a helpful error message.

view this post on Zulip Agus Zubiaga (Jun 09 2024 at 17:55):

https://github.com/roc-lang/roc/pull/6795

view this post on Zulip Luke Boswell (Jun 10 2024 at 00:17):

shua said:

Hello, I've got a draft PR up for a Str.concatUtf8 builtin.
https://github.com/roc-lang/roc/pull/6791

I've had a look at this, and I think it looks good. Kicked off CI. @Brendan Hansknecht were you able to look at the zig part? Just wanting to confirm you're happy with that.

view this post on Zulip Brendan Hansknecht (Jun 10 2024 at 00:19):

Yeah, the zig part looks good

view this post on Zulip Luke Boswell (Jun 15 2024 at 22:58):

basic-cli #206 is ready for review. It adds File.readLine for buffered IO.

If someone more experienced with Rust could take a closer look at the rust implementation, I'm particularly unsure about how I'm using the thread local. It works well with my testing, but I'm not sure if this is a good way to do this.

thread_local! {
    static READERS: RefCell<Vec<Rc<RefCell<BufReader<File>>>>> = RefCell::new(Vec::new());
}

view this post on Zulip Luke Boswell (Jun 17 2024 at 07:27):

examples #184 updates the local dev script to use a release of basic-ssg, and updated CONTRIBUTING instructions so people can see the site locally before committing PRs.

view this post on Zulip Luke Boswell (Jun 22 2024 at 18:45):

basic-webserver #19 adds Task.seq and Task.forEach (copied from basic-cli).

view this post on Zulip Luke Boswell (Jun 23 2024 at 02:33):

roc-lang/examples #46 adds a new example which shows how to safely calculates the variance of a population. I made some fixes, so need another approver to merge. Thank you @Fábio Beirão

view this post on Zulip Ryan Barth (Jun 23 2024 at 19:27):

I fixed the nightly release package not being able to build / run the nodejs-interop/wasm example:
https://github.com/roc-lang/roc/pull/6834

view this post on Zulip Ryan Barth (Jun 23 2024 at 19:29):

(or building a wasm target at all :smile: )

view this post on Zulip Kiryl Dziamura (Jun 25 2024 at 13:56):

fix for task bang desugaring in the deps final expression
https://github.com/roc-lang/roc/pull/6837/files

view this post on Zulip Agus Zubiaga (Jun 26 2024 at 00:43):

Fix for loading transitive packages: https://github.com/roc-lang/roc/pull/6840

view this post on Zulip Agus Zubiaga (Jun 26 2024 at 00:44):

I thought I had fixed this already but @Luke Boswell pointed out it was still broken

view this post on Zulip Luke Boswell (Jun 26 2024 at 03:44):

Luke Boswell said:

basic-cli #206 is ready for review. It adds File.readLine for buffered IO.

Updated post comments and ready for review. Instead of returning an error for EOF we simply return an empty list. This means we can use it like this;

processLine : File.FileReader -> (ReadSummary -> Task [Step ReadSummary, Done ReadSummary] _)
processLine = \reader -> \{ linesRead, bytesRead } ->
        when File.readLine reader |> Task.result! is
            Ok bytes if List.len bytes == 0 ->
                Task.ok (Done { linesRead, bytesRead })

            Ok bytes ->
                Task.ok (Step { linesRead: linesRead + 1, bytesRead: bytesRead + (List.len bytes |> Num.intCast) })

            Err err ->
                Task.err (ErrorReadingFile (Inspect.toStr err))

view this post on Zulip Luke Boswell (Jun 26 2024 at 11:25):

basic-cli #206 adding File.readLine is ready for a review. Thank you @Sam Mohr for the reviews and feedback -- I think it's a much better implementation.

view this post on Zulip Richard Feldman (Jun 30 2024 at 12:16):

refactor of some internal compiler error macros: https://github.com/roc-lang/roc/pull/6853

view this post on Zulip Luke Boswell (Jul 01 2024 at 05:25):

basic-cli #221 eliminates potential sources of bugs which are complicating the upgrade to builtin-task -- by replacing the glue generated code for roc types with roc_std or hand-rolled equivalents.

view this post on Zulip Sam Mohr (Jul 01 2024 at 06:01):

@Richard Feldman I was going to copy the majority of the above "glue reduction" changes from basic-cli to basic-webserver, but basic-webserver organizes its FFI a bit differently than basic-cli. Namely, you created the roc_fn proc macro 9 months ago (commit) and it's used to wrap all FFI calls in the platform code, whereas basic-cli just sets up bare FFI calls.

Though I can see the benefits of roc_fn, it seems better to align basic-cli and basic-webserver to make mutual platform task updates easier, and since basic-cli is the current flagship, I'm thinking we should remove roc_fn and basically copy over basic-cli's impl to basic-webserver. Are you okay with that, or would you rather keep roc_fn at the cost of heterogeneity?

view this post on Zulip Luke Boswell (Jul 01 2024 at 08:11):

basic-webserver #58 adds Task as builtin.

Note to run this you will need roc built from this PR #6836 -- this is why CI is currently not passing.

view this post on Zulip Richard Feldman (Jul 01 2024 at 11:06):

I think it's fine to change basic-webserver to be more like basic-cli, including getting rid of roc_fn :thumbs_up:

view this post on Zulip Kiryl Dziamura (Jul 01 2024 at 17:52):

Fix for await bang desugaring and simplification of Defs parsing: https://github.com/roc-lang/roc/pull/6851
@Joshua Warner please take a look when you have some time

view this post on Zulip Luke Boswell (Jul 02 2024 at 00:35):

Big thank you to @Ryan Barth #6808 updates preprocess host API is now ready for review.

This PR cleans up this API making it much easier to build surgical linker binaries - resolving some bugs, and also removes the hardcoded libapp and dynhost names.

It also unlocks the rebuilding host changes; by making it possible to refactor basic-cli host into crates and still have surgical linker binaries - decoupling it from the rebuilding host changes.

view this post on Zulip Agus Zubiaga (Jul 02 2024 at 13:47):

Module params can and typechecking: https://github.com/roc-lang/roc/pull/6861

Still quite a few gen bugs to fix but getting closer

view this post on Zulip Sam Mohr (Jul 02 2024 at 19:02):

I can't describe how hype that video preview is! Once that and the Task PRs go through, we can get the ecosystem chugging along quite nicely!

view this post on Zulip Brendan Hansknecht (Jul 02 2024 at 19:11):

Oh wow...yeah, that video preview is epic!

view this post on Zulip Trevor Settles (Jul 03 2024 at 03:24):

In #6846 I'm removing DecodeError, as well as making Encode/Decode generic over their output/input types respectively. I'm close to making code changes in basic-cli/basic-webserver, but I wanted to check in on names and order of type params before I got too far.
Right now, I've got:

And planning on changing to

view this post on Zulip Brendan Hansknecht (Jul 03 2024 at 03:47):

I think it should be
DecoderResult state val err : Result (val, state) err

And use state in general over input

view this post on Zulip Brendan Hansknecht (Jul 06 2024 at 06:45):

First PR for sqlite improvements: https://github.com/roc-lang/basic-webserver/pull/60
And related PR to update glue generation in roc: https://github.com/roc-lang/roc/pull/6878

view this post on Zulip Brendan Hansknecht (Jul 07 2024 at 01:57):

@Trevor Settles What is your plan for the decoder and encoder work and do you need help?

I think once the types are fully updated, the second piece would be updating implementations (should be easy, just use list as the state). The final piece, which may be more complex though I'm not actually sure how much it changes is if any of the auto derive functionality needs to change.

view this post on Zulip Trevor Settles (Jul 07 2024 at 02:25):

Thanks for checking in! I'm still working on it. My PRs are pretty much up to date. I've made one change in crates/compiler/derive/src/decoding/list.rs one lines 39 and 41. But now I'm trying to figure this out this error. Something about unifying lambdas...

An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
ambient functions don't unify

Progress is a little slow, as I haven't done this kind of thing before, and 1 year old twins take a lot of time, haha. I don't want to hold this up too much. So, if people think I'm close, and just need to do a little more reading/learning, I'll keep working on it. Otherwise, I've got no problems handing it off to someone else, and seeing their solution to the problem

view this post on Zulip Brendan Hansknecht (Jul 07 2024 at 02:36):

ambient functions don't unify

I think that is essentially a bad internal error that the types don't match. But I don't fully recall, has been a long time since I touched that code.


And not trying to rush you, just thinking about writing a decoder and kinda want to write it for the new format instead of the current ability.

So, if people think I'm close, and just need to do a little more reading/learning

I wish I knew more concretely. Like I think the concrete type work should be relatively quick, but the derive work might be complex.

view this post on Zulip Sam Mohr (Jul 07 2024 at 10:40):

PR implementing the new map2-based record builders (while still supporting the old style): https://github.com/roc-lang/roc/pull/6883
This is just implementation, docs are coming in a separate PR.

view this post on Zulip Sam Mohr (Jul 08 2024 at 09:29):

I've updated Weaver to the new record builder syntax. It was pretty easy (it took about 2 hours), and I was able to maintain the same behavior as before. Especially convenient is the fact that the typestate pattern that ensured options are parsed before subcommands or before parameters was able to be transferred over! If anyone is curious, feel free to check out how I implemented this typestate approach with the new syntax in the PR: https://github.com/smores56/weaver/pull/2

No review needed, just a heads up.

view this post on Zulip Kiryl Dziamura (Jul 08 2024 at 10:19):

minor fixes for parser and desugaring: https://github.com/roc-lang/roc/pull/6888

view this post on Zulip Kiryl Dziamura (Jul 09 2024 at 17:10):

task bang desugaring with respect to type annotations: https://github.com/roc-lang/roc/pull/6868
it generates weird type error messages tho :exhale: (because of the way I propagated the type annotations. more info in pr)

view this post on Zulip Luke Boswell (Jul 10 2024 at 11:21):

Kiryl and I had a chat about ^^^. There's a couple of things I think we want to clean up a bit before merging but in general the approach looks like it's good.

We think it might be best to help Josh land the parser changes first, then revisit this when we have the snapshot tests. We can potentially even have the tests include the formatted AST after desugaring whovh would make verifying these changes much easier.

view this post on Zulip Sam Mohr (Jul 11 2024 at 10:09):

Update the weaver clone in basic-cli to use the new record builder syntax: https://github.com/roc-lang/basic-cli/pull/227

Just release v0.3.0 of Weaver with the new syntax, btw: https://github.com/smores56/weaver/releases/download/0.3.0/GJtHjepVuDUSzWogFflwMiqPnCV5FKR81722WVmUC5E.tar.br

view this post on Zulip Brendan Hansknecht (Jul 11 2024 at 15:29):

Oh yeah, the new syntax. I should test it on my sqlite pr. Maybe if I'm lucky it will fix the lambdaset issue by changing how things compose.

view this post on Zulip Sam Mohr (Jul 11 2024 at 15:30):

It's less currying, so that could be a difference

view this post on Zulip Kiryl Dziamura (Jul 13 2024 at 08:38):

https://github.com/roc-lang/roc/issues/6900
Snapshot tests for suffixed desugaring

view this post on Zulip Luke Boswell (Jul 15 2024 at 04:35):

#6905 adds impl RocRefcounted for RocResult.

view this post on Zulip Kiryl Dziamura (Jul 16 2024 at 10:19):

Type annotations for suffixed sugar

The type checks and type annotations propagation for suffixed expressions and statements are ready. The change also includes nice error messages (although not every case is covered, only common cases)

view this post on Zulip Brendan Hansknecht (Jul 16 2024 at 20:17):

#6907 is ready to review.

Minor refcounting follow up/bug fix with general TODO added around list drop specialization.

view this post on Zulip Brendan Hansknecht (Jul 18 2024 at 00:39):

File refcounting and mmap for basic cli: https://github.com/roc-lang/basic-cli/pull/230

view this post on Zulip Luke Boswell (Jul 18 2024 at 22:53):

basic-webserver #62 adds support for parsing multipart/form-data requests.

view this post on Zulip Luke Boswell (Jul 21 2024 at 10:44):

#6917 removes the gui and swift examples from roc.

For the GUI example; I moved it to roc-lang/examples PR#6917 -- which is also Ready for Review.

view this post on Zulip Brendan Hansknecht (Jul 21 2024 at 22:09):

#6918 greatly improves sorting performance.

Generates better copying functions in zig instead of always using memcpy.

view this post on Zulip Brendan Hansknecht (Jul 22 2024 at 03:12):

Ok, #6918 is now actually ready for a final review.

I changed it to generating the functions in roc and passing them into zig which is the better implementation anyway!

view this post on Zulip Luke Boswell (Jul 29 2024 at 04:55):

#6933 -- bundle windows .lib files when making a platform package.

Size: ultra small, Priority: very low

view this post on Zulip Brendan Hansknecht (Jul 30 2024 at 22:46):

Figured out why auto freeing wasn't working with tcp streams in basic cli. This fixes that and update tcp streams apis!

https://github.com/roc-lang/basic-cli/pull/237

view this post on Zulip Brendan Hansknecht (Jul 30 2024 at 22:50):

Gets the new sqlite querying api working for basic-webserver!

Targets the refactor-host branch instead of main cause it requires RocRefcounted changes.
https://github.com/roc-lang/basic-webserver/pull/61

Querying sqlite should now be nicer and much more performant:

queryTodosByStatus = \dbPath, status ->
    stmt = SQLite3.prepareAndBind! {
        path: dbPath,
        query: "SELECT id, task FROM todos WHERE status = :status;",
        bindings: [{ name: ":status", value: String status }],
    }
    SQLite3.execute!
        stmt
        { SQLite3.map2 <-
            id: SQLite3.i64 "id",
            task: SQLite3.str "task",
        }

view this post on Zulip Sam Mohr (Aug 04 2024 at 10:43):

PR for adding support for ignoring record builder fields: https://github.com/roc-lang/roc/pull/6968

expect-fx
    result =
        { Task.parallel <-
            first: Task.ok 123,
            second: Task.ok 456,
            _ignored: Task.ok 789,
            _: Task.ok 0,
        }!

    result == Ok { first: 123, second: 456 }

view this post on Zulip Sam Mohr (Aug 04 2024 at 10:51):

Updating tests now, they'll be failing in CI for a bit

view this post on Zulip Sam Mohr (Aug 04 2024 at 11:23):

Debug tests are passing so it should be good for review

view this post on Zulip Agus Zubiaga (Aug 06 2024 at 21:17):

Fix for #6931: https://github.com/roc-lang/roc/pull/6972

view this post on Zulip Sam Mohr (Aug 15 2024 at 16:18):

Implementing ? -> Result.try by genericizing the ! -> Task.await desugaring code: https://github.com/roc-lang/roc/pull/7000

view this post on Zulip Brendan Hansknecht (Aug 15 2024 at 17:13):

I love how relatively small of a change this is. Nice reuse.

view this post on Zulip Sam Mohr (Aug 15 2024 at 17:17):

Thanks!

view this post on Zulip Sam Mohr (Aug 16 2024 at 08:50):

Implementing &foo -> (\record, field -> { record & foo: field }) desugaring: https://github.com/roc-lang/roc/pull/7002

This means we can now do

user = { name: "Sam", id: 123 }

expect user |> &id 234 == { name: "Sam", id: 234 }

Which should unblock the remaining syntax in the Action-State proposal, among other use cases.

view this post on Zulip Sam Mohr (Aug 17 2024 at 05:46):

Added a deprecation warning for all backpassing usage and removed all non-testing usage from the repo: https://github.com/roc-lang/roc/pull/7005

module []

foo = \result ->
    bar <- Result.try result
    Ok (bar * 3)

backpassing-deprecation-warning.png

[smores@smoresbook:~/dev/roc]$ cargo run --bin roc -- check Test.roc
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
     Running `target/debug/roc check Test.roc`

── BACKPASSING DEPRECATED in Test.roc ──────────────────────────────────────────

Backpassing (<-) like this will soon be deprecated:

4│      bar <- Result.try result
        ^^^^^^^^^^^^^^^^^^^^^^^^

You should use a ! for awaiting tasks or a ? for trying results, and
functions everywhere else.

view this post on Zulip Sam Mohr (Aug 17 2024 at 05:54):

No Brendan, No Cry

view this post on Zulip Sam Mohr (Aug 17 2024 at 05:54):

Feel free to gather examples of backpassing that we can't handle with ! or ? and we can make a case for not actually removing the feature

view this post on Zulip Brendan Hansknecht (Aug 17 2024 at 05:56):

I think it is a reasonable thing to remove and the replacements cover all the common cases. I just still randomly use it and will miss it

view this post on Zulip Brendan Hansknecht (Aug 17 2024 at 05:57):

Probably use it most often now with opaque types that wrap functions like the decoder for sqlite results

view this post on Zulip Luke Boswell (Aug 17 2024 at 07:29):

#7007 implements the Str.dropPrefix and Str.dropSuffix builtins.

Not sure if we should fuzz test this to see if we can break it?

view this post on Zulip Isaac Van Doren (Aug 17 2024 at 14:51):

Added a deprecation warning for all backpassing usage and removed all non-testing usage from the repo: https://github.com/roc-lang/roc/pull/7005

I’ll miss it most for parser combinators but I will survive

view this post on Zulip Sam Mohr (Aug 17 2024 at 14:54):

Isaac Van Doren said:

Added a deprecation warning for all backpassing usage and removed all non-testing usage from the repo: https://github.com/roc-lang/roc/pull/7005

I’ll miss it most for parser combinators but I will survive

Let me write you an example of a record builder version later and maybe you won't miss it so much

view this post on Zulip Luke Boswell (Aug 23 2024 at 23:44):

basic-webserver #70 - adds multipart/form-data

This PR was already merged, but somehow in the process of landing another PR these commits got dropped. It was probably me somehow... I've scratched my head trying to figure out how I did it, because it's rather concerning.

Anyway, this PR is to add them back in.

view this post on Zulip Luke Boswell (Aug 25 2024 at 10:13):

unicode #17 - updates for syntax, dependencies, and fix for the empty Str case.

I can merge, but would appreciate a second set of eyes to check before I make a release.

view this post on Zulip Luke Boswell (Aug 25 2024 at 10:14):

@Aurélien Geron maybe you can give me a review?

view this post on Zulip Elias Mulhall (Aug 27 2024 at 19:34):

https://github.com/roc-lang/roc/pull/7038 implements dbg for expressions!

view this post on Zulip Agus Zubiaga (Aug 27 2024 at 22:25):

This is finally ready for review: https://github.com/roc-lang/roc/pull/7009

view this post on Zulip Agus Zubiaga (Aug 27 2024 at 22:31):

I decided to keep the pass before type-checking for now. I have a branch that moves it after Solve, but while a lot of cases work, it feels too brittle.
This should work well enough for now, and keeping it isolated will help with the upcoming rewrites in the later stages of the pipeline. We can reconsider it later when those things settle.

view this post on Zulip Brendan Hansknecht (Aug 27 2024 at 22:39):

Just curious how hard was wiring this through? Thinking longer term about passing around allocators. Which also needs to add a secret arg to tons of functions.

view this post on Zulip Agus Zubiaga (Aug 27 2024 at 22:54):

I had a pretty bad time trying to do it in mono at first. Doing it in its own pass was pretty straightforward overall.

view this post on Zulip Agus Zubiaga (Aug 27 2024 at 22:55):

I imagine allocators won’t be polymorphic, though, so that might make a big difference

view this post on Zulip Brendan Hansknecht (Aug 27 2024 at 23:21):

Not polymorphic, but potentially more pervasive in terms of loading. Could be used at any random point and deals with finalized allocation details which may not be know until after mono is complete.

view this post on Zulip Brendan Hansknecht (Aug 27 2024 at 23:22):

Also some open questions around wiring through lambdas and captures.

view this post on Zulip Luke Boswell (Aug 31 2024 at 02:46):

basic-webserver #72 adds support for verifying Json Web Tokens.

Only supports the HS256, HS384, and HS512 algorithms for now. I've left comments to add the others, but someone with more rust foo might need be needed. For the identity providers I need these algorithms are more than sufficient.

:smiley:

view this post on Zulip Luke Boswell (Aug 31 2024 at 02:47):

Oh, actually.. I'll need to add a expect test script. I can do that later this evening.

view this post on Zulip Luke Boswell (Sep 01 2024 at 08:47):

basic-webserver #61 adds @Brendan Hansknecht's Sqlite improvements.

I haven't been able to reproduce any alias analysis errors... I merged latest main (after builtin Task) and fixed up the todos.roc example.

:smiley:

view this post on Zulip Agus Zubiaga (Sep 01 2024 at 22:40):

Threaded task module params fix: https://github.com/roc-lang/roc/pull/7048

view this post on Zulip Agus Zubiaga (Sep 01 2024 at 22:40):

For some reason, this wasn't a problem when passing other functions, but it's when I pass those that produce Task. It was probably just luck :smile:

view this post on Zulip Agus Zubiaga (Sep 02 2024 at 15:37):

Fix as patterns in closure arguments: https://github.com/roc-lang/roc/pull/7050

This is something that was tangentially fixed by the lower params PR, but the formatter would break it.

view this post on Zulip Luke Boswell (Sep 03 2024 at 08:58):

examples #204 -- adds an example for implementing a custom Inspect ability for an Opaque type.

It took me a while to find the syntax, so sharing for my future self and others.

MySecret := Str implements [
    Inspect { toInspector: mySecretInspector },
]

mySecretInspector : MySecret -> Inspector f where f implements InspectFormatter
mySecretInspector = \@MySecret _ -> Inspect.str "******* REDACTED *******"

expect Inspect.toStr (@MySecret "password1234") == "\"******* REDACTED *******\""

view this post on Zulip Elias Mulhall (Sep 03 2024 at 17:54):

Some fixes to my initial implementation of dbg expressions https://github.com/roc-lang/roc/pull/7054

view this post on Zulip Elias Mulhall (Sep 05 2024 at 15:22):

Ok, last part of dbg update is supporting dbg in pipelines https://github.com/roc-lang/roc/pull/7058

Thanks @Anton for the review on #7054 :heart:

view this post on Zulip Anton (Sep 06 2024 at 05:00):

Super cool, I think this will be awesome for roctober and advent of code :)

view this post on Zulip Anton (Sep 06 2024 at 05:09):

I've made a good first issue #7061 to update the tutorial debugging section to tell people about this :)

view this post on Zulip Jamin Eisenberg (Sep 06 2024 at 16:33):

#7040 implements --no-color and --no-header flags for roc repl

view this post on Zulip Stuart Hinson (Sep 20 2024 at 01:24):

https://github.com/roc-lang/roc/pull/7107 changes Dict.update to work with a Result

view this post on Zulip Agus Zubiaga (Sep 20 2024 at 19:41):

Fix for the first issue in #beginners > Compiler panic with module params: https://github.com/roc-lang/roc/pull/7109

view this post on Zulip Sam Mohr (Sep 20 2024 at 19:51):

Approved!

view this post on Zulip Sam Mohr (Sep 21 2024 at 11:13):

Update our record builder example to use the new syntax: https://github.com/roc-lang/examples/pull/209

view this post on Zulip Sam Mohr (Sep 21 2024 at 11:52):

Remove the unused old record builder syntax: https://github.com/roc-lang/roc/pull/7110

view this post on Zulip Ayaz Hafiz (Sep 21 2024 at 17:12):

https://github.com/roc-lang/roc/pull/6832 ready to merge

view this post on Zulip Luke Boswell (Sep 23 2024 at 08:01):

Aurélien Geron said:

Apparently it's currently not possible to use the try operator ? inside an expect statement, it crashes the compiler. I filed issue #7081. If anyone can take a look at it, I would really appreciate it, as it would make the Exercism test cases much easier to write and nicer to read. Thanks! :thank_you:

#7115 PR fixes this issue. We weren't desugaring  ValueDef::Expect nodes.

view this post on Zulip Luke Boswell (Sep 26 2024 at 07:41):

basic-cli #251 update dependencies and use the roc_std and roc_std_heap from roc-lang/roc

view this post on Zulip Luke Boswell (Sep 26 2024 at 22:30):

Luke Boswell said:

Aurélien Geron said:

Apparently it's currently not possible to use the try operator ? inside an expect statement, it crashes the compiler. I filed issue #7081. If anyone can take a look at it, I would really appreciate it, as it would make the Exercism test cases much easier to write and nicer to read. Thanks! :thank_you:

#7115 PR fixes this issue. We weren't desugaring  ValueDef::Expect nodes.

Bump -- can I get an review/approval on this please? it's a pretty small change, 90% of it is just adding a new test to cover this new usecase.

view this post on Zulip Sam Mohr (Sep 26 2024 at 22:31):

On it

view this post on Zulip Sam Mohr (Sep 26 2024 at 22:43):

@Luke Boswell the PR has been approved.

view this post on Zulip Luke Boswell (Sep 28 2024 at 23:45):

Luke Boswell said:

basic-cli #251 update dependencies and use the roc_std and roc_std_heap from roc-lang/roc

Updated this PR -- ready for another review/approval

view this post on Zulip Luke Boswell (Sep 29 2024 at 01:02):

#7128 fixes desugaring for top-level annotated expressions with a suffixed statement last.

@Sam Mohr can you please double check my logic on this one. I worked through this with some println debugging to resolve the issue, and everything seems to be passing now.

But I'm not super confident in my explanation for why it fixes it, so I would appreciate it if you could check my explanation is reasonable.

view this post on Zulip Luke Boswell (Sep 29 2024 at 18:48):

#7007 adds Str.dropPrefix and Str.dropSuffix builtins

view this post on Zulip Sam Mohr (Sep 29 2024 at 23:32):

@Luke Boswell I'll review in about 3 hours

view this post on Zulip Norbert Hajagos (Oct 07 2024 at 22:21):

Hi! Warming up for Roctober fest, so here is #7146 that extends Num.neg from I64 & U64 to all other sizes of integers. Can I have a review on it? Will gradually go for something bigger next time. Dec or float negation come to mind.

view this post on Zulip Brendan Hansknecht (Oct 08 2024 at 00:32):

#7147 is the PR from the work done on stream with some cleanup and testing

view this post on Zulip Sam Mohr (Oct 25 2024 at 12:00):

If anyone has time, please review the return keyword PR: https://github.com/roc-lang/roc/pull/7173

It already has a parser "LGTM" from the man himself, Joshua Warner, so just a skim over to make sure the canonicalization makes sense would be great. Feel free to merge if you're happy

view this post on Zulip Sam Mohr (Nov 03 2024 at 05:02):

The try desugar PR is ready for review: https://github.com/roc-lang/roc/pull/7193

Note, I specifically didn't add tests in cli_run.rs because:

view this post on Zulip Agus Zubiaga (Nov 05 2024 at 21:19):

Module params typechecker fix: https://github.com/roc-lang/roc/pull/7198

view this post on Zulip Agus Zubiaga (Nov 05 2024 at 22:16):

Fixes imports in expects: https://github.com/roc-lang/roc/pull/7199

view this post on Zulip Agus Zubiaga (Nov 06 2024 at 13:54):

Handle return syntax errors in reporting: https://github.com/roc-lang/roc/pull/7202

view this post on Zulip Agus Zubiaga (Nov 06 2024 at 13:56):

I was very confused to get an unhandled return syntax error in some old code. Turns out I was using "return" as a def name :upside_down:

view this post on Zulip Agus Zubiaga (Nov 06 2024 at 16:13):

This should help us remember to handle syntax errors in reporting: https://github.com/roc-lang/roc/pull/7203

view this post on Zulip Luke Boswell (Nov 07 2024 at 01:38):

https://github.com/roc-lang/basic-cli/pull/258 -- adds Locale.get and Locale.all to basic-cli so people can build applications that support l10n

view this post on Zulip Luke Boswell (Nov 08 2024 at 01:56):

https://github.com/roc-lang/basic-cli/pull/259 -- adds Stdin.readToEnd to basic-cli. This is helpful for reading larger inputs when piped to a roc app, such as I discovered when upgrading my 2020 solution here

view this post on Zulip Agus Zubiaga (Nov 09 2024 at 05:21):

Fix for the issue Jasper found: https://github.com/roc-lang/roc/pull/7206

view this post on Zulip Agus Zubiaga (Nov 10 2024 at 02:19):

Adds the initial set of effectful builtin helpers: https://github.com/roc-lang/roc/pull/7211

view this post on Zulip Isaac Van Doren (Nov 11 2024 at 01:07):

Renames List.split to List.splitAt and adds List.splitOn and List.splitOnList https://github.com/roc-lang/roc/pull/7213

view this post on Zulip John Konecny (Nov 14 2024 at 20:04):

These PR's were approved last week. No big deal if you're holding off on merging them. I just want to make sure they weren't forgotten about.

https://github.com/roc-lang/roc/pull/6967
https://github.com/roc-lang/roc/pull/7196

view this post on Zulip Luke Boswell (Nov 14 2024 at 20:10):

I was leaving them for you to merge... :sweat_smile:

view this post on Zulip Luke Boswell (Nov 14 2024 at 20:10):

Can you do that? Or maybe that's a permission thing?

view this post on Zulip John Konecny (Nov 15 2024 at 22:40):

@Luke Boswell
Yeah, I don’t think I have permission.

https://github.com/roc-lang/roc/pull/7196

This one is blocked because it looks like one of the tests failed randomly. I’m guessing it just needs a rerun.

view this post on Zulip Isaac Van Doren (Nov 16 2024 at 14:55):

Renames List.split to List.splitAt and adds List.splitOn and List.splitOnList https://github.com/roc-lang/roc/pull/7213

This PR is now updated to also rename Str.split to Str.splitOn so it’s ready for review again.

view this post on Zulip Sam Mohr (Nov 21 2024 at 12:21):

I've fixed the type constraining of early returns in type-annotated functions: https://github.com/roc-lang/roc/pull/7204

It's a short PR, but it'd probably be good to get a glance from someone familiar with the type checking code to make sure I didn't miss something.

view this post on Zulip Sam Mohr (Nov 21 2024 at 12:42):

Found a codegen issue because I again forgot to run tests locally with --no-default-features --features gen-dev

view this post on Zulip Sam Mohr (Nov 21 2024 at 12:42):

Please wait to review while I fix this

view this post on Zulip Agus Zubiaga (Nov 21 2024 at 16:53):

DM me when ready @Sam Mohr

view this post on Zulip Sam Mohr (Nov 21 2024 at 18:05):

Fixed and ready for review

view this post on Zulip shua (Nov 21 2024 at 18:07):

implement Num.neg for dec, f32, f64 in gen-dev (and for dec in gen-llvm) is ready for review: https://github.com/roc-lang/roc/pull/7235

view this post on Zulip Sam Mohr (Nov 21 2024 at 20:25):

Allow try/early return in pure statements: https://github.com/roc-lang/roc/pull/7238

view this post on Zulip Sam Mohr (Nov 21 2024 at 20:26):

Implemented by saying any statement with a return statement somewhere inside it doesn't need to be pure. We suggested we wanted to only allow {}-returning statements to work with this, but I supported other statements as well, requiring the value to be ignored. It seemed like the more intuitive approach.

view this post on Zulip shua (Nov 22 2024 at 23:31):

Not exactly for review, but can I get another CI run on https://github.com/roc-lang/roc/pull/7235 ? I've added some more logging to try to debug failures I can only seem to trigger in CI runs. Converted the PR to draft so I don't accidentally merge those changes.

view this post on Zulip Anthony Bullard (Nov 23 2024 at 02:40):

Didn’t realize this thread existed, cross posting

Hello!

As my first contribution to Roc, I am working on implementing snake_case for lowercase identifiers as discussed in #ideas > snake_case instead of camelCase . I don't have a TON of Rust experience, and obviously new to working on Roc, so I would like as many eyeballs as possible on the PR. Anyone that is familiar with the parsing and canonicalization phases of the compiler please take a look (Other Rustaceans feel free as well :smile: ).

view this post on Zulip shua (Nov 26 2024 at 18:20):

hopefully a tiny review: https://github.com/roc-lang/roc/pull/7247 add '.helix' editor config to gitignore

view this post on Zulip shua (Nov 26 2024 at 21:08):

rm unused dependencies from root Cargo.toml : https://github.com/roc-lang/roc/pull/7248

view this post on Zulip shua (Nov 26 2024 at 23:40):

another one for gen-dev https://github.com/roc-lang/roc/pull/7250 implement trivial isNaN,isFinite,isInfinite for Dec

view this post on Zulip Agus Zubiaga (Nov 27 2024 at 17:11):

Allow host-exposed suffixed pure functions: https://github.com/roc-lang/roc/pull/7254

view this post on Zulip shua (Nov 28 2024 at 23:09):

gen-dev https://github.com/roc-lang/roc/pull/7264 impl Saturated variants for u128/i128

May have also found a bug with Dec mulSaturated implementation (left a note in the PR)

view this post on Zulip Luke Boswell (Nov 29 2024 at 22:12):

#7265 updates cargo deps to consistently use workspace = true everywhere.

view this post on Zulip shua (Nov 30 2024 at 19:21):

NumPowInt should panic on overflow: https://github.com/roc-lang/roc/pull/7277

view this post on Zulip Luke Boswell (Dec 01 2024 at 02:00):

#7282 fallback to legacy linker if legacy host is available and --linker flag is not provided. NOT READY

view this post on Zulip Anthony Bullard (Dec 01 2024 at 02:32):

Add platform data when root is module and stop crashing on single file check

https://github.com/roc-lang/roc/pull/7283

view this post on Zulip Eli Dowling (Dec 01 2024 at 07:22):

PR fixing issues that luke found with purity inference and module params:

https://github.com/roc-lang/roc/pull/7285

view this post on Zulip Ryan Barth (Dec 01 2024 at 10:28):

Fix for errors caused by use of the changed Str.splitOn in the basic-cli Arg module
https://github.com/roc-lang/basic-cli/pull/275

I think this is going to break across different recent compiler versions.

view this post on Zulip Sam Mohr (Dec 01 2024 at 10:33):

@Ryan Barth we just moved to Str.splitOn in this PR from 2 weeks ago, it looks like you're trying to revert that and the CI is expectedly failing. Am I missing something?

view this post on Zulip Sam Mohr (Dec 01 2024 at 10:34):

PR fixing early return vars not generalizing, 6 line change plus a single test: https://github.com/roc-lang/roc/pull/7286

view this post on Zulip Ryan Barth (Dec 01 2024 at 10:34):

No, I just found this message. My mistake, I will close it.

view this post on Zulip jan kili (Dec 01 2024 at 17:21):

Update tutorial with recent syntax changes
https://github.com/roc-lang/roc/pull/7274

Especially the latest addition - syntax changes that we want AoC newcomers to ignore: https://github.com/roc-lang/roc/pull/7274/commits/13e3d5445169e9e7e8e88e0403bb1ae82246ec34
CC @Anton @Brendan Hansknecht @Eli Dowling @Luke Boswell @Sam Mohr

view this post on Zulip jan kili (Dec 01 2024 at 17:22):

(I'm very open to the PI section including more/better explanations - I'm noob)

view this post on Zulip Eli Dowling (Dec 01 2024 at 18:20):

Stops the language server from crashing all the damn time.
I finally figured out that the roc compiler was calling exit on the process instead of panicking. No wonder it crashes constantly!

https://github.com/roc-lang/roc/pull/7288

view this post on Zulip Eli Dowling (Dec 01 2024 at 19:44):

Keeping them coming!
Adds basic tag completion. Though without any info on what the type of the tag is:
https://github.com/roc-lang/roc/pull/7290

view this post on Zulip Dan G Knutson (Dec 01 2024 at 21:20):

Could I get a re-review on this RocBox dealloc platform helper?
https://github.com/roc-lang/roc/pull/7280

view this post on Zulip Anthony Bullard (Dec 04 2024 at 03:08):

Anthony Bullard said:

Add platform data when root is module and stop crashing on single file check

https://github.com/roc-lang/roc/pull/7283

I think I'll need another review on this since I force pushed

view this post on Zulip Sam Mohr (Dec 04 2024 at 10:36):

PR for a real try keyword with type checking and error reporting: https://github.com/roc-lang/roc/pull/7296

Even if we don't keep try around, this work should be easy to transfer to ? if we move back to that with static dispatch.

view this post on Zulip Anton (Dec 04 2024 at 15:32):

this work should be easy to transfer to ?

It would be good to prioritize this, people are regularly hitting sharp edges with ?

view this post on Zulip Sam Mohr (Dec 04 2024 at 18:50):

Yeah, I agree

view this post on Zulip Sam Mohr (Dec 04 2024 at 18:54):

The plan is to do that once this gets merged

view this post on Zulip Luke Boswell (Dec 04 2024 at 19:11):

And I think you've got some good comments from Ayaz to process still right?

view this post on Zulip Sam Mohr (Dec 04 2024 at 19:13):

Luke Boswell said:

And I think you've got some good comments from Ayaz to process still right?

The comment Ayaz just left is for a different PR, IMO. I asked him how to manage type-checking for statements with early returns in them, including try.

view this post on Zulip Sam Mohr (Dec 04 2024 at 19:15):

I probably should have asked through a different channel, but it seems like we tend to have good communication on GitHub comments haha

view this post on Zulip Sam Mohr (Dec 04 2024 at 19:15):

Anyway, I think this thing is ready to merge once someone double-checks my work

view this post on Zulip Sam Mohr (Dec 04 2024 at 19:15):

And I'll do the Ayaz stuff in a follow-up, after the ? PR

view this post on Zulip Luke Boswell (Dec 04 2024 at 19:19):

I'll have some time for roc later and can start looking at all the things people have been working on. :smiley:

view this post on Zulip shua (Dec 06 2024 at 21:10):

https://github.com/roc-lang/roc/pull/7314 impl add/sub/mul wrapped for u128/i128

view this post on Zulip Matthew Heath (Dec 06 2024 at 21:44):

Could I please have reviews on these 2 PRs:
https://github.com/roc-lang/roc/pull/7312 - Has the test allocator align it's allocation at 16 bytes (and panic if asked for more)
https://github.com/roc-lang/roc/pull/6977 - Adds SHA-256 cryptographic hashing as a builtin module.

view this post on Zulip Luke Boswell (Dec 07 2024 at 09:57):

@shua -- I'm just wondering if we should add and consolidate the tests a little for the related in gen_num, I'm not sure when we'd ever circle back to do that otherwise.

@Matthew Heath

Run for branch_dir in source_branch_dir target_branch_dir; do
Calculating violations in &branch_dir...
Calculating violations in &branch_dir...
You added panic/unwrap/expect, in this PR their count increased from 1429 to 1430.
These calls can kill the REPL, try alternative error handling.

view this post on Zulip shua (Dec 07 2024 at 19:53):

@Luke Boswell made similar tests for *_wrap as existed for *_saturated. I also added the u128/i128 cases that were missing from the saturated test cases.

view this post on Zulip Matthew Heath (Dec 08 2024 at 16:43):

Luke Boswell said:

Matthew Heath

Run for branch_dir in source_branch_dir target_branch_dir; do
Calculating violations in &branch_dir...
Calculating violations in &branch_dir...
You added panic/unwrap/expect, in this PR their count increased from 1429 to 1430.
These calls can kill the REPL, try alternative error handling.

I have exactly one idea of what that could be and how to deal with it-
I will try that now.

view this post on Zulip shua (Dec 09 2024 at 19:18):

https://github.com/roc-lang/roc/pull/7321 make Str.fromUtf8 error a little more self-descriptive

view this post on Zulip Brendan Hansknecht (Dec 10 2024 at 16:55):

super tiny pr, fix for roc --optimize day09.roc: https://github.com/roc-lang/roc/pull/7326

view this post on Zulip Eli Dowling (Dec 11 2024 at 16:46):

https://github.com/roc-lang/roc/pull/7335
Makes the language server display parsing errors at the correct location.
Feel free to merge if it passes CI, I'm going to sleep :)
@Anton @Luke Boswell

view this post on Zulip Anton (Dec 11 2024 at 16:48):

Thanks @Eli Dowling, I'll check it out, good night :)

view this post on Zulip Luke Boswell (Dec 11 2024 at 22:49):

basic-cli #283 cleans up a number of things;

view this post on Zulip Brendan Hansknecht (Dec 11 2024 at 23:35):

#7338 - dbg and expect improvements

view this post on Zulip Luke Boswell (Dec 12 2024 at 00:19):

Do dbg and expectremain in with roc build --no-link and roc build --optimize --no-link?

@Brendan Hansknecht this is amazing, will be a nice improvement for the embedded use-case, something I've been needing for roc-ray, roc-wasm4, and js-dom etc.

view this post on Zulip Brendan Hansknecht (Dec 12 2024 at 00:21):

Do dbg and expectremain in with roc build --no-link and roc build --optimize --no-link?

Didn't explicitly test, but they should

view this post on Zulip Brendan Hansknecht (Dec 12 2024 at 00:23):

Yes they do

view this post on Zulip jan kili (Dec 13 2024 at 19:21):

Luke Boswell said:

JanCVanB said:

Btw roc glue seems to be working well so far - now debugging why const _SIZE_CHECK_union_Timing: () = assert!(core::mem::size_of::<union_Timing>() == 4); is erroring.

This is a known issue. The generated code is just wrong. See https://github.com/roc-lang/roc/issues/6012

https://github.com/roc-lang/roc/pull/7352
Comment out failing glue assertion for now

view this post on Zulip Luke Boswell (Dec 14 2024 at 05:29):

basic-cli #287 - refactor rust fx impl out into reusable crates.

With this change, I think we're ready to take all the nice things we've added to basic-cli and port them across to basic-webserver. This should make it very easy to do and now we can have one place where these functions are implemented.

view this post on Zulip Brendan Hansknecht (Dec 14 2024 at 05:57):

Awesome!

view this post on Zulip Luke Boswell (Dec 16 2024 at 02:54):

basic-cli #288 refactor to use danger_noodle_case for all the things, and also use a common roc_http crate which should be ready for basic-webserver to also use the same types.

view this post on Zulip Luke Boswell (Dec 16 2024 at 08:06):

I decided to cleanup the Command glue... so this isn't quite ready for review

view this post on Zulip Luke Boswell (Dec 16 2024 at 08:06):

I can continue polishing it tomorrow.

view this post on Zulip Luke Boswell (Dec 16 2024 at 09:15):

Ok, fixed it. This PR is ready for review.

view this post on Zulip Luke Boswell (Dec 19 2024 at 03:50):

basic-webserver #84 -- upgrade to Purity Inference, danger_noodle_case, use crates from basic-cli & remove a lot of duplication, remove reqwest dependency.

view this post on Zulip Luke Boswell (Dec 20 2024 at 04:02):

basic-cli #293 upgrades the API to main! : List Arg => Result {} [Exit I32 Str]_ by adding a new Arg type and related rust implementation.

view this post on Zulip Luke Boswell (Dec 20 2024 at 04:40):

basic-cli #294
basic-cli #86

Two small PRs which rename Err to IOErr to avoid confusion with Result as requested in a PR comment.

view this post on Zulip Luke Boswell (Dec 20 2024 at 06:27):

examples #223 upgrades all the examples to Purity Inference, and the latest API for basic-cli and basic-webserver.

Currently using local builds of these platforms, but all tests are :check: for me.

Should be gtg as soon as we have pre-releases of the platforms ready to swap in.**

** I didn't do a sanity pass over the actual README and documentation... just got everything back to working and made some updates as I went.

view this post on Zulip Anthony Bullard (Dec 21 2024 at 15:04):

https://github.com/roc-lang/roc/pull/7398 a number of minor updates to the docs to help with usability, accessibility, and design. See #contributing > New docs template for more details

view this post on Zulip Anthony Bullard (Dec 22 2024 at 15:49):

https://github.com/roc-lang/roc/pull/7402 fixes #7339 to make sure the --migrate flag of roc format works correctly for record type annotation field names. Should note that it adds a new class of files in test_snapshots. I think it's important to have a good view on the output of format with the migrate flag on.

view this post on Zulip Anthony Bullard (Dec 23 2024 at 13:03):

Looking for some eyes on this draft: https://github.com/roc-lang/roc/pull/7406 for ?? operator

view this post on Zulip Anthony Bullard (Dec 25 2024 at 00:31):

Fixed packages depending on another package to hang forever: https://github.com/roc-lang/roc/pull/7412

view this post on Zulip Anthony Bullard (Dec 27 2024 at 15:08):

Anthony Bullard said:

https://github.com/roc-lang/roc/pull/7402 fixes #7339 to make sure the --migrate flag of roc format works correctly for record type annotation field names. Should note that it adds a new class of files in test_snapshots. I think it's important to have a good view on the output of format with the migrate flag on.

Anthony Bullard said:

Looking for some eyes on this draft: https://github.com/roc-lang/roc/pull/7406 for ?? operator

Shout at me if this breaks decorum, but I got some Zulip reactions on these PRs, but no feedback/approvals on the PRs themselves and they've been sitting around since before Christmas. So I'm reposting for some visibility (and one of them is blocking moving forward on other error handling improvements).

view this post on Zulip Richard Feldman (Dec 27 2024 at 15:12):

I would approve on GH but I'm on mobile :big_smile:

view this post on Zulip Sam Mohr (Dec 27 2024 at 15:15):

I'll do it

view this post on Zulip Anthony Bullard (Dec 27 2024 at 15:19):

Sam is my personal hero

view this post on Zulip Anthony Bullard (Dec 27 2024 at 15:20):

The 7402 PR is intimidating - and might require more thought - so don't rush it. I added snapshots for formatting after migration

view this post on Zulip Sam Mohr (Dec 27 2024 at 15:21):

I also don't personally have override power for the "panic check" CI check

view this post on Zulip Ian McLerran (Dec 27 2024 at 17:24):

#7418 - Fix for #7417, which is incorrect links being generated for docs pages containing submodules.

view this post on Zulip Sam Mohr (Dec 27 2024 at 17:32):

@Ian McLerran you've got clippy issues: https://github.com/roc-lang/roc/actions/runs/12518839708/job/34922040995?pr=7418

view this post on Zulip Ian McLerran (Dec 27 2024 at 17:37):

Should be good now

view this post on Zulip Ian McLerran (Dec 27 2024 at 17:55):

For some reason markdown-link-check got cancelled

view this post on Zulip Sam Mohr (Dec 27 2024 at 17:59):

I'll retry it when the option becomes available

view this post on Zulip shua (Dec 28 2024 at 03:49):

https://github.com/roc-lang/roc/pull/7419 fix '1e2' panic in repl

view this post on Zulip Anthony Bullard (Dec 28 2024 at 12:58):

https://github.com/roc-lang/roc/pull/7421: Parens and Commas syntax support

view this post on Zulip Brendan Hansknecht (Dec 28 2024 at 19:32):

Super minor pull request. Just reduces verbosity of llvm passes: https://github.com/roc-lang/roc/pull/7423

view this post on Zulip Brendan Hansknecht (Dec 28 2024 at 22:45):

Another small pr. Avoids roc_std writing to read only refcounts, which can lead to segfaults.

https://github.com/roc-lang/roc/pull/7427

view this post on Zulip Brendan Hansknecht (Dec 28 2024 at 22:50):

And finally, the larger PR (though essentially 100% code that was already reviewed in basic-webserver), add sqlite to basic-cli as a crate that can later be used by basic-webserver as well: https://github.com/roc-lang/basic-cli/pull/299

view this post on Zulip Ayaz Hafiz (Dec 30 2024 at 18:40):

https://github.com/roc-lang/roc/pull/7437 docs issue

view this post on Zulip Ian McLerran (Dec 30 2024 at 20:08):

#7439 - Add List.walk!

view this post on Zulip Jakub Konka (Dec 30 2024 at 23:36):

#7441 - linker/macho: successfully emit a broken executable

view this post on Zulip Jakub Konka (Dec 31 2024 at 10:59):

Jakub Konka said:

#7441 - linker/macho: successfully emit a broken executable

Fixed the tests (all pass locally) so ready for re-approve whenever possible. Thanks!

view this post on Zulip Jakub Konka (Dec 31 2024 at 16:23):

#7443 - Bump object dependency to latest (0.36.7)
Nothing major, as in the title, bumps object dep to latest and updates API usage.

view this post on Zulip Brendan Hansknecht (Jan 01 2025 at 02:12):

Makes our refcounting better when set to atomic mode. Uses highest bit of the refcount to check if the variable is threadlocal. Threadlocal variables fall back on a fast path. This makes "atomic" refcounting with a single threaded app run within a few percent of nonatomic refcounting.

The change is completely behind a constant and does not change any current roc code.
#7444

view this post on Zulip Brendan Hansknecht (Jan 01 2025 at 19:04):

#7448 -> Make refcounting from 1 to max_size. 0 is still constant refcount. the first bit is reserved to indicate if atomic refcounting is required. Would be great if someone could take a more detailed look at this to make sure I didn't mess anything up. Luckily, we have the gen_refcount tests which make me at least medium confident (also the valgrind tests).

Also, not sure when this is bested to land. Will require updating platforms.

view this post on Zulip Brendan Hansknecht (Jan 01 2025 at 21:09):

#7449 -> Minor capacity cleanup for #platform development > Should lists always have a minimum capacity of 64?

view this post on Zulip Sam Mohr (Jan 02 2025 at 01:49):

Remove backpassing: https://github.com/roc-lang/roc/pull/7452

view this post on Zulip Brendan Hansknecht (Jan 02 2025 at 02:49):

#7448 now leads to a small perf improvement too. (tinkered with exact refcounting in zig for some minor extra perf)

view this post on Zulip Sam Mohr (Jan 02 2025 at 02:56):

Remove roc-for-elm-programmers.md: https://github.com/roc-lang/roc/pull/7453

view this post on Zulip Ayaz Hafiz (Jan 02 2025 at 05:16):

https://github.com/roc-lang/roc/pull/7450 simplifications to the typechecker ahead of a change to detect invalid annotations of generalized types like x : *. Hasn't passed CI yet but the relevant tests (reporting, solve, etc) have locally

view this post on Zulip Brendan Hansknecht (Jan 02 2025 at 18:52):

https://github.com/roc-lang/basic-webserver/pull/89 -> Add improved sqlite to basic-webserver again now that we know how to release it with musl

PR is essentially identical to the old version but dependent on basic-cli for the sqlite implementation. Also updated for purity inference.

view this post on Zulip Jakub Konka (Jan 02 2025 at 21:53):

7455 there are no compressed sections in Mach-O so they can be safely ignored

view this post on Zulip Jakub Konka (Jan 02 2025 at 22:36):

7457 easy PR that uses correct page size values depending on the target's CPU architecture for Mach-O for (segment) alignment

view this post on Zulip Richard Feldman (Jan 02 2025 at 22:38):

omg I am so, so hype about this macho surgical linking progress!!! :heart_eyes::heart_eyes::heart_eyes:

view this post on Zulip Brendan Hansknecht (Jan 02 2025 at 23:10):

Removes references to Task in:

view this post on Zulip Sam Mohr (Jan 02 2025 at 23:17):

Approved with one comment

view this post on Zulip Jakub Konka (Jan 03 2025 at 20:34):

Jakub Konka said:

7457 easy PR that uses correct page size values depending on the target's CPU architecture for Mach-O for (segment) alignment

Can I ask for a re-review @Brendan Hansknecht ? I've removed now-redundant comment as suggested.

view this post on Zulip Brendan Hansknecht (Jan 03 2025 at 20:56):

I'm on mobile and will be away for a while if anyone else could give it the thumbs up, that would be great. LGTM.

view this post on Zulip Anthony Bullard (Jan 03 2025 at 20:57):

I can approve

view this post on Zulip Anthony Bullard (Jan 03 2025 at 20:58):

Done and merged @Jakub Konka

view this post on Zulip Jakub Konka (Jan 03 2025 at 23:06):

Jakub Konka said:

7455 there are no compressed sections in Mach-O so they can be safely ignored

I feel embarrassed to ask but can I ask for another re-run of (now a smaller set of) failing tests? :folded_hands:

view this post on Zulip Sam Mohr (Jan 03 2025 at 23:13):

Done

view this post on Zulip Richard Feldman (Jan 03 2025 at 23:34):

just added you as a collaborator, so you shouldn't need permission to run tests anymore

view this post on Zulip Anthony Bullard (Jan 04 2025 at 02:44):

A Redo of my PR to fix some issues with snake_cake migration: https://github.com/roc-lang/roc/pull/7460

view this post on Zulip Jakub Konka (Jan 04 2025 at 19:18):

Richard Feldman said:

just added you as a collaborator, so you shouldn't need permission to run tests anymore

OK, I have restarted nix-apple-silicon test several times and it's timing out at different steps. Locally there are no problems and nix develop -c cargo test --locked --release -- --skip cli_tests::inspect_gui --skip cli_tests::hello_gui pass without a hitch. I'm kinda out of ideas what to do next, and would welcome advice how to proceed next.

view this post on Zulip Anton (Jan 04 2025 at 19:26):

Can you post some logs for where it gets stuck?

view this post on Zulip Jakub Konka (Jan 04 2025 at 19:36):

Will do if it gets stuck again. For now I rebased on latest main and signed the commit. Fingers crossed!

view this post on Zulip Jakub Konka (Jan 04 2025 at 20:13):

Progress! All passed except fuzz tests which the CI says are OK to fail. Can I ask for a force-merge? :pray:

view this post on Zulip Jakub Konka (Jan 04 2025 at 20:15):

Thanks @Luke Boswell !

view this post on Zulip Anthony Bullard (Jan 04 2025 at 20:29):

https://github.com/roc-lang/roc/pull/7467 <- Support for ?? for optional record fields and a small fix for the fuzzer from the PNC change

view this post on Zulip Luke Boswell (Jan 07 2025 at 22:26):

basic-cli #305 -- paired breaking change for #7463 upgrades the builtins to snake_case

view this post on Zulip Luke Boswell (Jan 07 2025 at 23:03):

basic-ssg #13 -- paired breaking change for #7463 upgrades the builtins to snake_case

view this post on Zulip Luke Boswell (Jan 07 2025 at 23:04):

Testing pre-release for basic-ssg

view this post on Zulip Luke Boswell (Jan 08 2025 at 00:02):

Testing pre-release for roc-json

view this post on Zulip Luke Boswell (Jan 08 2025 at 02:47):

#7481 as discussed in #ideas > Add flag to roc docs for subfolder @ 💬 -- this PR adds a new cli flag --root-dir that can be used to add a prefix for all URL links in the static generated-docs.

view this post on Zulip Luke Boswell (Jan 08 2025 at 03:21):

basic-cli #307 -- this adds the documentation for 0.17.0 and 0.18.0 versions of basic-cli to a static site in the repository, and adds a new CI workflow to deploy the site on PR.

If we include this in basic-cli and host on GH pages (similar to basic-websever and other packages) then we don't need to rebuild in CI with the roc website, and this simplifies the management of breaking changes between roc and basic-cli.

view this post on Zulip Luke Boswell (Jan 08 2025 at 06:58):

#7482 -- give some love to our Tutorial and the Plans page.

Only includes changes for the tutorial that are currently active in the latest releases. Will make our life easier for updating with the next batch of breaking changes.

view this post on Zulip Luke Boswell (Jan 08 2025 at 09:23):

#7401 -- cleanup of the examples/ folder -- finally.

view this post on Zulip Luke Boswell (Jan 08 2025 at 22:33):

Luke Boswell said:

#7482 -- give some love to our Tutorial and the Plans page.

Only includes changes for the tutorial that are currently active in the latest releases. Will make our life easier for updating with the next batch of breaking changes.

Update and addressed all review comments. Thank you @kukimik

Request another review/approval please.

view this post on Zulip Luke Boswell (Jan 09 2025 at 00:29):

basic-webserver #93 -- paired breaking change for upgrade the builtins to snake_case and initial PNC calling convention

view this post on Zulip Luke Boswell (Jan 09 2025 at 00:57):

Luke Boswell said:

basic-cli #305 -- paired breaking change for #7463 upgrades the builtins to snake_case

Updated with PNC now, all tests passing locally. :smiley:

view this post on Zulip Luke Boswell (Jan 09 2025 at 00:59):

I'll see if I can kick-off a testing build for basic-cli

view this post on Zulip Sam Mohr (Jan 09 2025 at 01:05):

Remove Task: https://github.com/roc-lang/roc/pull/7487/files

view this post on Zulip Anthony Bullard (Jan 09 2025 at 14:47):

Align PNC Apply Patterns with Expr: https://github.com/roc-lang/roc/pull/7490. @Sam Mohr this doesn't fix the thing you are mad about yet. But it is important to further align Patterns and Exprs for formatting purposes to fix things in a uniform manner.

view this post on Zulip Ian McLerran (Jan 09 2025 at 20:15):

Add List.walk_try! as per #ideas > List.walkTry!: #7491

view this post on Zulip Norbert Hajagos (Jan 10 2025 at 15:28):

Str.with_ascii_lowercased builtin #7496 is ready for review! The other similar functions will come after I'm confident about said concerns about refcounting. Is there some info of how one should think about changing the refcounts in a builtin function?

view this post on Zulip Sam Mohr (Jan 10 2025 at 18:21):

Move to new interpolation syntax: https://github.com/roc-lang/roc/pull/7497

view this post on Zulip Jakub Konka (Jan 10 2025 at 21:42):

7499 linker/macho: redo bits of preprocessing host

view this post on Zulip Norbert Hajagos (Jan 11 2025 at 08:25):

Can I get a CI re-run for #7496? Fixed what I had info on, appli-silicon just timed out, so I hope it had the same problem as the others.

view this post on Zulip shua (Jan 11 2025 at 23:39):

https://github.com/roc-lang/roc/pull/7503 fix a lil bug :bug: with Num.shift_right_by

view this post on Zulip Jakub Konka (Jan 12 2025 at 21:59):

Jakub Konka said:

7499 linker/macho: redo bits of preprocessing host

@Brendan Hansknecht could I ask you for a review please? Whenever you have the time of course - just putting it on your radar. If anyone else is happy to do a review too then by all means please!

view this post on Zulip Brendan Hansknecht (Jan 12 2025 at 22:53):

Yeah, was travelling and just got back..should have time to review tonight or tomorrow.

view this post on Zulip Ian McLerran (Jan 13 2025 at 18:13):

#7507 - Just a little fix for a grammatical error in an error message that has been driving me nuts for months! :sweat_smile:

view this post on Zulip shua (Jan 14 2025 at 20:12):

https://github.com/roc-lang/roc/pull/7514 utf16/32 decoding with lossy variants

view this post on Zulip jan kili (Jan 14 2025 at 20:49):

https://github.com/roc-lang/roc/pull/7513 - Add context and formatting to tutorial warning banner
(see #compiler development > breaking changes @ 💬 )

view this post on Zulip shua (Jan 14 2025 at 21:52):

shua said:

https://github.com/roc-lang/roc/pull/7514 utf16/32 decoding with lossy variants

could I get another CI run on this? :clockwise:

view this post on Zulip Anthony Bullard (Jan 15 2025 at 11:59):

https://github.com/roc-lang/roc/pull/7518 New Lambda Syntax, i.e. |x, y| x

view this post on Zulip Anthony Bullard (Jan 15 2025 at 21:21):

Of course the day I post this PR is the day that Zulip is :cricket: :cricket: :cricket: .

view this post on Zulip Anthony Bullard (Jan 15 2025 at 22:06):

I finished the formatting piece...should I just push it to the above PR?

view this post on Zulip Luke Boswell (Jan 15 2025 at 22:07):

Or maybe separate...

view this post on Zulip Luke Boswell (Jan 15 2025 at 22:08):

Just noticed that ^^ is a very small PR and has passed CI already

view this post on Zulip Luke Boswell (Jan 15 2025 at 22:08):

So rather than restart we could just merge it

view this post on Zulip Anthony Bullard (Jan 15 2025 at 22:08):

It's up to you

view this post on Zulip Anthony Bullard (Jan 15 2025 at 22:09):

I just hope Joshua doesn't slap my hand later :tears:

view this post on Zulip Luke Boswell (Jan 15 2025 at 22:09):

hahaha

view this post on Zulip Luke Boswell (Jan 15 2025 at 22:09):

I'm sure he'll forgive us

view this post on Zulip Anthony Bullard (Jan 15 2025 at 22:09):

:wink: Love you Josh!

view this post on Zulip Anthony Bullard (Jan 15 2025 at 22:16):

https://github.com/roc-lang/roc/pull/7520 <-- Format ALL lambdas to new syntax

view this post on Zulip Ian McLerran (Jan 16 2025 at 01:56):

#7521 - Result.map -> Result.map_ok

view this post on Zulip Ian McLerran (Jan 16 2025 at 03:41):

Fixed the tests I missed - cargo test passes 100% locally now.

view this post on Zulip Sam Mohr (Jan 16 2025 at 10:45):

Implement the ? binop operator: https://github.com/roc-lang/roc/pull/7523

view this post on Zulip Jakub Konka (Jan 17 2025 at 19:02):

7524 - macho refactor and better error message when not enough preallocated space in the host for the surgical linker - can I ask someone for a review? There's no new linker functionality, mainly just shuffling things around a little.

view this post on Zulip Norbert Hajagos (Jan 17 2025 at 21:39):

I fixed the code and ran the tests and benchmarks locally for #7496, so the next CI run shouldn't fail, like before. Can I get a rerun?

view this post on Zulip Norbert Hajagos (Jan 17 2025 at 22:43):

For the above PR, only Apple-silicon test failing (locally passed that test, even with rebasing main into the feature branch) with "Mono output has changed!" (yes, I am indeed changing builtins), but running cargo test -p test_mono -p uitest --no-fail-fast (as the logs instruct me) doesn't change anything in the repo I could commit. Using nixos with the flake. Any suggestion? Going to bed, but will check tomorrow.

view this post on Zulip Brendan Hansknecht (Jan 17 2025 at 23:43):

Could try double checking if --release makes a difference. It shouldn't but it has in the past

view this post on Zulip Sam Mohr (Jan 18 2025 at 03:17):

Implement and and or on top of && and ||: https://github.com/roc-lang/roc/pull/7528

view this post on Zulip Anthony Bullard (Jan 18 2025 at 03:23):

Sam Mohr said:

Implement and and or on top of && and ||: https://github.com/roc-lang/roc/pull/7528

I can review in the morning

view this post on Zulip Sam Mohr (Jan 18 2025 at 03:24):

I can fork it to work on the zero-arg change for now, no worries

view this post on Zulip Norbert Hajagos (Jan 18 2025 at 08:07):

Brendan Hansknecht said:

Could try double checking if --release makes a difference. It shouldn't but it has in the past

Thanks, but no difference with --release sadly. As a last resort, I could modify the generated text by hand (I understand this isn't ideal). The only diff shown is ID-s having a +2 increase in a /crates/compiler/test_mono/generated/inspect_derived_dict.txt. Otherwise I'm blocked on this.

view this post on Zulip Anton (Jan 18 2025 at 10:18):

I left a commen on the PR @Norbert Hajagos

view this post on Zulip Anthony Bullard (Jan 18 2025 at 11:50):

Sam Mohr said:

Implement and and or on top of && and ||: https://github.com/roc-lang/roc/pull/7528

Approved, but I did leave a comment requesting a specific formatting test

view this post on Zulip Sam Mohr (Jan 18 2025 at 11:51):

Okay, I'll fix that in the next PR, thanks!

view this post on Zulip Sam Mohr (Jan 19 2025 at 15:30):

First PR for canonicalization split: https://github.com/roc-lang/roc/pull/7533

I followed @Joshua Warner 's advice and started by moving desugaring only into the new roc_can_solo crate. Please don't feel pressured to put too much effort into reviewing this PR, it and its successors are intermediate changes and won't look right until the whole thing comes together.

As an aside, this might lead to some merge conflicts based on a few PRs touching desugaring from Josh, I'm happy to wait for those to merge and to handle merge conflicts on my end, since I'd just be copying whatever is in desugar.rs from the main branch, more or less.

view this post on Zulip shua (Jan 22 2025 at 21:57):

https://github.com/roc-lang/roc/pull/7541 merge wasm_str tests into gen_str

view this post on Zulip Norbert Hajagos (Jan 23 2025 at 14:45):

https://github.com/roc-lang/roc/pull/7543 add with_ascii_uppercased and caseless_ascii_equals to Str
Fresh from the press!

view this post on Zulip Luke Boswell (Jan 24 2025 at 04:41):

basic-webserver #93 -- the big breaking change PR... again

Thank you to @Sam Mohr , @Ian McLerran , @Anton for the collective effort on this one. :smiley:

view this post on Zulip Anton (Jan 25 2025 at 16:04):

Exercsim full update to current Roc: https://github.com/exercism/roc/pull/171
.meta/Example.roc files do not need a thorough check, they're mainly there to encure that all tests work

view this post on Zulip Isaac Van Doren (Jan 25 2025 at 16:40):

Awesome! I should be able to take a look later today

view this post on Zulip Sam Mohr (Jan 27 2025 at 02:11):

Shorten the hosted module header: https://github.com/roc-lang/roc/pull/7553

view this post on Zulip Ian McLerran (Jan 27 2025 at 15:57):

basic-cli#319 Fix for invalid use of ? in Path.roc

view this post on Zulip Ian McLerran (Jan 27 2025 at 16:05):

CI is failing on #7530

view this post on Zulip Anthony Bullard (Jan 29 2025 at 03:01):

Fix try suffix after apply func formatting: https://github.com/roc-lang/roc/pull/7557

view this post on Zulip jan kili (Jan 30 2025 at 14:00):

Snekking some sneaky non-sneks
https://github.com/roc-lang/basic-cli/pull/320
https://github.com/roc-lang/basic-cli/pull/321
https://github.com/roc-lang/basic-cli/pull/322
https://github.com/roc-lang/basic-cli/pull/323
https://github.com/roc-lang/basic-cli/pull/324

view this post on Zulip jan kili (Jan 30 2025 at 15:07):

Snekking some sneaky non-sneks
https://github.com/roc-lang/roc/pull/7561
https://github.com/roc-lang/roc/pull/7562

view this post on Zulip Sam Mohr (Feb 10 2025 at 01:48):

https://github.com/roc-lang/roc/pull/7598 (6 files)

view this post on Zulip Brendan Hansknecht (Feb 11 2025 at 02:44):

Minor build.zig cleanup for fuzzing and optional deps: https://github.com/roc-lang/roc/pull/7601

view this post on Zulip Luke Boswell (Feb 11 2025 at 02:45):

What's the idea of only fuzzing on Linux?

view this post on Zulip Luke Boswell (Feb 11 2025 at 02:46):

I thought you had it working on your mac

view this post on Zulip Luke Boswell (Feb 11 2025 at 02:46):

Wait... it's target.result.os.tag != .windows nvm

view this post on Zulip Brendan Hansknecht (Feb 11 2025 at 02:57):

Yeah, only unix

view this post on Zulip Brendan Hansknecht (Feb 11 2025 at 02:57):

so mac, linux, bsd, etc

view this post on Zulip Anthony Bullard (Feb 11 2025 at 23:19):

Hoping for more eyes on https://github.com/roc-lang/roc/pull/7597 so we can get that landed and start iterating

view this post on Zulip Anthony Bullard (Feb 11 2025 at 23:19):

Hoping I have the brain power to get the conflicts resolved tonight, but this flu is kicking my butt

view this post on Zulip Luke Boswell (Feb 11 2025 at 23:39):

Sing out if you want any help

view this post on Zulip Jared Ramirez (Feb 12 2025 at 01:07):

Adding most zig files to test.zig and resolving resulting compile errors: https://github.com/roc-lang/roc/pull/7604

view this post on Zulip Sam Mohr (Feb 14 2025 at 10:46):

Cleaning most of our remaining compilation errors in the Zig code, implemented the basics of scope tracking for canonicalization of idents and aliases: https://github.com/roc-lang/roc/pull/7605

view this post on Zulip Sam Mohr (Feb 14 2025 at 10:46):

I left it in draft mode because I didn't add unit tests yet, I'll try to do that in the next couple of days

view this post on Zulip Sam Mohr (Feb 14 2025 at 11:01):

Also please ignore the Parse IR changes, I'll revert those, they were temporary for testing

view this post on Zulip Isaac Van Doren (Feb 14 2025 at 19:21):

Quick PR to fix our implementation of the FNV hash function https://github.com/roc-lang/roc/pull/7606

view this post on Zulip Sam Mohr (Feb 14 2025 at 19:23):

If they have an impl, can we just use theirs?

view this post on Zulip Isaac Van Doren (Feb 14 2025 at 19:24):

Our implementations are basically the same, theirs just supports using different sizes of integers. I would leave it as it is now unless we need more for some reason

view this post on Zulip Brendan Hansknecht (Feb 14 2025 at 22:05):

https://github.com/roc-lang/roc/pull/7607

Initial fuzzing of tokenizer with a few minor bug fixes.

view this post on Zulip Brendan Hansknecht (Feb 15 2025 at 04:48):

https://github.com/roc-lang/roc/pull/7610

Add a check step to use with zls along with check-fmt for ci.
Also, check step is nice in general cause you learn of compiler errors super quick and don't have to worry about it running llvm.

view this post on Zulip Anthony Bullard (Feb 16 2025 at 12:21):

https://github.com/roc-lang/roc/pull/7614 <-- Parser support for braces syntax and string interpolation (ZIG)

view this post on Zulip Joshua Warner (Feb 16 2025 at 18:09):

Unbreaking main: https://github.com/roc-lang/roc/pull/7617

view this post on Zulip Joshua Warner (Feb 18 2025 at 04:33):

Fixing some tokenizer bugs: https://github.com/roc-lang/roc/pull/7620
(previously approved, but needs re-approval after implementing feedback)

view this post on Zulip Norbert Hajagos (Feb 18 2025 at 20:45):

#7621 Byte-size change to the string store to use 1 buffer for lengths + content.

view this post on Zulip Anthony Bullard (Feb 20 2025 at 14:19):

#7626 [zig] Parsing match expression and more patterns

view this post on Zulip Anthony Bullard (Feb 23 2025 at 22:39):

#7633 Type Annotation and Declaration parsing and formatting

view this post on Zulip Anthony Bullard (Feb 24 2025 at 15:35):

^ This needs a reapproval after I rebased. Auto-merge is enabled

view this post on Zulip Brendan Hansknecht (Feb 25 2025 at 00:43):

This PR is a bit more likely to hit merge conflicts, so it would be great to get a quicker review if possible
#7637

  1. Switches a lot of things over to use gpa instead of arenas. This is important for growing data structures like arraylists to avoid consuming tons of extra memory.
  2. Cleans up the small string interner using some zig builtins and making it simpler overall.

cc: @Sam Mohr cause we already talked about this some.

view this post on Zulip Anthony Bullard (Feb 25 2025 at 12:11):

#7638 Parsing Records and Tuples

view this post on Zulip Anthony Bullard (Feb 27 2025 at 03:13):

Anthony Bullard said:

#7638 Parsing Records and Tuples

This also includes BinOps and Expect, Crash, and Return statements and Static Dispatch-style dot access.

view this post on Zulip Anthony Bullard (Feb 27 2025 at 03:14):

And probably should be reviewed and/or merged soon

view this post on Zulip Luke Boswell (Feb 27 2025 at 03:14):

Nice work :heart_eyes:

view this post on Zulip Isaac Van Doren (Feb 28 2025 at 17:10):

#7643 Format a single file via the CLI

view this post on Zulip Anthony Bullard (Feb 28 2025 at 22:03):

Isaac Van Doren said:

#7643 Format a single file via the CLI

Left a few comments

view this post on Zulip Sam Mohr (Feb 28 2025 at 22:03):

The first bumped PR was already merged

view this post on Zulip Sam Mohr (Feb 28 2025 at 22:03):

Are you talking about https://github.com/roc-lang/roc/pull/7642

view this post on Zulip Anthony Bullard (Feb 28 2025 at 22:05):

Oh sorry, I actually didn't post the right PR :rofl:

#7642: Remove * from types and add ... expression

view this post on Zulip Sam Mohr (Feb 28 2025 at 22:07):

Approved with one comment, but I'll have to re-approve after you fix the merge conflict

view this post on Zulip Brendan Hansknecht (Mar 01 2025 at 01:41):

Minor extra cleanups for the SmallStringInterner inspired by #off topic > Talk: "Programming without Pointers"
https://github.com/roc-lang/roc/pull/7645

view this post on Zulip Luke Boswell (Mar 01 2025 at 06:37):

Can I get another review on https://github.com/roc-lang/roc/pull/7644

Resolved some of the review comments. Added new features, including a FORMATTED section.

17:36:11 ~/Documents/GitHub/roc initial-snapshot $ zig build snapshot
info: processed 2 snapshots in 5 ms.
17:37:20 ~/Documents/GitHub/roc initial-snapshot $ zig build snapshot -- --verbose
info: /Users/luke/Documents/GitHub/roc/src/snapshots/001.txt
info: /Users/luke/Documents/GitHub/roc/src/snapshots/some_folder/002.txt
info: processed 2 snapshots in 1 ms.

It's starting to look like it will be really useful for @Anthony Bullard with the parser and formatter work as we build out more functionality.

view this post on Zulip Luke Boswell (Mar 01 2025 at 06:39):

^^ not urgent or anything. I need to head off now -- might come back to this in a break tomorrow sometime.

view this post on Zulip Anthony Bullard (Mar 01 2025 at 18:01):

#7649 For migration from slices->DataSpans

view this post on Zulip Anthony Bullard (Mar 01 2025 at 18:02):

#7648 For fixing some issues with SExpr serialization of ParseIR @Luke Boswell

view this post on Zulip Brendan Hansknecht (Mar 01 2025 at 22:27):

Fix infinite loop in tokenizer: https://github.com/roc-lang/roc/pull/7650

Just a 1 line change to add an exit condition to one case in the loop

view this post on Zulip Joshua Warner (Mar 01 2025 at 22:29):

Nice, thanks!

view this post on Zulip Brendan Hansknecht (Mar 01 2025 at 22:31):

Thank the fuzzer

view this post on Zulip Brendan Hansknecht (Mar 03 2025 at 05:28):

2 line PR to update a dependency again: https://github.com/roc-lang/roc/pull/7652

Just part of my iteration to get all the linux fuzzing happy.

view this post on Zulip Brendan Hansknecht (Mar 03 2025 at 07:45):

So essentially the same PR, but a second time. Turns out that zig follows symbolic links which defeated my last change. This sets the mode to lto via an environment variable instead: https://github.com/roc-lang/roc/pull/7653

view this post on Zulip Anthony Bullard (Mar 04 2025 at 14:51):

#7658: Move rest of IR to DataSpans

view this post on Zulip Brendan Hansknecht (Mar 05 2025 at 03:44):

#7663 minor improvement to fuzzing repro scripts and how things get built.

view this post on Zulip Luke Boswell (Mar 05 2025 at 07:49):

#7664 -- pretty small PR which fixes a bug in SExpr for files that end with a newline, and adds support for import statements.

I suspect this will need rebasing when @Anthony Bullard lands his changes tomorrow... so no rush on this.

I was looking at Can and figured I'd get my head around the import statements and how to extract the text for that.

view this post on Zulip Brendan Hansknecht (Mar 06 2025 at 03:17):

#7668 Create simple fuzzer for the parse -> format loop

view this post on Zulip Brendan Hansknecht (Mar 06 2025 at 03:52):

@Joshua Warner added your feedback. Now all formatter tests and the fuzzer share the same base unit.

view this post on Zulip Luke Boswell (Mar 06 2025 at 07:51):

#7664

$ zig build snapshot -- --fuzz-corpus ./src/fuzz-corpus/parse/ --verbose
warning: AFL++ requires a full version of llvm from the system or passed in via -Dllvm-path, but `llvm-config` was not found (Only building repro executables)
info: copying SOURCE from snapshots to: ./src/fuzz-corpus/parse/
info: /Users/luke/Documents/GitHub/roc/src/snapshots/003.txt
info: /Users/luke/Documents/GitHub/roc/src/snapshots/001.txt
info: /Users/luke/Documents/GitHub/roc/src/snapshots/some_folder/002.txt
info: processed 3 snapshots in 3 ms.

view this post on Zulip Luke Boswell (Mar 07 2025 at 06:31):

#7669 - more coverage for Parser s-expressions

view this post on Zulip Brendan Hansknecht (Mar 08 2025 at 01:37):

#7675 - minor snapshot tool cli arg handling cleanup and removal of no longer needed fuzz corpus (now generated by snapshot tool)

view this post on Zulip Brendan Hansknecht (Mar 08 2025 at 07:15):

Two micro PRs that cleanup some fuzzing bugs:
#7676 - tokenizer fuzzer generate and/or vs ||/&& correctly
#7677 - parser, explicitly panic instead of getting stuck in an infinite loop

view this post on Zulip Brendan Hansknecht (Mar 08 2025 at 07:43):

#7678 - super minor cli cleanup

view this post on Zulip Brendan Hansknecht (Mar 08 2025 at 19:31):

#7679 - Update to zig 0.14.0

view this post on Zulip Brendan Hansknecht (Mar 08 2025 at 20:09):

#7680 - Another super small parser PR. crash instead of hanging (I think this is the last hang)

view this post on Zulip Brendan Hansknecht (Mar 08 2025 at 20:34):

Note: I'm fairly certain all my PRs here are conflict free and can be merged in any order.

view this post on Zulip Luke Boswell (Mar 10 2025 at 06:09):

Can I please have a review on #7672.

In particular I'd like to know if my approach for handling errors and malformed in the Parser is correct.

Summary:

view this post on Zulip Luke Boswell (Mar 11 2025 at 03:34):

Ok, I've merged changes and made some additional improvements. This PR ^^^ is ready for a review.

view this post on Zulip Brendan Hansknecht (Mar 11 2025 at 07:02):

Tiny pr to enable optimizing fuzz repro scripts and cleanup two minor printout mistakes: https://github.com/roc-lang/roc/pull/7686

view this post on Zulip Anthony Bullard (Mar 11 2025 at 11:30):

#7687: [zig] Parser: Add Region to node

view this post on Zulip Brendan Hansknecht (Mar 11 2025 at 16:09):

#7689: Remove || and && from tokenizer

view this post on Zulip Luke Boswell (Mar 11 2025 at 22:20):

I'd like to merge https://github.com/roc-lang/roc/pull/7672 unless there's any significant concerns.

It's passing all the zig tests now and there are a lot of follow up things I'd prefer to do in smaller PR's than adding to this mammoth.

view this post on Zulip Sam Mohr (Mar 11 2025 at 22:22):

Looking now!

view this post on Zulip Luke Boswell (Mar 12 2025 at 04:43):

#7692

Example

~~~META
description=A primitive int
~~~SOURCE
module [foo]
foo = 42
~~~PROBLEMS
NIL
~~~TOKENS
KwModule,OpenSquare,LowerIdent,CloseSquare,Newline,LowerIdent,OpAssign,Int,EndOfFile
~~~PARSE
(file (1:1-2:9)
    (module (1:1-2:4)
        (exposed_item (1:9-1:12) (lower_ident "foo")))
    (decl (2:1-2:9)
        (ident (2:1-2:4) "foo")
        (int (2:7-2:9) "42")))
~~~FORMATTED
module [foo]

foo = 42
~~~END

view this post on Zulip Luke Boswell (Mar 12 2025 at 08:15):

#7693 fixes and improve regions for the parser and sexpr formatting.

view this post on Zulip Anthony Bullard (Mar 12 2025 at 14:12):

#7695: More multiline and comment support in the formatter

view this post on Zulip Brendan Hansknecht (Mar 13 2025 at 00:49):

#7696: Small PR, fix infinite loop in parser

view this post on Zulip Brendan Hansknecht (Mar 13 2025 at 02:55):

#7697: Slightly bigger PR dealing with numbers with no digits in them.

view this post on Zulip Brendan Hansknecht (Mar 13 2025 at 06:02):

Another tiny fuzz bug fix PR in the tokenizer (most of the LOC changes are me adding some doc comments on functions).

Just changes int token printing in the fuzzer loop to avoid a crash. Oh, and removes an assert I just added that the fuzzer found can be wrong.

#7698

view this post on Zulip Brendan Hansknecht (Mar 13 2025 at 06:10):

ultra tiny parser fuzz crash fix: #7699

view this post on Zulip Brendan Hansknecht (Mar 14 2025 at 03:50):

Ignore more files in the ci manager filter #7701

This just avoids running the old rust ci when changing things like the .gitignore file.

view this post on Zulip Brendan Hansknecht (Mar 14 2025 at 03:51):

Enable incremental compilation #7700 (also adds a guide in the readme to enable it with zls)

view this post on Zulip Luke Boswell (Mar 14 2025 at 09:38):

#7702 fixes 1 fuzz crash - adds malformed node for string_expected_close_interpolation

view this post on Zulip Brendan Hansknecht (Mar 15 2025 at 06:24):

#7703 Expand roc format to support directories

view this post on Zulip Brendan Hansknecht (Mar 15 2025 at 21:44):

Larger PR, though mostly moving lines around.
#7704 switch to using buffered io to write the formatter output instead of allocating an arraylist and filling it up before writing to the output.

view this post on Zulip Brendan Hansknecht (Mar 18 2025 at 02:03):

#7706

  1. Adds support for tracy
  2. general build script improvements
  3. doc on profiling the compiler

view this post on Zulip Brendan Hansknecht (Mar 19 2025 at 00:08):

#7707 Small pr for arena allocation of args and directory walker

view this post on Zulip Brendan Hansknecht (Mar 19 2025 at 01:10):

#7708 Relatively small PR to stop file loading from incurring extra copies.
Big perf win on my x86 linux machine ~8%.

Also, switches roc format to counting all the failures instead of early existing on the first failure.

view this post on Zulip Brendan Hansknecht (Mar 19 2025 at 03:14):

#7709 Another ~8% perf improvement by initilizing more stuff with a capacity.

view this post on Zulip Brendan Hansknecht (Mar 19 2025 at 03:15):

As a note, part of me thinks that we should always require initializing with a capacity. Cause it avoids extra allocations and memcpy's, which can be quite slow. Even just picking something arbitrary like 16 or 64 is likely fine for many things. Especially if it is just a list of u32 indices. Those barely use any ram in the larger scheme of things.

view this post on Zulip Brendan Hansknecht (Mar 19 2025 at 03:16):

Long term of course, would be great to tune the size based on what is expected over a very large corpus of roc files.

view this post on Zulip Brendan Hansknecht (Mar 19 2025 at 06:07):

#7710 improve tracy data collection by waiting for shutdown.

view this post on Zulip Brendan Hansknecht (Mar 19 2025 at 06:08):

specifically this is nice on macos where tracy is missing this feature.

view this post on Zulip Anthony Bullard (Mar 25 2025 at 11:01):

[#7695}(https://github.com/roc-lang/roc/pull/7695) Multiline and commenting support for the entire grammar

This is ready for review again, but I do have quite a painful rebase to complete after being away for 2-ish weeks :-(

view this post on Zulip Anthony Bullard (Mar 25 2025 at 11:02):

The biggest source of pain in this rebase is moving Formatter away from being a module-level struct. Which introduced whitespace changes to pretty much the entire file and I'm unsure what to keep and what not to

view this post on Zulip Joshua Warner (Mar 27 2025 at 03:36):

Anything I can do to help with the rebase?

view this post on Zulip Joshua Warner (Mar 27 2025 at 03:38):

Maybe in the future we should try to avoid doing "large" refactors (in terms of lines touched) on components that are actively being worked on

view this post on Zulip Anthony Bullard (Mar 27 2025 at 10:22):

It’s almost done

view this post on Zulip Anthony Bullard (Mar 27 2025 at 10:22):

Wasn’t that bad really

view this post on Zulip Anthony Bullard (Mar 27 2025 at 11:15):

We are READY TO MERGE!

view this post on Zulip Anthony Bullard (Mar 27 2025 at 11:16):

After this lands, you should mostly be able to write Roc applications, in the v0.1 style, without tokenization or parse errors - and with reasonable style when formatted.

view this post on Zulip Anthony Bullard (Mar 28 2025 at 00:06):

Just needs a :approved: ;-)

view this post on Zulip Joshua Warner (Mar 28 2025 at 01:48):

Some updates to the syntax migration tool, plus a few fixes to the new compiler, for various bits of syntax encountered in the wild: https://github.com/roc-lang/roc/pull/7716

view this post on Zulip Brendan Hansknecht (Mar 28 2025 at 04:49):

#7719 Super minor parser hang fix

view this post on Zulip Joshua Warner (Apr 03 2025 at 00:15):

https://github.com/roc-lang/roc/pull/7716 still needs a review if someone has some time!

view this post on Zulip Sam Mohr (Apr 03 2025 at 00:26):

I can read through tomorrow!

view this post on Zulip Anthony Bullard (Apr 03 2025 at 00:43):

I’ll take look at the zig code soon

view this post on Zulip Anthony Bullard (Apr 03 2025 at 00:43):

Hopefully in the morning

view this post on Zulip Joshua Warner (Apr 06 2025 at 20:46):

Think I fixed up all the issues there, if you have time to re-review

view this post on Zulip Anthony Bullard (Apr 06 2025 at 22:12):

I’ll try tonight or in the morning

view this post on Zulip luigim (Apr 07 2025 at 23:38):

Hey all, been very inactive due to health and personal issues but now I have the capacity to work on more! Linked below is a PR I forgot to put up before my absence. Thank you again to @Sam Mohr for their help with my questions.

https://github.com/roc-lang/roc/pull/7730

Happily open to any feedback or questions. Thanks!

view this post on Zulip Sam Mohr (Apr 08 2025 at 00:03):

I'll check it out when I get the time!

view this post on Zulip luigim (Apr 08 2025 at 00:39):

Thank you Sam!

view this post on Zulip Anthony Bullard (Apr 09 2025 at 14:11):

#7733 Parse and format other headers

view this post on Zulip Anthony Bullard (Apr 10 2025 at 11:37):

This is ready for re-review ^

view this post on Zulip Wizard ish (Apr 13 2025 at 00:39):

what is Module Work, is it just a wrapper around an IR?

view this post on Zulip Brendan Hansknecht (Apr 13 2025 at 01:39):

Sounds like it would be coordination for compiling a module one depedencies are met, but that is 100% a guess

view this post on Zulip Sam Mohr (Apr 13 2025 at 21:42):

https://github.com/roc-lang/roc/blob/966d0459e7ccb1bd28cb77c05b8419953ef167af/src/base/module_work.zig#L1

view this post on Zulip Sam Mohr (Apr 13 2025 at 21:42):

Here's a description @Wizard ish

view this post on Zulip Sam Mohr (Apr 13 2025 at 21:43):

In short, we want to be able to refer to data in other modules during compilation

view this post on Zulip Sam Mohr (Apr 13 2025 at 21:44):

Which requires knowing which module we're using, followed by the index within the module

view this post on Zulip Sam Mohr (Apr 13 2025 at 21:45):

For that "which module are we talking about" index, we want to have a compiler stage-agnostic mechanism to do that

view this post on Zulip Sam Mohr (Apr 13 2025 at 21:46):

And a very simple and efficient way to do that is to order modules in reverse compilation order (AKA dependencies first)

view this post on Zulip Sam Mohr (Apr 13 2025 at 21:54):

And then use the index of each module in that ordered list for referencing which module we need work from

view this post on Zulip Sam Mohr (Apr 13 2025 at 21:55):

So "module work" is "the IR data for a single module"

view this post on Zulip Sam Mohr (Apr 13 2025 at 21:56):

But it's not always IR, so it's Work and not IR

view this post on Zulip Wizard ish (Apr 13 2025 at 23:51):

so basically, it's a way to structure dependencies between stages and packages?

view this post on Zulip Sam Mohr (Apr 14 2025 at 02:36):

Sure, more or less

view this post on Zulip Jared Ramirez (Apr 16 2025 at 00:20):

#7744 Replace Slices with Ranges in SafeList and MultiList & update IRs (from the conversation here)

view this post on Zulip Anthony Bullard (Apr 16 2025 at 01:49):

#7745: Parse and Format where constraints

view this post on Zulip Magdiel Amor (Apr 16 2025 at 16:18):

Create markdown link checker for glossary.md

https://github.com/roc-lang/roc/pull/7747

view this post on Zulip Anton (Apr 16 2025 at 16:36):

:check: I'll take care of that one, I'm going to add a CI check so the script is run automatically.

view this post on Zulip Magdiel Amor (Apr 16 2025 at 18:06):

Ok great :blush:

view this post on Zulip Anthony Bullard (Apr 17 2025 at 11:25):

#7749: Type alias header using parens for args

view this post on Zulip Luke Boswell (Apr 18 2025 at 00:37):

Jared Ramirez said:

#7744 Replace Slices with Ranges in SafeList and MultiList & update IRs (from the conversation here)

I merged main and resolved the conflicts. @Brendan Hansknecht I left a comment for you. Are you able to review again please?

view this post on Zulip Luke Boswell (Apr 18 2025 at 00:42):

@Anton can you please look at @Lars Frogner's PR in https://github.com/roc-lang/roc/pull/7741

I'm reasonably sure the implementation is good, we just have a CI issue. I'll restart that failed one now and maybe it will resolve iteself.

view this post on Zulip Anthony Bullard (Apr 18 2025 at 10:56):

#7751: Move match branches to use fat arrow

view this post on Zulip Jared Ramirez (Apr 19 2025 at 00:57):

Jared Ramirez said:

#7744 Replace Slices with Ranges in SafeList and MultiList & update IRs (from the conversation here)

@Brendan Hansknecht Updated/responded based on your comments! After reviewing, feel free to merge if all looks good!

view this post on Zulip Brendan Hansknecht (Apr 19 2025 at 01:12):

Will do shortly!

view this post on Zulip Brendan Hansknecht (Apr 19 2025 at 02:28):

Minor PR to increase some default capacities based on a discussion with Richard from a long while back now (the last meetup).
#7753

view this post on Zulip Richard Feldman (Apr 20 2025 at 15:48):

initial cache I/O implementation: https://github.com/roc-lang/roc/pull/7755

view this post on Zulip Richard Feldman (Apr 21 2025 at 01:55):

:point_up: anyone have a Windows VM (or real machine) and could look into why that assertion is failing? https://github.com/roc-lang/roc/actions/runs/14564575038/job/40851987484?pr=7755#step:7:36

the path comes from a tempdir, so should be absolute on both Windows and UNIX... :thinking:

view this post on Zulip Brendan Hansknecht (Apr 21 2025 at 04:09):

I don't have windows available, but one general note. We want all FS to go though an abstraction

view this post on Zulip Brendan Hansknecht (Apr 21 2025 at 04:10):

We have a really basic fs mock currently that probably needs work, but it would be good to use here

view this post on Zulip Brendan Hansknecht (Apr 21 2025 at 04:10):

Needed for future wasm support

view this post on Zulip Brendan Hansknecht (Apr 21 2025 at 04:10):

Which definitely will be best if we get it building as soon as possible

view this post on Zulip Luke Boswell (Apr 21 2025 at 10:20):

Specifically in src/coordinate/Filesystem.zig @Richard Feldman

view this post on Zulip Anton (Apr 22 2025 at 09:42):

Brendan Hansknecht said:

We have a really basic fs mock currently that probably needs work, but it would be good to use here

@Richard Feldman let me know if I still need to look at the windows failure.

view this post on Zulip Richard Feldman (Apr 22 2025 at 11:03):

nah I'll try looking into Filesystem.zig first!

view this post on Zulip Richard Feldman (Apr 26 2025 at 04:49):

ok, revised it to use Filesystem.zig - https://github.com/roc-lang/roc/pull/7759

view this post on Zulip Anthony Bullard (May 03 2025 at 01:28):

Hoping I’ll have some time this next week to get back into the swing of things

view this post on Zulip Richard Feldman (May 03 2025 at 02:32):

nice, anything in particular you're looking to jump on?

view this post on Zulip Anthony Bullard (May 03 2025 at 09:42):

Just the last couple things in the parser and then I can entertain looking into anything else that needs help

view this post on Zulip Anthony Bullard (May 11 2025 at 13:11):

7780: Parse and format local dispatch arrow calls

view this post on Zulip Anthony Bullard (May 12 2025 at 14:00):

#7783: Parse and format var and for statements

view this post on Zulip Jared Ramirez (May 13 2025 at 00:08):

#7772: Type unification

It's ready to go, minus a CI issue I'm not sure how to resolve: Zig tests failing on windows, lots of unable to find static system library

view this post on Zulip Anton (May 13 2025 at 07:52):

I'll check out CI

view this post on Zulip Anton (May 13 2025 at 13:28):

Hmm, it does not reproduce locally. I also don't understand why this shows up now with this PR.

view this post on Zulip Anton (May 13 2025 at 13:38):

searched paths: none

That's not going to work :laughing:

view this post on Zulip Anton (May 13 2025 at 17:43):

Fixed :tada:

view this post on Zulip Anton (May 13 2025 at 17:43):

Surprise, surprise, it was a caching issue

view this post on Zulip Anton (May 13 2025 at 17:43):

I didn't even know that folder was cached though

view this post on Zulip Anton (May 13 2025 at 17:47):

When debugging I've often wanted to have a visual graph of which functions or programs access which files and dirs. I'd like to make something like that for Roc scripts one day. With a visual graph overview I could have immediately seen the missing dir was provided by the cache on normal runs.

view this post on Zulip Anthony Bullard (May 15 2025 at 14:30):

#7786: Formatter uses tab instead of spaces

view this post on Zulip Anthony Bullard (May 17 2025 at 18:48):

#7792: Remove panics and unreachable statements from Parser

view this post on Zulip Brendan Hansknecht (May 17 2025 at 19:53):

#7793: Next fuzz crash fix. Just deals with some offsets that were incorrect due to ignoring newlines.

view this post on Zulip Brendan Hansknecht (May 18 2025 at 04:27):

:point_up: should be fixed now

view this post on Zulip Anthony Bullard (May 18 2025 at 14:22):

#7794: Improve Parse IR SExpr serialization

view this post on Zulip Richard Feldman (May 18 2025 at 15:05):

#7795: the new host ABI we've discussed - @Brendan Hansknecht lmk what you think!

view this post on Zulip Luke Boswell (May 18 2025 at 23:03):

Nice progress :smiley:

view this post on Zulip Anthony Bullard (May 19 2025 at 20:38):

#7801: Add me to list of sponsors on Readme (got my receipt and it reminded me)

view this post on Zulip Richard Feldman (May 19 2025 at 21:45):

thanks for all the contributions and the sponsorship @Anthony Bullard! :heart_eyes:

view this post on Zulip Jared Ramirez (May 19 2025 at 23:26):

@Richard Feldman I updated #7722 to resolve conflicts with main, but that dismissed approval. Can you re-approve when you have a sec?

view this post on Zulip Richard Feldman (May 19 2025 at 23:43):

@Jared Ramirez done!

view this post on Zulip Jared Ramirez (May 21 2025 at 00:33):

#7803: Odds & ends based on type unification PR comments

view this post on Zulip Anton (May 21 2025 at 17:56):

#7804 I added List.keep_if_try!

view this post on Zulip Brendan Hansknecht (May 22 2025 at 00:37):

That name hurts :hurt:

view this post on Zulip Luke Boswell (May 22 2025 at 04:18):

#7802 -- copy builtins into the the zig compiler. All tests are passing now. For a review, I would recommend just stepping through each commit to see the delta's from the original files. Minor changes for zig 0.14.0 and to make CI linter and typos happy.

view this post on Zulip Anton (May 23 2025 at 09:09):

Brendan Hansknecht said:

That name hurts :hurt:

Yeah, it's not self-evident but it fits with our conventions

view this post on Zulip Richard Feldman (May 24 2025 at 02:46):

#7807 - stack memory system for the interpreter

view this post on Zulip Brendan Hansknecht (May 24 2025 at 02:54):

I'll have time to give that a proper review tomorrow

view this post on Zulip Richard Feldman (May 24 2025 at 02:58):

nice, thank you! :rock_on:

view this post on Zulip Jared Ramirez (May 29 2025 at 23:54):

#7811: Implement type variable occurs check (but do not use it anywhere yet)

view this post on Zulip Richard Feldman (May 30 2025 at 04:11):

not ready for review yet, but big one incoming for layouts: https://github.com/roc-lang/roc/pull/7812

view this post on Zulip Richard Feldman (May 30 2025 at 04:12):

I'll take a look at the occurs check one tomrorow! :smiley:

view this post on Zulip Jared Ramirez (Jun 01 2025 at 18:58):

#7805: # Support both Polymorphic & Compacted Nums in the type system

view this post on Zulip Isaac Van Doren (Jun 09 2025 at 02:08):

#7817: Add a new CLI argument parser that supports roc main.roc, basic flags, help messages, error messages, etc.

view this post on Zulip Jared Ramirez (Jun 10 2025 at 00:38):

#7818: Change type descriptors type form ArrayList to MultiArrayList

view this post on Zulip Luke Boswell (Jun 11 2025 at 12:18):

#7820 - random Can things.

With this PR we're at the point were we have some simple things working (again :sweat_smile: ) We had some of these things working before, I think @Sam Mohr and @Joshua Warner had implemented some things already, and then we broke them a bit.

@Anthony Bullard's work translating to the same architecture as the Parser laid the foundation here. I've just gone around trying to connect the dots and get it working.

What I am most proud of is we have SExpr and problems/diagnostics for compile-time/run-time error reporting working. Well enough that you can see the snapshots and pick something that isn't behaving correctly and dig in and fix it easy enough now.

Here's an example with two top-level defs

view this post on Zulip Luke Boswell (Jun 11 2025 at 22:25):

#7823 - adds a  .rules file which explains to AI agents how to use the roc snapshot tool

I found this significantly helps the agents when working with our code. Instead of creating custom debug or test programs, they can write snapshot tests.

view this post on Zulip Luke Boswell (Jun 12 2025 at 05:30):

#7824 - refactor the Parser

view this post on Zulip Jared Ramirez (Jun 13 2025 at 00:36):

#7825: Detect recursion in unify with occurs check

view this post on Zulip Luke Boswell (Jun 15 2025 at 01:13):

#7830 - it's still in Draft... I am going to need more time to really thoroughly review myself. But wanted to share the WIP.

I think I may have broken GH web interface with this PR. :sweat_smile:

Add reporting (ported across from rust) with support for Plain text, HTML, TTY, and LSP ]output formats.

Refactor Tokenize into a separate folder structure (probably didn't need to do this, but I had to refactor parser some for error handling and got carried away).

Refactor Problem/Diagnostic and error handling throughout the compiler. Taking inspiration from Rust I could see we needed richer data, so I refactored the Can Diagnostics to include payloads like idents and string literals. This gives much nicer reporting, here's an example:

~~~PROBLEMS
 UNDEFINED VARIABLE

 Nothing is named `x` in this scope.

 module [add2]

 add2 = x +      2
 Is there an import or exposing missing up-top?

To do that I pulled the errors out of the ModuleEnv, as this module doesn't have the context to generate good reports, and gave that responsibility to the AST/IR.

Anyway, checkout the snapshots to get a feel for the new reporting. It's loads quicker to checkout the files in the branch directly link to snapshots/ dir in the PR commit

view this post on Zulip Anthony Bullard (Jun 15 2025 at 01:42):

you are doing great work Luke. i should be back to help this week

view this post on Zulip Anthony Bullard (Jun 15 2025 at 01:42):

you're doing 90% of what i had planned to do

view this post on Zulip Anthony Bullard (Jun 15 2025 at 01:42):

and more

view this post on Zulip Luke Boswell (Jun 15 2025 at 01:43):

Thank you. I'm definitely thinking to myself "what would Anthony do here" on occasions. :sweat_smile:

I'd love to get enough together for a primitive roc check to work with the new syntax. That feels so close now.

view this post on Zulip Anton (Jun 16 2025 at 08:58):

I think I may have broken GH web interface with this PR. :sweat_smile:

Achievement unlocked :star: :p

view this post on Zulip Luke Boswell (Jun 17 2025 at 04:41):

#7834 - implementation of roc check using a simplified coordinate that just does a single module.

module [add]

add : U8, U8 -> U8
add = |x, y| x + y

Screenshot 2025-06-17 at 16.14.18.png

view this post on Zulip Luke Boswell (Jun 17 2025 at 04:43):

Needs some polish but wanted to share because I'm pretty stoked to see it in action :smiley:

Ready for Review :grinning_face_with_smiling_eyes:

view this post on Zulip Anthony Bullard (Jun 17 2025 at 10:42):

Luke Boswell said:

#7834 - implementation of roc check using a simplified coordinate that just does a single module.

module [add]

add : U8, U8 -> U8
add = |x, y| x + y

Screenshot 2025-06-17 at 16.14.18.png

Taking a look

view this post on Zulip Anthony Bullard (Jun 17 2025 at 11:04):

Approved!

view this post on Zulip Anthony Bullard (Jun 17 2025 at 11:06):

I went ahead and merged it so I can build on top of it (probably tomorrow morning)

view this post on Zulip Isaac Van Doren (Jun 17 2025 at 17:15):

Awesome!!

view this post on Zulip Jared Ramirez (Jun 17 2025 at 22:57):

#7837: Add type variable assignment to implemented can exprs

Up next: patterns!

view this post on Zulip Luke Boswell (Jun 17 2025 at 23:09):

@Jared Ramirez I left some comments, but nothing major so I merged it.

view this post on Zulip Luke Boswell (Jun 18 2025 at 11:45):

#7939 - removes source from ModuleEnv

view this post on Zulip Jared Ramirez (Jun 18 2025 at 18:33):

#7840: Add type variable assignment to implemented can patterns

With this and the PR yesterday, the basic idea for how we assign type variables based off CIR nodes should be established, and hopefully it shouldn't be too hard to create the type variables we need as the rest of Can gets implemented!

view this post on Zulip Luke Boswell (Jun 19 2025 at 00:10):

#7841 - Implement block parsing and stmts in a lambda, add malformed Pattern

I'm a goose. I have been making snapshots with old roc syntax and getting myself very confused. :sweat_smile:

view this post on Zulip Anthony Bullard (Jun 19 2025 at 10:49):

7843: Add all builtin modules to Canonicalizer init

view this post on Zulip Luke Boswell (Jun 20 2025 at 08:30):

#7846 implement Can for tuple expressions

view this post on Zulip Jared Ramirez (Jun 20 2025 at 17:09):

#7848: Basic type solving for list exprs

view this post on Zulip Luke Boswell (Jun 22 2025 at 11:27):

#7849 - I've marked this Ready for Review... it's a mammoth yak shaving expedition. I was trying to focus on type declarations... turns out you need a lot of things working before you can see those in action.

view this post on Zulip Jared Ramirez (Jun 22 2025 at 21:44):

#7854: Basic type error messages (rough 1st pass, will be improved in future PRs)

view this post on Zulip Norbert Hajagos (Jun 22 2025 at 23:35):

#7855 Using .md files for snapshots. Codefences add syntax highlighting .

view this post on Zulip Luke Boswell (Jun 23 2025 at 05:56):

#7858 error report for expected_colon_after_type_annotation

module [nums]

nums : List U8
# this is incorrect syntax, it should be List(U8)
# give a nice error message

view this post on Zulip Luke Boswell (Jun 23 2025 at 11:31):

#7859 single module import exposes as

view this post on Zulip Kiryl Dziamura (Jun 23 2025 at 12:31):

https://github.com/roc-lang/roc/pull/7860/files

Document now expects 0 based indexes, so here's a cleanup for Diagnostics. fixes reports rendering

view this post on Zulip Anthony Bullard (Jun 23 2025 at 13:11):

7852: Add Bool and Result builtins to zig compiler in v0.1 syntax

view this post on Zulip Alexander Ikonomou (Jun 23 2025 at 20:34):

7861: Add simple sqrt to Dec

view this post on Zulip Luke Boswell (Jun 23 2025 at 23:49):

Luke Boswell said:

#7859 single module import exposes as

Addressed all review feedback. @Anthony Bullard

view this post on Zulip Luke Boswell (Jun 24 2025 at 00:52):

#7862 - upgrade SafeList & SafeMultiList with serializeInto and deserializeFrom helpers.

Next step I think is to start testing simple caching using our CIR.NodeStore.

view this post on Zulip Luke Boswell (Jun 24 2025 at 04:41):

@Richard Feldman #7863 initial round-trip cache for CIR.NodeStore

view this post on Zulip Brendan Hansknecht (Jun 24 2025 at 04:58):

It feels weird being on the sidelines just watching as all this progress flies by. Currently don't have the energy for hobby programming, but always glad to follow the community and chat.

view this post on Zulip Anthony Bullard (Jun 24 2025 at 10:15):

Luke Boswell said:

#7862 - upgrade SafeList & SafeMultiList with serializeInto and deserializeFrom helpers.

Next step I think is to start testing simple caching using our CIR.NodeStore.

Approved, but there is one comment that I think you _may_ want to address now or in a fast follow (just a perf thing)

view this post on Zulip Luke Boswell (Jun 24 2025 at 10:19):

Thanks, probably a follow up -- I'll leave myself a note

view this post on Zulip Luke Boswell (Jun 24 2025 at 11:47):

#7866 - side quest refactoring our SExpr API and converting to kebab-case for nodes. Also includes various cleanup in the toSExpr functions.

view this post on Zulip Luke Boswell (Jun 24 2025 at 12:04):

There was a few places in CIR where I added Ids for modes that probably dont need them. Harmless extra information, I can remove later.

view this post on Zulip Luke Boswell (Jun 24 2025 at 23:54):

#7868 - improve Can for Tag Unions @Anthony Bullard

view this post on Zulip Luke Boswell (Jun 24 2025 at 23:56):

MyResult(ok, err) : [Good(ok), Bad(err)]
Option(a) : [Some(a), None]
    (s-type-decl @4-1-7-8 (id 80)
        (ty-header @4-1-4-18 (name "MyResult")
            (ty-args
                (ty-var @4-10-4-12 (name "ok"))
                (ty-var @4-14-4-17 (name "err"))))
        (ty-tag-union @4-21-4-41
            (ty-apply @4-22-4-30 (symbol "Good")
                (ty-var @4-27-4-29 (name "ok")))
            (ty-apply @4-32-4-40 (symbol "Bad")
                (ty-var @4-36-4-39 (name "err")))))
    (s-type-decl @11-1-14-10 (id 87)
        (ty-header @11-1-11-10 (name "Option")
            (ty-args
                (ty-var @11-8-11-9 (name "a"))))
        (ty-tag-union @11-13-11-28
            (ty-apply @11-14-11-21 (symbol "Some")
                (ty-var @11-19-11-20 (name "a")))
            (ty @11-23-11-27 (name "None")))))

view this post on Zulip Luke Boswell (Jun 25 2025 at 11:53):

#7869 - implement can for if-then-else

view this post on Zulip Luke Boswell (Jun 25 2025 at 11:54):

checkNumber = |num| {
    if num < 0 {
        "negative"
    } else if num == 0 {
        "zero"
    } else if num > 100 {
        "large"
    } else {
        "positive"
    }
}
(can-ir
    (d-let (id 109)
        (p-assign @3-1-3-12 (ident "checkNumber") (id 72))
        (e-lambda @3-15-13-2 (id 108)
            (args
                (p-assign @3-16-3-19 (ident "num") (id 73)))
            (e-block @3-21-13-2
                (e-if @4-2-13-2 (cond-var 0) (branch-var 0)
                    (if-branches
                        (if-branch
                            (e-binop @4-5-4-14 (op "lt")
                                (e-lookup-local @4-5-4-8
                                    (pattern (id 73)))
                                (e-int @4-11-4-12 (int-var 76) (precision-var 75) (literal "0") (value "TODO") (bound "u8")))
                            (e-block @4-13-6-3
                                (e-string @5-3-5-13
                                    (e-literal @5-4-5-12 (string "negative")))))
                        (if-branch
                            (e-binop @6-12-6-22 (op "eq")
                                (e-lookup-local @6-12-6-15
                                    (pattern (id 73)))
                                (e-int @6-19-6-20 (int-var 85) (precision-var 84) (literal "0") (value "TODO") (bound "u8")))
                            (e-block @6-21-8-3
                                (e-string @7-3-7-9
                                    (e-literal @7-4-7-8 (string "zero")))))
                        (if-branch
                            (e-binop @8-12-8-23 (op "gt")
                                (e-lookup-local @8-12-8-15
                                    (pattern (id 73)))
                                (e-int @8-18-8-21 (int-var 94) (precision-var 93) (literal "100") (value "TODO") (bound "u8")))
                            (e-block @8-22-10-3
                                (e-string @9-3-9-10
                                    (e-literal @9-4-9-9 (string "large"))))))
                    (if-else
                        (e-block @10-9-12-3
                            (e-string @11-3-11-13
                                (e-literal @11-4-11-12 (string "positive"))))))))))

view this post on Zulip Luke Boswell (Jun 25 2025 at 11:55):

We could probably look at flattening out the e-block's if they only contain a single expression.

view this post on Zulip Richard Feldman (Jun 25 2025 at 13:25):

yeah I think it's probably harmless to do that when going from parsed to canonical

view this post on Zulip Richard Feldman (Jun 25 2025 at 13:26):

I can't think of any downsides

view this post on Zulip Anthony Bullard (Jun 25 2025 at 13:41):

Yeah, at that point there is not really any errors that can be reported about the block itself

view this post on Zulip Jared Ramirez (Jun 25 2025 at 21:18):

#7872: Don't store region in type problem struct, instead lookup from CIR

view this post on Zulip Luke Boswell (Jun 26 2025 at 07:28):

#7873 partially implements canonicalisation and type checking for Records

{
    person: { name: "Alice", age: 30 },
    address: {
        street: "123 Main St",
        city: "Springfield",
        coordinates: { lat: 42.1234, lng: -71.5678 },
    },
    contact: {
        email: "alice@example.com",
        phone: { home: "555-1234", work: "555-5678" },
    },
}
(expr (id 129) (type "{ person: { name: Str, age: Num(Int(*)) }, address: { street: Str, city: Str, coordinates: { lat: Num(Fraction(*)), lng: Num(Fraction(*)) } }, contact: { email: Str, phone: { home: Str, work: Str } } }"))

view this post on Zulip Anthony Bullard (Jun 26 2025 at 12:31):

7876: Parse record shorthand and as patterns

view this post on Zulip Jared Ramirez (Jun 26 2025 at 17:20):

#7877: Tuple expr type solving

view this post on Zulip Richard Feldman (Jun 26 2025 at 22:15):

7878: Enforce number literal sizes

view this post on Zulip Luke Boswell (Jun 27 2025 at 01:56):

#7879 - implement record de-strcutures

view this post on Zulip Luke Boswell (Jun 27 2025 at 03:37):

#7880 - refactor parser Node.Data to use a union. For now we just make an "untyped" variant.. and in future PR's we can gradually move across common shapes.

view this post on Zulip Luke Boswell (Jun 27 2025 at 08:08):

Branch record-type-checking is ready for PR ... I can't seem to get the GH web interface to play ball right now.

It includes

getName : { name: Str, age: U64 } -> Str
getName = |person| person.name
(inferred-types
    (defs
        (def (name "getName") (type "{ name: Str, age: U64 } -> Str"))
        (def (name "main!")
            (unknown)))
    (expressions
        (expr @4-11-6-6 (type "{ name: Str, age: U64 } -> Str"))
        (expr @6-9-6-15 (type "*"))))
printName : { name: Str, age: U64 } => Str
printName = |person| {
    Stdout.line!(person.name)
    person.name
}
(inferred-types
    (defs
        (def (name "printName") (type "{ name: Str, age: U64 } => Str"))
        (def (name "main!")
            (unknown)))
    (expressions
        (expr @6-13-9-2 (type "{ name: Str, age: U64 } => Str"))
        (expr @10-9-10-15 (type "*"))))

view this post on Zulip Luke Boswell (Jun 27 2025 at 08:09):

I can try making a PR again later... :tear:

view this post on Zulip Luke Boswell (Jun 27 2025 at 08:21):

https://github.com/roc-lang/roc/pull/7881

view this post on Zulip Luke Boswell (Jun 28 2025 at 07:46):

#7891 -- some more fuzzer fixes

  1. handle malformed decs
  2. handle malformed type annotations

view this post on Zulip Norbert Hajagos (Jun 28 2025 at 12:52):

Tiny pr: add isInterned method to token tags.
#7892 Windows arm 11 tests fail with internal CLR error, but otherwise good.

view this post on Zulip Anton (Jun 28 2025 at 14:12):

Windows arm 11 tests are good now

view this post on Zulip Jared Ramirez (Jun 28 2025 at 16:43):

#7895: Add type checking for if-then-else statements

module [foo]

foo = if 1 {
  A
} else {
  "hello"
}

Results in

**TYPE MISMATCH**
This expression is used in an unexpected way:
**if_then_else.md:3:10:3:11:**
```roc
foo = if 1 A

It is of type:
    _Num(*)_

But you are trying to use it as:
    _[True, False]_

and

**TYPE MISMATCH**
This expression is used in an unexpected way:
**if_then_else.md:5:10:7:6:**
    else {
    "hello"
    }

It is of type:
    _Str_

But you are trying to use it as:
    _[A]*_

view this post on Zulip Anthony Bullard (Jun 28 2025 at 17:32):

Definitely not a blocker, because this is great, but it would be awesome if in the second one it was something like:

**TYPE MISMATCH IN IF-THEN-ELSE**
This expression is used in an unexpected way:
**if_then_else.md:5:10:7:6:**
    else {
    "hello"
    }

This branch is of type:
    _Str_

But the previous branch is of type:
    _[A, ..]_

In Roc, the type of each branch of an if-then-else expression must be the same.

view this post on Zulip Anthony Bullard (Jun 28 2025 at 17:33):

Maybe followed by an example

view this post on Zulip Anthony Bullard (Jun 28 2025 at 17:33):

(Unless it's in the LSP)

view this post on Zulip Jared Ramirez (Jun 28 2025 at 17:41):

Yeah definitely! I think we’ll need to do a whole pass at improving type error messages. The current ones are very bare bones

view this post on Zulip Richard Feldman (Jun 28 2025 at 17:45):

yeah I'm working on improving the list ones right now

view this post on Zulip Kiryl Dziamura (Jun 29 2025 at 11:10):

sexpr: use dots for region formatting

view this post on Zulip Richard Feldman (Jun 29 2025 at 13:52):

Remove predictNodeIndex for lists (and give nicer errors for heterogeneous lists)

view this post on Zulip Kiryl Dziamura (Jun 29 2025 at 15:36):

tokenize.zig minimal cleanup

I'm not confident in the zig compiler yet so I started reading code from the beginning. Performed a minimal cleanup along the way. And have some questions:

  1. Does it make sense to use region struct instead of offset + length and begin + end (we have both patterns in different places)? Also, Region would have a debug check for the start <= end
  2. What is SingleQuote? I guess it was prepared for multiline but now we have different syntax (""")?
  3. Why newline has 0-0 region? Newline's offset is used for the indent. Why not to use a dedicated field for it? Zeroed region seems to be misleading if it ends up in a warning message

view this post on Zulip Anthony Bullard (Jun 29 2025 at 15:41):

I agree that #1 is strange and we should probably align them. base.Region is used more and probably should be used. I agree with #2, I don't think we need that token at all.

#3 I'd be careful with and ask @Joshua Warner why he made that choice. He's very smart and experienced at this, so I'd assume he made this choice for a good reason (probably saving space)

view this post on Zulip Kiryl Dziamura (Jun 29 2025 at 15:42):

That's why I'm asking here and haven't introduced any changes yet :wink:

view this post on Zulip Richard Feldman (Jun 29 2025 at 15:50):

single quotes are number literals for Unicode scalars - e.g. if you put 'é' into roc repl, it evaluates to the Unicode code point for é

view this post on Zulip Anthony Bullard (Jun 29 2025 at 15:52):

oh right

view this post on Zulip Anthony Bullard (Jun 29 2025 at 15:52):

totally spaced that

view this post on Zulip Anthony Bullard (Jun 29 2025 at 15:52):

i need to add that to the parser

view this post on Zulip Kiryl Dziamura (Jun 29 2025 at 15:54):

ah, ok. then need to fix tokenizer for it as well. it seems to lack a return statement. going to add to the pr

view this post on Zulip Kiryl Dziamura (Jun 29 2025 at 15:58):

nevermind. I think now I get why there was unused struct Unicode:smile:
I'll coordinate with @Joshua Warner on how it was supposed to work

view this post on Zulip Richard Feldman (Jun 29 2025 at 16:10):

yeah we probably want to do them similarly to double quotes because you can have escapes in there for '\'' and '\\'

view this post on Zulip Richard Feldman (Jun 29 2025 at 16:10):

and '#' isn't a comment etc

view this post on Zulip Brendan Hansknecht (Jun 29 2025 at 17:43):

Micro PR: #7899 print input for fuzz-canonicalize

view this post on Zulip Brendan Hansknecht (Jun 29 2025 at 17:54):

micro PR: #7900 consider OOMs fuzz failures for canonicalize

view this post on Zulip Luke Boswell (Jun 30 2025 at 02:28):

#7906 - adds a snapshot summary (README.md)

It currently only contains the total number of snapshots... but we have plans to make this much more helpful.

view this post on Zulip Luke Boswell (Jun 30 2025 at 04:32):

I managed to get a performance metric into our snapshots... it's a simple upper bound on time taken to process the snapshot (compiler parts) currently set at <10ms.

File <10ms Tokenize Problems Parser Problems Canonicalize Problems Type Check Problems
001.md :check: 0 0 0 0
002.md :check: 0 0 0 0
add_var_with_spaces.md :check: 0 0 1 0
all_frac_types.md :check: 0 0 0 0
all_int_types.md :check: 0 0 0 0

view this post on Zulip Luke Boswell (Jun 30 2025 at 04:33):

Significantly we can say that all the CI machines process that snapshot within 10ms.

view this post on Zulip Luke Boswell (Jun 30 2025 at 06:10):

#7909 - improves the parsing of Ident. Another fuzz fix :playful:

    // Validate the bytes
     if (bytes.len == 0) {
         return Error.EmptyText;
     }

     // Check for null bytes (causes crashes in string interner)
     if (std.mem.indexOfScalar(u8, bytes, 0) != null) {
         return Error.ContainsNullByte;
     }

     // Check for other problematic control characters including space, tab, newline, and carriage return
     for (bytes) |byte| {
         if (byte < 32 or byte == ' ' or byte == '\t' or byte == '\n' or byte == '\r') {
             return Error.ContainsControlCharacters;
         }
     }

view this post on Zulip Luke Boswell (Jun 30 2025 at 06:11):

#7908 Another fuzz fix :playful:

@Anthony Bullard -- these commits touch the parser in a small way.

view this post on Zulip Jared Ramirez (Jun 30 2025 at 22:11):

#7907: Improve if-else error messages & fix typechecking bugs

view this post on Zulip Jared Ramirez (Jun 30 2025 at 22:11):

if-else errors now look like:

**INVALID IF CONDITION**
This `if` condition needs to be a _Bool_:
**if_then_else.md:3:10:**

foo = if 1 A

         ^

Right now, it has the type:
    _Num(*)_

Every `if` condition must evaluate to a _Bool_–either `True` or `False`.
**INVALID IF CONDITION**
This `if` condition needs to be a _Bool_:
**if_then_else_9.md:3:11:**

} else if 10 { # Comment after else open

          ^^

Right now, it has the type:
    _Num(*)_

Every `if` condition must evaluate to a _Bool_–either `True` or `False`.
**INCOMPATIBLE IF BRANCHES**
This `if` has an `else` branch with a different type from it's `then` branch:
**if_then_else.md:3:7:**
foo = if 1 A

    else {
    "hello"
    }
    ^^^^^^^

The `else` branch has the type:
    _Str_

But the `then` branch has the type:
    _[A]*_

All branches in an `if` must have compatible types.

Note: You can wrap branches in a tag to make them compatible.
To learn about tags, see <https://www.roc-lang.org/tutorial#tags>

view this post on Zulip Luke Boswell (Jul 01 2025 at 00:16):

#7911 - rename when -> match and adds a some new match snapshot tests.

I'd like to merge this before I start implementing Can for match, as this will keep those PR's cleaner

@Anthony Bullard FYI -- this does touch some helpers in the Parser

view this post on Zulip Luke Boswell (Jul 01 2025 at 00:49):

Luke Boswell said:

#7906 - adds a snapshot summary (README.md)

It currently only contains the total number of snapshots... but we have plans to make this much more helpful.

I've updated this PR (rebased) and now it is much smaller.

I would like feedback on this before merging. My future plans are to include memory related information in here also. I haven't yet found a great way to do that using the allocators. I'm starting to think along the lines of using the size of the serialised module to cache instead. We only have the CIR.NodeStore currently round tripping to cache in a unit test, but the plan is to expand that to include all of the required information to re-hydate the module, such as interned strings etc.

view this post on Zulip Luke Boswell (Jul 01 2025 at 06:42):

#7916

**BAD LIST REST PATTERN SYNTAX**
List rest patterns should use the `.. as name` syntax, not `..name`.
For example, use `[first, .. as rest]` instead of `[first, ..rest]`.

Here is the problematic code:
**list_rest_invalid.md:2:13:2:19:**
~~~roc
    [first, ..rest] => 0 # invalid rest pattern should error
~~~
            ^^^^^^

view this post on Zulip Kiryl Dziamura (Jul 01 2025 at 14:31):

#7917 use Region in tokenize.zig @Joshua Warner please

view this post on Zulip Luke Boswell (Jul 02 2025 at 00:02):

#7919 - add support for multi-file snapshots

Currently supports directories ending in _package _app and _platform, includes an example src/snapshots/plume_package with just two files.

view this post on Zulip Luke Boswell (Jul 02 2025 at 04:19):

#7922 - adds snapshot files for various use cases associated with nominal tags.

@Anthony Bullard I think we need some parser changes for these, it might be best to wait until your completed with the Parser refactor before implementing these. WDYT?

view this post on Zulip Jared Ramirez (Jul 02 2025 at 04:37):

#7920: Type checking for match

view this post on Zulip Jared Ramirez (Jul 02 2025 at 19:34):

#7924: Improve type problem API

view this post on Zulip Jared Ramirez (Jul 02 2025 at 23:12):

#7927: Add back type checking for match (accidentally got deleted in #7923)

view this post on Zulip Jared Ramirez (Jul 03 2025 at 05:05):

#7929: Type Checking Odds & Ends

view this post on Zulip Jared Ramirez (Jul 03 2025 at 20:48):

#7930: Type check bool binops & unwrap single elem tuples in Can

view this post on Zulip Brendan Hansknecht (Jul 04 2025 at 04:13):

#7934: add tracing to core roc functions

Basically add tracy to all the functions that might matter for perf.

view this post on Zulip Joshua Warner (Jul 04 2025 at 04:39):

Switching to byte ranges in the snapshot html generation: https://github.com/roc-lang/roc/pull/7935

view this post on Zulip Brendan Hansknecht (Jul 04 2025 at 15:21):

#7937: Unify source_code_region with SourceCodeDisplayRegion type

Just minor cleanup for data that is duplicated in raw fields and encoded cleanly in a type.

Actually scratch this one, I am just gonna merge it into my next PR which should be ready shortly and is related.

view this post on Zulip Brendan Hansknecht (Jul 04 2025 at 16:13):

#7938: Cleanup source code handling for reporting

Essentially this avoids a crap ton of linear scans of the entire source code of files for reporting. It is absolutely fundamental for the perf of reporting on large files with multiple errors.

view this post on Zulip Joshua Warner (Jul 04 2025 at 18:51):

html snapshot fanciness working for CANONICALIZE and TYPES as well now! https://github.com/roc-lang/roc/pull/7940

view this post on Zulip Joshua Warner (Jul 04 2025 at 18:53):

Check out a deployed version here: https://joshuawarner32.github.io/roc/snapshots/syntax_grab_bag.html

view this post on Zulip Brendan Hansknecht (Jul 04 2025 at 23:12):

#7943: Ensure tests are built with '-Dno-bin' such that they can be checked

Spinoff minor change from my other build script exploration. This just makes it so that zig build test -Dno-bin works and that zig build builds the tests as well.

view this post on Zulip Richard Feldman (Jul 05 2025 at 01:08):

as an aside, I've noticed that zig test tends not to work; it's always gotta be zig build test

view this post on Zulip Richard Feldman (Jul 05 2025 at 01:08):

is that fixable or just something we have to live with?

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 01:38):

zig test does not use the zig build system.

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 01:38):

It just runs tests discoverable from a specific file

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 01:39):

I think zig test src/test.zig should theoretically work.

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 01:39):

But yeah, zig build test is really the right command to my understanding.

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 01:40):

Especially if we eventually have test that pull in dependencies like llvm and such.

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 06:24):

#7944: Update to zig 0.14.1

This is actually a no-op. Both 0.14.0 and 0.14.1 work on the current compiler with no change to anything. So still leaving 0.14.0 as the labelled minimum zig version.

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 07:09):

Another small PR.
#7945: fix '-fincremental'

Just removes usingnamespace and for now directly exports what is needed.

view this post on Zulip Luke Boswell (Jul 05 2025 at 07:26):

Brendan Hansknecht said:

#7944: Update to zig 0.14.1

This is actually a no-op. Both 0.14.0 and 0.14.1 work on the current compiler with no change to anything. So still leaving 0.14.0 as the labelled minimum zig version.

This removes valgrind for our snapshots... I'm thinking we might want to wait to upgrade for now.

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 07:26):

It only removes it on arm

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 07:27):

Still runs on x86

view this post on Zulip Luke Boswell (Jul 05 2025 at 07:27):

Ohk :thumbs_up:

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 07:31):

But yeah, kinda inconvenient that valgrind doesn't support all arm instructions, so it is kinda up to the luck of compilation as to whether or not it will work. That said, it does get better with each new release.

view this post on Zulip Luke Boswell (Jul 05 2025 at 09:06):

#7931

view this post on Zulip Luke Boswell (Jul 05 2025 at 09:09):

I'm probably going to need to spend a day on the fuzzer, and buy @Anthony Bullard a beer (or two) to pay for my sins... but I'd like land these changes so we can work on type checking and implementing where clause etc.

view this post on Zulip Anton (Jul 05 2025 at 18:00):

#7950 Nix flake for the zig compiler + some related changes

view this post on Zulip Jared Ramirez (Jul 05 2025 at 18:30):

#7951: Standardize function name in canonicalize.zig to all be camel case

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 22:41):

I wonder if we can lint and fix that across the codebase

view this post on Zulip Brendan Hansknecht (Jul 05 2025 at 22:41):

Consistency would be nice

view this post on Zulip Jared Ramirez (Jul 06 2025 at 00:44):

#7953: Type checking for nominal tag unions (not 100% done, still have a few clean up things to do)

module [Color, blue]

Color := [Red, Green, Blue]

blue : Color
blue = Color.Blue

yellow : Color
yellow = Color.Yellow
~~~
# PROBLEMS
**INVALID NOMINAL TAG**
I'm having trouble with this nominal tag:

yellow = Color.Yellow
         ^^^^^^^^^^^^

The tag is:
    _Yellow_

But it should be one of:
    _[Red, Green, Blue]_

view this post on Zulip Richard Feldman (Jul 06 2025 at 02:57):

#7954: CIR Regions go in a separate array

view this post on Zulip Jared Ramirez (Jul 06 2025 at 04:55):

Jared Ramirez said:

#7953: Type checking for nominal tag unions (not 100% done, still have a few clean up things to do)

:point_up: this is now ready for review!


Last updated: Jul 06 2025 at 12:14 UTC