diff --git a/BUILDING_FROM_SOURCE.md b/BUILDING_FROM_SOURCE.md index 35df489a83..0696e5eb7b 100644 --- a/BUILDING_FROM_SOURCE.md +++ b/BUILDING_FROM_SOURCE.md @@ -120,7 +120,7 @@ You should be in a repl now. Have fun! ### Extra tips -If you plan on using `nix-shell` regularly, check out [direnv](https://direnv.net/) and [lorri](https://github.com/nix-community/lorri). Whenever you `cd` into `roc/`, they will automatically load the Nix dependecies into your current shell, so you never have to run nix-shell directly! +If you plan on using `nix-shell` regularly, check out [direnv](https://direnv.net/) and [lorri](https://github.com/nix-community/lorri). Whenever you `cd` into `roc/`, they will automatically load the Nix dependencies into your current shell, so you never have to run nix-shell directly! ### Editor diff --git a/ast/src/ast_error.rs b/ast/src/ast_error.rs index b394566633..bfaeadf751 100644 --- a/ast/src/ast_error.rs +++ b/ast/src/ast_error.rs @@ -9,7 +9,7 @@ use crate::lang::core::ast::ASTNodeId; #[snafu(visibility(pub))] pub enum ASTError { #[snafu(display( - "ASTNodeIdWithoutExprId: The expr_id_opt in ASTNode({:?}) was `None` but I was expexting `Some(ExprId)` .", + "ASTNodeIdWithoutExprId: The expr_id_opt in ASTNode({:?}) was `None` but I was expecting `Some(ExprId)` .", ast_node_id ))] ASTNodeIdWithoutExprId { diff --git a/ast/src/lang/core/def/def.rs b/ast/src/lang/core/def/def.rs index dca2a20644..00e75c296e 100644 --- a/ast/src/lang/core/def/def.rs +++ b/ast/src/lang/core/def/def.rs @@ -464,7 +464,7 @@ fn canonicalize_pending_def<'a>( env.tailcallable_symbol = Some(*defined_symbol); }; - // regiser the name of this closure, to make sure the closure won't capture it's own name + // register the name of this closure, to make sure the closure won't capture it's own name if let (Pattern2::Identifier(ref defined_symbol), &ast::Expr::Closure(_, _)) = (&env.pool[loc_can_pattern], &loc_expr.value) { @@ -632,7 +632,7 @@ fn canonicalize_pending_def<'a>( env.tailcallable_symbol = Some(*defined_symbol); }; - // regiser the name of this closure, to make sure the closure won't capture it's own name + // register the name of this closure, to make sure the closure won't capture it's own name if let (Pattern2::Identifier(ref defined_symbol), &ast::Expr::Closure(_, _)) = (&env.pool[loc_can_pattern], &loc_expr.value) { diff --git a/ast/src/lang/core/expr/expr2.rs b/ast/src/lang/core/expr/expr2.rs index 5e7774ca98..1f8983d8cc 100644 --- a/ast/src/lang/core/expr/expr2.rs +++ b/ast/src/lang/core/expr/expr2.rs @@ -108,7 +108,7 @@ pub enum Expr2 { }, Closure { args: PoolVec<(Variable, NodeId)>, // 8B - uniq_symbol: Symbol, // 8B This is a globally uniqe symbol for the closure + uniq_symbol: Symbol, // 8B This is a globally unique symbol for the closure body_id: ExprId, // 4B function_type: Variable, // 4B recursive: Recursive, // 1B diff --git a/ast/src/lang/core/expr/expr_to_expr2.rs b/ast/src/lang/core/expr/expr_to_expr2.rs index 7c7cfd2c3c..d9eaf2cf18 100644 --- a/ast/src/lang/core/expr/expr_to_expr2.rs +++ b/ast/src/lang/core/expr/expr_to_expr2.rs @@ -454,7 +454,7 @@ pub fn expr_to_expr2<'a>( // We shouldn't ultimately count arguments as referenced locals. Otherwise, // we end up with weird conclusions like the expression (\x -> x + 1) - // references the (nonexistant) local variable x! + // references the (nonexistent) local variable x! output.references.lookups.remove(&sub_symbol); } } diff --git a/ast/src/lang/core/expr/introduced_vars.rs b/ast/src/lang/core/expr/introduced_vars.rs index 0abb087815..26bbe6b738 100644 --- a/ast/src/lang/core/expr/introduced_vars.rs +++ b/ast/src/lang/core/expr/introduced_vars.rs @@ -5,7 +5,7 @@ use roc_types::subs::Variable; #[derive(Clone, Debug, PartialEq, Default)] pub struct IntroducedVariables { - // Rigids must be unique within a type annoation. + // Rigids must be unique within a type annotation. // E.g. in `identity : a -> a`, there should only be one // variable (a rigid one, with name "a"). // Hence `rigids : Map` diff --git a/ast/src/lang/scope.rs b/ast/src/lang/scope.rs index 5efe4f118c..91380bfda3 100644 --- a/ast/src/lang/scope.rs +++ b/ast/src/lang/scope.rs @@ -162,7 +162,7 @@ impl Scope { let alias = Alias { actual, - /// We know that builtin aliases have no hiddden variables (e.g. in closures) + /// We know that builtin aliases have no hidden variables (e.g. in closures) hidden_variables: PoolVec::empty(pool), targs: variables, }; diff --git a/compiler/builtins/README.md b/compiler/builtins/README.md index ba563234fb..a83e924cf7 100644 --- a/compiler/builtins/README.md +++ b/compiler/builtins/README.md @@ -42,7 +42,7 @@ fn list_repeat(symbol: Symbol, var_store: &mut VarStore) -> Def { ) } ``` -In these builtin definitions you will need to allocate for and list the arguments. For `List.repeat`, the arguments are the `elem_var` and the `len_var`. So in both the `body` and `defn` we list these arguments in a vector, with the `Symobl::ARG_1` and` Symvol::ARG_2` designating which argument is which. +In these builtin definitions you will need to allocate for and list the arguments. For `List.repeat`, the arguments are the `elem_var` and the `len_var`. So in both the `body` and `defn` we list these arguments in a vector, with the `Symbol::ARG_1` and` Symvol::ARG_2` designating which argument is which. Since `List.repeat` is implemented entirely as low level functions, its `body` is a `RunLowLevel`, and the `op` is `LowLevel::ListRepeat`. Lets talk about `LowLevel` in the next section. @@ -60,11 +60,11 @@ Its one thing to actually write these functions, its _another_ thing to let the ## Specifying how we pass args to the function ### builtins/mono/src/borrow.rs -After we have all of this, we need to specify if the arguments we're passing are owned, borrowed or irrelvant. Towards the bottom of this file, add a new case for you builtin and specify each arg. Be sure to read the comment, as it explains this in more detail. +After we have all of this, we need to specify if the arguments we're passing are owned, borrowed or irrelevant. Towards the bottom of this file, add a new case for you builtin and specify each arg. Be sure to read the comment, as it explains this in more detail. ## Testing it ### solve/tests/solve_expr.rs -To make sure that Roc is properly inferring the type of the new builtin, add a test to this file simlar to: +To make sure that Roc is properly inferring the type of the new builtin, add a test to this file similar to: ``` #[test] fn atan() { diff --git a/compiler/builtins/bitcode/run-tests.sh b/compiler/builtins/bitcode/run-tests.sh index 92bb9fae6d..c34b9cba31 100755 --- a/compiler/builtins/bitcode/run-tests.sh +++ b/compiler/builtins/bitcode/run-tests.sh @@ -6,4 +6,4 @@ set -euxo pipefail zig build test # fmt every zig -find src/*.zig -type f -print0 | xargs -n 1 -0 zig fmt --check || (echo "zig fmt --check FAILED! Check the previuous lines to see which files were improperly formatted." && exit 1) +find src/*.zig -type f -print0 | xargs -n 1 -0 zig fmt --check || (echo "zig fmt --check FAILED! Check the previous lines to see which files were improperly formatted." && exit 1) diff --git a/compiler/builtins/bitcode/src/main.zig b/compiler/builtins/bitcode/src/main.zig index aeccad39ca..8a6556c7cc 100644 --- a/compiler/builtins/bitcode/src/main.zig +++ b/compiler/builtins/bitcode/src/main.zig @@ -188,7 +188,7 @@ test "" { // // Thank you Zig Contributors! -// Export it as weak incase it is alreadly linked in by something else. +// Export it as weak incase it is already linked in by something else. comptime { @export(__muloti4, .{ .name = "__muloti4", .linkage = .Weak }); } diff --git a/compiler/builtins/bitcode/src/str.zig b/compiler/builtins/bitcode/src/str.zig index 7ca72c7cc4..ec2e4d3819 100644 --- a/compiler/builtins/bitcode/src/str.zig +++ b/compiler/builtins/bitcode/src/str.zig @@ -264,7 +264,7 @@ pub const RocStr = extern struct { } // Returns (@sizeOf(RocStr) - 1) for small strings and the empty string. - // Returns 0 for refcounted stirngs and immortal strings. + // Returns 0 for refcounted strings and immortal strings. // Returns the stored capacity value for all other strings. pub fn capacity(self: RocStr) usize { const length = self.len(); diff --git a/compiler/builtins/bitcode/src/utils.zig b/compiler/builtins/bitcode/src/utils.zig index 8626205271..25f057961c 100644 --- a/compiler/builtins/bitcode/src/utils.zig +++ b/compiler/builtins/bitcode/src/utils.zig @@ -15,7 +15,7 @@ extern fn roc_realloc(c_ptr: *c_void, new_size: usize, old_size: usize, alignmen // This should never be passed a null pointer. extern fn roc_dealloc(c_ptr: *c_void, alignment: u32) callconv(.C) void; -// Signals to the host that the program has paniced +// Signals to the host that the program has panicked extern fn roc_panic(c_ptr: *c_void, tag_id: u32) callconv(.C) void; comptime { @@ -50,7 +50,7 @@ fn testing_roc_panic(c_ptr: *c_void, tag_id: u32) callconv(.C) void { _ = c_ptr; _ = tag_id; - @panic("Roc paniced"); + @panic("Roc panicked"); } pub fn alloc(size: usize, alignment: u32) [*]u8 { @@ -70,7 +70,7 @@ pub fn panic(c_ptr: *c_void, alignment: u32) callconv(.C) void { return @call(.{ .modifier = always_inline }, roc_panic, .{ c_ptr, alignment }); } -// indirection because otherwise zig creats an alias to the panic function which our LLVM code +// indirection because otherwise zig creates an alias to the panic function which our LLVM code // does not know how to deal with pub fn test_panic(c_ptr: *c_void, alignment: u32) callconv(.C) void { _ = c_ptr; diff --git a/compiler/builtins/docs/List.roc b/compiler/builtins/docs/List.roc index d5f1148292..9b3e489db1 100644 --- a/compiler/builtins/docs/List.roc +++ b/compiler/builtins/docs/List.roc @@ -384,7 +384,7 @@ oks : List (Result elem *) -> List elem ## ## Performance Details ## ## [List.keepIf] always returns a list that takes up exactly the same amount -## of memory as the original, even if its length decreases. This is becase it +## of memory as the original, even if its length decreases. This is because it ## can't know in advance exactly how much space it will need, and if it guesses a ## length that's too low, it would have to re-allocate. ## diff --git a/compiler/builtins/docs/Num.roc b/compiler/builtins/docs/Num.roc index 530b91c62f..3790319194 100644 --- a/compiler/builtins/docs/Num.roc +++ b/compiler/builtins/docs/Num.roc @@ -395,7 +395,7 @@ Nat : Int [ @Natural ] ## ## A common use for #Nat is to store the length ("len" for short) of a ## collection like #List, #Set, or #Map. 64-bit systems can represent longer -## lists in memory than 32-bit sytems can, which is why the length of a list +## lists in memory than 32-bit systems can, which is why the length of a list ## is represented as a #Nat in Roc. ## ## If any operation would result in an #Int that is either too big diff --git a/compiler/can/src/annotation.rs b/compiler/can/src/annotation.rs index bbb1707ef2..160eb25a72 100644 --- a/compiler/can/src/annotation.rs +++ b/compiler/can/src/annotation.rs @@ -20,7 +20,7 @@ pub struct Annotation { pub struct IntroducedVariables { // NOTE on rigids // - // Rigids must be unique within a type annoation. + // Rigids must be unique within a type annotation. // E.g. in `identity : a -> a`, there should only be one // variable (a rigid one, with name "a"). // Hence `rigids : ImMap` diff --git a/compiler/can/src/def.rs b/compiler/can/src/def.rs index 6489f657b7..d74a8434ac 100644 --- a/compiler/can/src/def.rs +++ b/compiler/can/src/def.rs @@ -973,7 +973,7 @@ fn canonicalize_pending_def<'a>( env.tailcallable_symbol = Some(*defined_symbol); }; - // regiser the name of this closure, to make sure the closure won't capture it's own name + // register the name of this closure, to make sure the closure won't capture it's own name if let (Pattern::Identifier(ref defined_symbol), &ast::Expr::Closure(_, _)) = (&loc_can_pattern.value, &loc_expr.value) { @@ -1120,7 +1120,7 @@ fn canonicalize_pending_def<'a>( vars_by_symbol.insert(*defined_symbol, expr_var); }; - // regiser the name of this closure, to make sure the closure won't capture it's own name + // register the name of this closure, to make sure the closure won't capture it's own name if let (Pattern::Identifier(ref defined_symbol), &ast::Expr::Closure(_, _)) = (&loc_can_pattern.value, &loc_expr.value) { diff --git a/compiler/can/src/expr.rs b/compiler/can/src/expr.rs index 79d762560e..d22ee4c3f5 100644 --- a/compiler/can/src/expr.rs +++ b/compiler/can/src/expr.rs @@ -552,7 +552,7 @@ pub fn canonicalize_expr<'a>( // We shouldn't ultimately count arguments as referenced locals. Otherwise, // we end up with weird conclusions like the expression (\x -> x + 1) - // references the (nonexistant) local variable x! + // references the (nonexistent) local variable x! output.references.lookups.remove(sub_symbol); } } @@ -1683,7 +1683,7 @@ fn flatten_str_lines<'a>( (desugar_str_segments(var_store, segments), output) } -/// Resolve stirng interpolations by desugaring a sequence of StrSegments +/// Resolve string interpolations by desugaring a sequence of StrSegments /// into nested calls to Str.concat fn desugar_str_segments(var_store: &mut VarStore, segments: Vec) -> Expr { use StrSegment::*; diff --git a/compiler/gen_dev/README.md b/compiler/gen_dev/README.md index a9b544b93c..bd8d8f9e5a 100644 --- a/compiler/gen_dev/README.md +++ b/compiler/gen_dev/README.md @@ -53,7 +53,7 @@ Here are example implementations for [arm](https://github.com/rtfeldman/roc/blob ### CallConv -[CallConv](https://github.com/rtfeldman/roc/blob/trunk/compiler/gen_dev/src/generic64/mod.rs) is the abstaction over caling conventions. +[CallConv](https://github.com/rtfeldman/roc/blob/trunk/compiler/gen_dev/src/generic64/mod.rs) is the abstraction over calling conventions. It deals with register and stack specific information related to passing and returning arguments. Here are example implementations for [arm](https://github.com/rtfeldman/roc/blob/trunk/compiler/gen_dev/src/generic64/aarch64.rs) and [x86_64](https://github.com/rtfeldman/roc/blob/trunk/compiler/gen_dev/src/generic64/x86_64.rs). @@ -74,7 +74,7 @@ This is the general procedure I follow with some helpful links: 1. Uncomment the code to print out procedures [from here](https://github.com/rtfeldman/roc/blob/trunk/compiler/gen_dev/tests/helpers/eval.rs) and run the test. It should fail and print out the mono ir for this test case. Seeing the actual mono ir tends to be very helpful for complex additions. -1. Generally it will fail in one of the match statments in the [Backend](https://github.com/rtfeldman/roc/blob/trunk/compiler/gen_dev/src/lib.rs) trait. +1. Generally it will fail in one of the match statements in the [Backend](https://github.com/rtfeldman/roc/blob/trunk/compiler/gen_dev/src/lib.rs) trait. Add the correct pattern matching and likely new function for your new builtin. This will break the compile until you add the same function to places that implement the trait, like [Backend64Bit](https://github.com/rtfeldman/roc/blob/trunk/compiler/gen_dev/src/generic64/mod.rs). diff --git a/compiler/gen_dev/src/generic64/mod.rs b/compiler/gen_dev/src/generic64/mod.rs index 8df364f6a8..212d6572f7 100644 --- a/compiler/gen_dev/src/generic64/mod.rs +++ b/compiler/gen_dev/src/generic64/mod.rs @@ -553,7 +553,7 @@ impl< let jmp_offset = ASM::jmp_imm32(&mut self.buf, 0x1234_5678); ret_jumps.push((jmp_location, jmp_offset)); - // Overwite the original jne with the correct offset. + // Overwrite the original jne with the correct offset. let end_offset = self.buf.len(); let jne_offset = end_offset - start_offset; ASM::jne_reg64_imm64_imm32(&mut tmp, cond_reg, *val, jne_offset as i32); @@ -664,7 +664,7 @@ impl< }, })); - // Overwite the original jump with the correct offset. + // Overwrite the original jump with the correct offset. let mut tmp = bumpalo::vec![in self.env.arena]; self.update_jmp_imm32_offset( &mut tmp, @@ -1296,7 +1296,7 @@ impl< match val { Some(SymbolStorage::GeneralReg(reg)) => { let offset = self.claim_stack_size(8)?; - // For base addresssing, use the negative offset - 8. + // For base addressing, use the negative offset - 8. ASM::mov_base32_reg64(&mut self.buf, offset, reg); self.symbol_storage_map.insert( *sym, @@ -1310,7 +1310,7 @@ impl< } Some(SymbolStorage::FloatReg(reg)) => { let offset = self.claim_stack_size(8)?; - // For base addresssing, use the negative offset. + // For base addressing, use the negative offset. ASM::mov_base32_freg64(&mut self.buf, offset, reg); self.symbol_storage_map.insert( *sym, diff --git a/compiler/gen_dev/src/generic64/x86_64.rs b/compiler/gen_dev/src/generic64/x86_64.rs index a30a1a4e9c..67f3d82a08 100644 --- a/compiler/gen_dev/src/generic64/x86_64.rs +++ b/compiler/gen_dev/src/generic64/x86_64.rs @@ -82,7 +82,7 @@ impl CallConv for X86_64SystemV { X86_64GeneralReg::RAX, X86_64GeneralReg::RCX, X86_64GeneralReg::RDX, - // Don't use stack pionter: X86_64GeneralReg::RSP, + // Don't use stack pointer: X86_64GeneralReg::RSP, X86_64GeneralReg::RSI, X86_64GeneralReg::RDI, X86_64GeneralReg::R8, @@ -258,7 +258,7 @@ impl CallConv for X86_64SystemV { Layout::Struct(&[]) => {} x => { return Err(format!( - "Loading args with layout {:?} not yet implementd", + "Loading args with layout {:?} not yet implemented", x )); } @@ -464,7 +464,7 @@ impl CallConv for X86_64WindowsFastcall { // The regs we want to use first should be at the end of this vec. // We will use pop to get which reg to use next - // Don't use stack pionter: X86_64GeneralReg::RSP, + // Don't use stack pointer: X86_64GeneralReg::RSP, // Don't use frame pointer: X86_64GeneralReg::RBP, // Use callee saved regs last. @@ -602,7 +602,7 @@ impl CallConv for X86_64WindowsFastcall { Layout::Struct(&[]) => {} x => { return Err(format!( - "Loading args with layout {:?} not yet implementd", + "Loading args with layout {:?} not yet implemented", x )); } diff --git a/compiler/gen_dev/src/lib.rs b/compiler/gen_dev/src/lib.rs index bd13de5960..e17abf1362 100644 --- a/compiler/gen_dev/src/lib.rs +++ b/compiler/gen_dev/src/lib.rs @@ -68,7 +68,7 @@ where /// finalize does any setup and cleanup that should happen around the procedure. /// finalize does setup because things like stack size and jump locations are not know until the function is written. - /// For example, this can store the frame pionter and setup stack space. + /// For example, this can store the frame pointer and setup stack space. /// finalize is run at the end of build_proc when all internal code is finalized. fn finalize(&mut self) -> Result<(&'a [u8], &[Relocation]), String>; diff --git a/compiler/gen_llvm/src/llvm/bitcode.rs b/compiler/gen_llvm/src/llvm/bitcode.rs index 52b604dff3..95dfa79c4b 100644 --- a/compiler/gen_llvm/src/llvm/bitcode.rs +++ b/compiler/gen_llvm/src/llvm/bitcode.rs @@ -328,7 +328,7 @@ enum Mode { Dec, } -/// a functin that accepts two arguments: the value to increment, and an amount to increment by +/// a function that accepts two arguments: the value to increment, and an amount to increment by pub fn build_inc_n_wrapper<'a, 'ctx, 'env>( env: &Env<'a, 'ctx, 'env>, layout_ids: &mut LayoutIds<'a>, @@ -337,7 +337,7 @@ pub fn build_inc_n_wrapper<'a, 'ctx, 'env>( build_rc_wrapper(env, layout_ids, layout, Mode::IncN) } -/// a functin that accepts two arguments: the value to increment; increments by 1 +/// a function that accepts two arguments: the value to increment; increments by 1 pub fn build_inc_wrapper<'a, 'ctx, 'env>( env: &Env<'a, 'ctx, 'env>, layout_ids: &mut LayoutIds<'a>, diff --git a/compiler/gen_llvm/src/llvm/build.rs b/compiler/gen_llvm/src/llvm/build.rs index 5483f8a2d8..04cf2eba7e 100644 --- a/compiler/gen_llvm/src/llvm/build.rs +++ b/compiler/gen_llvm/src/llvm/build.rs @@ -3108,7 +3108,7 @@ fn expose_function_to_host_help_c_abi_generic<'a, 'ctx, 'env>( return_layout: Layout<'a>, c_function_name: &str, ) -> FunctionValue<'ctx> { - // NOTE we ingore env.is_gen_test here + // NOTE we ignore env.is_gen_test here let wrapper_return_type = roc_function.get_type().get_return_type().unwrap(); let mut cc_argument_types = Vec::with_capacity_in(arguments.len(), env.arena); @@ -3765,7 +3765,7 @@ fn make_exception_catching_wrapper<'a, 'ctx, 'env>( // our exposed main function adheres to the C calling convention wrapper_function.set_call_conventions(FAST_CALL_CONV); - // invoke instead of call, so that we can catch any exeptions thrown in Roc code + // invoke instead of call, so that we can catch any exceptions thrown in Roc code let arguments = wrapper_function.get_params(); let basic_block = context.append_basic_block(wrapper_function, "entry"); diff --git a/compiler/gen_llvm/src/llvm/refcounting.rs b/compiler/gen_llvm/src/llvm/refcounting.rs index 8a89c924d7..b6cd354349 100644 --- a/compiler/gen_llvm/src/llvm/refcounting.rs +++ b/compiler/gen_llvm/src/llvm/refcounting.rs @@ -1379,7 +1379,7 @@ fn build_rec_union_recursive_decrement<'a, 'ctx, 'env>( ) { debug_assert_eq!(cases.len(), 1); - // in this case, don't switch, because the `else` branch below would try to read the (nonexistant) tag id + // in this case, don't switch, because the `else` branch below would try to read the (nonexistent) tag id let (_, only_branch) = cases.pop().unwrap(); env.builder.build_unconditional_branch(only_branch); } else { diff --git a/compiler/gen_wasm/README.md b/compiler/gen_wasm/README.md index 4a9469c445..5bee25a0b9 100644 --- a/compiler/gen_wasm/README.md +++ b/compiler/gen_wasm/README.md @@ -56,7 +56,7 @@ There is also an improvement on Relooper called ["Stackifier"](https://medium.co ## Stack machine vs register machine -Wasm's instruction set is based on a stack-machine VM. Whereas CPU instructions have named registers that they operate on, Wasm has no named registers at all. The instructions don't contain register names. Instructions can oly operate on whatever data is at the top of the stack. +Wasm's instruction set is based on a stack-machine VM. Whereas CPU instructions have named registers that they operate on, Wasm has no named registers at all. The instructions don't contain register names. Instructions can only operate on whatever data is at the top of the stack. For example the instruction `i64.add` takes two operands. It pops the top two arguments off the VM stack and pushes the result back. diff --git a/compiler/reporting/src/report.rs b/compiler/reporting/src/report.rs index 8a9b045f4c..cce7db7f3d 100644 --- a/compiler/reporting/src/report.rs +++ b/compiler/reporting/src/report.rs @@ -398,7 +398,7 @@ impl<'a> RocDocAllocator<'a> { debug_assert!(region.contains(&sub_region2)); // if true, the final line of the snippet will be some ^^^ that point to the region where - // the problem is. Otherwise, the snippet will have a > on the lines that are in the regon + // the problem is. Otherwise, the snippet will have a > on the lines that are in the region // where the problem is. let error_highlight_line = region.start_line == region.end_line; @@ -505,7 +505,7 @@ impl<'a> RocDocAllocator<'a> { } // if true, the final line of the snippet will be some ^^^ that point to the region where - // the problem is. Otherwise, the snippet will have a > on the lines that are in the regon + // the problem is. Otherwise, the snippet will have a > on the lines that are in the region // where the problem is. let error_highlight_line = sub_region.start_line == region.end_line; diff --git a/compiler/test_gen/src/gen_primitives.rs b/compiler/test_gen/src/gen_primitives.rs index e6a09ed781..8dad37e67d 100644 --- a/compiler/test_gen/src/gen_primitives.rs +++ b/compiler/test_gen/src/gen_primitives.rs @@ -2849,7 +2849,7 @@ fn do_pass_bool_byte_closure_layout() { ## ANY - # If succcessful, the any parser consumes one character + # If successful, the any parser consumes one character any: Parser U8 any = \inp -> diff --git a/editor/editor-ideas.md b/editor/editor-ideas.md index 404fc0f9d8..194b81c89d 100644 --- a/editor/editor-ideas.md +++ b/editor/editor-ideas.md @@ -159,7 +159,7 @@ e.g. you have a test `calculate_sum_test` that only uses the function `add`, whe * Show productivity/feature tips on startup. Show link to page with all tips. Allow not seeing tips next time. * Search friendly editor docs inside the editor. Offer to send search string to Roc maintainers when no results, or if no results were clicked. * File history timeline view. Show timeline with commits that changed this file, the number of lines added and deleted as well as which user made the changes. Arrow navigation should allow you to quickly view different versions of the file. -* Suggested quick fixes should be directly visible and clickable. Not like in vs code where you put the caret on an error until a lightbulb appears in the margin which you have to click for the fixes to apppear, after which you click to apply the fix you want :( . You should be able to apply suggestions in rapid succession. e.g. if you copy some roc code from the internet you should be able to apply 5 import suggestions quickly. +* Suggested quick fixes should be directly visible and clickable. Not like in vs code where you put the caret on an error until a lightbulb appears in the margin which you have to click for the fixes to appear, after which you click to apply the fix you want :( . You should be able to apply suggestions in rapid succession. e.g. if you copy some roc code from the internet you should be able to apply 5 import suggestions quickly. * Regex-like find and substitution based on plain english description and example (replacement). i.e. replace all `[` between double quotes with `{`. [Inspiration](https://alexmoltzau.medium.com/english-to-regex-thanks-to-gpt-3-13f03b68236e). * Show productivity tips based on behavior. i.e. if the user is scrolling through the error bar and clicking on the next error several times, show a tip with "go to next error" shortcut. * Command to "benchmark this function" or "benchmark this test" with flamegraph and execution time per line. @@ -328,8 +328,8 @@ Thoughts and ideas possibly taken from above inspirations or separate. But blind people walk with a tool and they can react much better to sound/space relations than full on visal majority does. They are acute to sound as a spatial hint. And a hand for most of them is a very sensitive tool that can make sounds in space. Imagine if everytime for the user doesnt want to rely on shining rendered pixels on the screen for a feedback from machine, we make a acoustic room simulation, where with moving the "stick", either with mouse or with key arrows, we bump into one of the objects and that produces certain contextually appropriate sound (clean)*ding* - On the each level of abstraction they can make sounds more deeper, so then when you type letters you feel like you are playing with the sand (soft)*shh*. We would need help from some sound engineer about it, but imagine moving down, which can be voice trigered command for motion impaired, you hear (soft)*pup* and the name of the module, and then you have options and commands appropriate for the module, they could map to those basic 4 buttons that we trained user on, and he would shortcut all the soft talk with click of a button. Think of the satisfaction when you can skip the dialog of the game and get straight into action. (X) Open functions! each function would make a sound and say its name, unless you press search and start searching for a specific function inside module, if you want one you select or move to next. - - Related idea: Playing sounds in rapid succession for different expressions in your program might be a high throughput alternative to stepping through your code line by line. I'd bet you quickly learn what your porgram should sound like. The difference in throughput would be even larger for those who need to rely on voice transcription. + On the each level of abstraction they can make sounds more deeper, so then when you type letters you feel like you are playing with the sand (soft)*shh*. We would need help from some sound engineer about it, but imagine moving down, which can be voice triggered command for motion impaired, you hear (soft)*pup* and the name of the module, and then you have options and commands appropriate for the module, they could map to those basic 4 buttons that we trained user on, and he would shortcut all the soft talk with click of a button. Think of the satisfaction when you can skip the dialog of the game and get straight into action. (X) Open functions! each function would make a sound and say its name, unless you press search and start searching for a specific function inside module, if you want one you select or move to next. + - Related idea: Playing sounds in rapid succession for different expressions in your program might be a high throughput alternative to stepping through your code line by line. I'd bet you quickly learn what your program should sound like. The difference in throughput would be even larger for those who need to rely on voice transcription. * Motor impariments [rant]BACKS OF CODERS ARE NOT HEALTHY! We need to change that![/neverstop] diff --git a/editor/snippet-ideas.md b/editor/snippet-ideas.md index a040fb3690..877bdc0c3b 100644 --- a/editor/snippet-ideas.md +++ b/editor/snippet-ideas.md @@ -37,7 +37,7 @@ Fish hooks are used when subvariants should be created e.g.: means + example: empty dict >> `{::}` - command: + example: sieve of erathostenes >> `inserts function for sieve of erathostenes` - + common algorithms: sieve of erathostenes, greatest common divisior, prime factorisation, A* path finding, Dijkstra's algorithm, Breadth First Search... + + common algorithms: sieve of erathostenes, greatest common divisor, prime factorisation, A* path finding, Dijkstra's algorithm, Breadth First Search... - command: current date/datetime + example: current datetime >> `now <- Time.now\n` - command: list range 1 to 5 diff --git a/editor/src/editor/ed_error.rs b/editor/src/editor/ed_error.rs index 90abd8db48..c5379ee1a1 100644 --- a/editor/src/editor/ed_error.rs +++ b/editor/src/editor/ed_error.rs @@ -16,7 +16,7 @@ use snafu::{Backtrace, ErrorCompat, Snafu}; #[snafu(visibility(pub))] pub enum EdError { #[snafu(display( - "ASTNodeIdWithoutDefId: The expr_id_opt in ASTNode({:?}) was `None` but I was expexting `Some(DefId)` .", + "ASTNodeIdWithoutDefId: The expr_id_opt in ASTNode({:?}) was `None` but I was expecting `Some(DefId)` .", ast_node_id ))] ASTNodeIdWithoutDefId { @@ -25,7 +25,7 @@ pub enum EdError { }, #[snafu(display( - "ASTNodeIdWithoutExprId: The expr_id_opt in ASTNode({:?}) was `None` but I was expexting `Some(ExprId)` .", + "ASTNodeIdWithoutExprId: The expr_id_opt in ASTNode({:?}) was `None` but I was expecting `Some(ExprId)` .", ast_node_id ))] ASTNodeIdWithoutExprId { diff --git a/editor/src/editor/mvc/ed_update.rs b/editor/src/editor/mvc/ed_update.rs index 9e12f1ae3d..24a924a452 100644 --- a/editor/src/editor/mvc/ed_update.rs +++ b/editor/src/editor/mvc/ed_update.rs @@ -1441,7 +1441,7 @@ pub mod test_ed_update { assert_insert_no_pre(ovec!["┃"], ';')?; assert_insert_no_pre(ovec!["┃"], '-')?; assert_insert_no_pre(ovec!["┃"], '_')?; - // extra space because of Expr2::Blank placholder + // extra space because of Expr2::Blank placeholder assert_insert_in_def_nls(ovec!["┃ "], ';')?; assert_insert_in_def_nls(ovec!["┃ "], '-')?; assert_insert_in_def_nls(ovec!["┃ "], '_')?; @@ -1664,7 +1664,7 @@ pub mod test_ed_update { ovec!["val = { a┃ }"], ovec!["val = { ab┃: RunTimeError }"], 'b', - )?; // TODO: remove RunTimeError, see isue #1649 + )?; // TODO: remove RunTimeError, see issue #1649 assert_insert_nls( ovec!["val = { a┃ }"], ovec!["val = { a1┃: RunTimeError }"], @@ -3476,7 +3476,7 @@ pub mod test_ed_update { // Blank is inserted when root of Expr2 is deleted assert_ctrl_shift_single_up_backspace_nls(ovec!["val = {┃ }"], ovec!["val = ┃ "])?; - // TODO: uncomment tests, once isue #1649 is fixed + // TODO: uncomment tests, once issue #1649 is fixed //assert_ctrl_shift_single_up_backspace(ovec!["{ a┃ }"], ovec!["┃ "])?; //assert_ctrl_shift_single_up_backspace(ovec!["{ a: { b }┃ }"], ovec!["┃ "])?; assert_ctrl_shift_single_up_backspace_nls( diff --git a/examples/false-interpreter/Context.roc b/examples/false-interpreter/Context.roc index b7e622717c..77022737ae 100644 --- a/examples/false-interpreter/Context.roc +++ b/examples/false-interpreter/Context.roc @@ -83,7 +83,7 @@ getCharScope = \scope -> bytes <- Task.await (File.chunk h) when List.first bytes is Ok val -> - # This starts at 1 because the first charater is already being returned. + # This starts at 1 because the first character is already being returned. Task.succeed (T val {scope & buf: bytes, index: 1 }) Err ListWasEmpty -> Task.fail EndOfData diff --git a/examples/false-interpreter/False.roc b/examples/false-interpreter/False.roc index 7f83d5cfda..716197cc99 100644 --- a/examples/false-interpreter/False.roc +++ b/examples/false-interpreter/False.roc @@ -7,7 +7,7 @@ app "false" # An interpreter for the False programming language: https://strlen.com/false-language/ # This is just a silly example to test this variety of program. # In general think of this as a program that parses a number of files and prints some output. -# It has some extra contraints: +# It has some extra constraints: # 1) The input files are considered too large to just read in at once. Instead it is read via buffer or line. # 2) The output is also considered too large to generate in memory. It must be printed as we go via buffer or line. @@ -15,7 +15,7 @@ app "false" # What I mean by that is we build a chain of all Tasks period and return that to the host. # In something like the elm architecture you return a single step with one Task. # The huge difference here is when it comes to things like stack overflows. -# In an imperative language, a few of these peices would be in while loops and it would basically never overflow. +# In an imperative language, a few of these pieces would be in while loops and it would basically never overflow. # This implementation is easy to overflow, either make the input long enough or make a false while loop run long enough. # I assume all of the Task.awaits are the cause of this, but I am not 100% sure. diff --git a/examples/false-interpreter/platform/src/lib.rs b/examples/false-interpreter/platform/src/lib.rs index 4f6f8f0092..7fd9ce5cb9 100644 --- a/examples/false-interpreter/platform/src/lib.rs +++ b/examples/false-interpreter/platform/src/lib.rs @@ -180,7 +180,7 @@ pub extern "C" fn roc_fx_getFileLine(br_ptr: *mut BufReader) -> RocStr { #[no_mangle] pub extern "C" fn roc_fx_getFileBytes(br_ptr: *mut BufReader) -> RocList { let br = unsafe { &mut *br_ptr }; - let mut buffer = [0; 0x10 /* This is intentially small to ensure correct implementation */]; + let mut buffer = [0; 0x10 /* This is intentionally small to ensure correct implementation */]; let count = br .read(&mut buffer[..]) diff --git a/roc-for-elm-programmers.md b/roc-for-elm-programmers.md index 6d9911fd8f..5d75c244d1 100644 --- a/roc-for-elm-programmers.md +++ b/roc-for-elm-programmers.md @@ -432,7 +432,7 @@ when error is # File.ReadErr possibilities FileNotFound -> ... - ReadAcessDenied -> ... + ReadAccessDenied -> ... FileCorrupted -> ... # File.WriteErr possibilities diff --git a/vendor/morphic_lib/src/analyze.rs b/vendor/morphic_lib/src/analyze.rs index 128441f884..498a2c279b 100644 --- a/vendor/morphic_lib/src/analyze.rs +++ b/vendor/morphic_lib/src/analyze.rs @@ -438,7 +438,7 @@ impl<'a> ForwardState<'a> { } let mut arg_aliases = HashSet::new(); for (heap_cell, slot_indices) in &heap_cell_slots { - // Wire up to ocurrences of the same heap cell in the argument slots + // Wire up to occurrences of the same heap cell in the argument slots for (i, &slot_i) in slot_indices.iter().enumerate() { for &slot_j in &slot_indices[..i] { arg_aliases.insert(NormPair::new(slot_i, slot_j)); diff --git a/vendor/morphic_lib/src/api.rs b/vendor/morphic_lib/src/api.rs index e9d7b6aed4..b93180764c 100644 --- a/vendor/morphic_lib/src/api.rs +++ b/vendor/morphic_lib/src/api.rs @@ -279,7 +279,7 @@ forward_trait! { /// Add a const ref expression to a block. /// /// This conceptually represents a fetch of a global constant value with static lifetime, - /// initialiazed at the beginning of the program. It is considered unsafe to perform an + /// initialized at the beginning of the program. It is considered unsafe to perform an /// in-place update on any heap cell reachable from a value returned from a const ref. fn add_const_ref( &mut self, @@ -317,7 +317,7 @@ forward_trait! { /// a value of any type is expected). fn add_terminate(&mut self, block: BlockId, result_type: TypeId) -> Result; - /// Add an expresion which creates a fresh heap cell to a block. + /// Add an expression which creates a fresh heap cell to a block. fn add_new_heap_cell(&mut self, block: BlockId) -> Result; /// Add a 'touch' expression to a block. diff --git a/vendor/morphic_lib/src/ir.rs b/vendor/morphic_lib/src/ir.rs index d283d84bed..d4934dff2e 100644 --- a/vendor/morphic_lib/src/ir.rs +++ b/vendor/morphic_lib/src/ir.rs @@ -300,7 +300,7 @@ pub(crate) struct Graph { // this must be so. exit_blocks: SmallVec<[BlockId; 1]>, ret_type: TypeId, - // Invariant: `sccs` is strored in topological order. + // Invariant: `sccs` is stored in topological order. sccs: FlatSlices, update_mode_vars: Count, callee_spec_vars: Count, diff --git a/vendor/morphic_lib/src/preprocess.rs b/vendor/morphic_lib/src/preprocess.rs index 36eccb21bd..d88dc94fcc 100644 --- a/vendor/morphic_lib/src/preprocess.rs +++ b/vendor/morphic_lib/src/preprocess.rs @@ -42,7 +42,7 @@ pub(crate) enum ErrorKind { ExpectedTupleType(String), #[error("expected union type, found type '{0}'")] ExpectedUnionType(String), - #[error("expected named type, foudn type '{0}'")] + #[error("expected named type, found type '{0}'")] ExpectedNamedType(String), #[error("tuple field index {0} out of range")] TupleFieldOutOfRange(u32),