mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
Correct minor spelling mistakes
This commit is contained in:
parent
f37853f688
commit
f6d055dc62
39 changed files with 63 additions and 63 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -108,7 +108,7 @@ pub enum Expr2 {
|
|||
},
|
||||
Closure {
|
||||
args: PoolVec<(Variable, NodeId<Pattern2>)>, // 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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Lowercase, Variable>`
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 });
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
##
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<Lowercase, Variable>`
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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<StrSegment>) -> Expr {
|
||||
use StrSegment::*;
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -82,7 +82,7 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg> 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<X86_64GeneralReg, X86_64FloatReg> 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<X86_64GeneralReg, X86_64FloatReg> 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<X86_64GeneralReg, X86_64FloatReg> for X86_64WindowsFastcall {
|
|||
Layout::Struct(&[]) => {}
|
||||
x => {
|
||||
return Err(format!(
|
||||
"Loading args with layout {:?} not yet implementd",
|
||||
"Loading args with layout {:?} not yet implemented",
|
||||
x
|
||||
));
|
||||
}
|
||||
|
|
|
@ -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>;
|
||||
|
||||
|
|
|
@ -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>,
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 ->
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -37,7 +37,7 @@ Fish hooks are used when subvariants should be created e.g.: <collection> means
|
|||
+ example: empty dict >> `{::}`
|
||||
- command: <common algorithm>
|
||||
+ 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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ pub extern "C" fn roc_fx_getFileLine(br_ptr: *mut BufReader<File>) -> RocStr {
|
|||
#[no_mangle]
|
||||
pub extern "C" fn roc_fx_getFileBytes(br_ptr: *mut BufReader<File>) -> RocList<u8> {
|
||||
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[..])
|
||||
|
|
|
@ -432,7 +432,7 @@ when error is
|
|||
|
||||
# File.ReadErr possibilities
|
||||
FileNotFound -> ...
|
||||
ReadAcessDenied -> ...
|
||||
ReadAccessDenied -> ...
|
||||
FileCorrupted -> ...
|
||||
|
||||
# File.WriteErr possibilities
|
||||
|
|
2
vendor/morphic_lib/src/analyze.rs
vendored
2
vendor/morphic_lib/src/analyze.rs
vendored
|
@ -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));
|
||||
|
|
4
vendor/morphic_lib/src/api.rs
vendored
4
vendor/morphic_lib/src/api.rs
vendored
|
@ -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<ValueId>;
|
||||
|
||||
/// 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<ValueId>;
|
||||
|
||||
/// Add a 'touch' expression to a block.
|
||||
|
|
2
vendor/morphic_lib/src/ir.rs
vendored
2
vendor/morphic_lib/src/ir.rs
vendored
|
@ -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<SccId, SccKind, BlockId>,
|
||||
update_mode_vars: Count<UpdateModeVarId>,
|
||||
callee_spec_vars: Count<CalleeSpecVarId>,
|
||||
|
|
2
vendor/morphic_lib/src/preprocess.rs
vendored
2
vendor/morphic_lib/src/preprocess.rs
vendored
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue