1. Home
  2. Explore
  3. Computer Science
  4. Crust Programming Language

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Crust Programming Language

  • 59Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Crust Principles
Crust is described as a variant of Rust that fully embraces
rather than Rust's usual safety restrictions.

59 questions

  1. 1
    Crust is described as a variant of Rust that fully embraces
    _____
    rather than Rust's usual safety restrictions.
    Hint

    Think of operations involving raw pointers and minimal compiler-enforced guarantees.

    Answer

    unsafe

  2. 2
    In Crust, every function is required to be
    _____
    .
    Hint

    This keyword indicates that the function may perform operations requiring manual safety reasoning.

    Answer

    unsafe

  3. 3
    Crust avoids references and instead uses only
    _____
    .
    Hint

    These are explicitly manipulated memory addresses.

    Answer

    pointers

  4. 4
    Crust does not use the standard library; it relies on
    _____
    instead.
    Hint

    This is the C system library interface.

    Answer

    libc

  5. 5
    The stated default-mutability rule in Crust was described as
    _____
    rather than a firmly established mandatory rule.
    Hint

    The speaker considered possibly removing this rule later.

    Answer

    optional

  6. 6
    Crust is intended to make Rust more comfortable for developers accustomed to programming in
    _____
    .
    Hint

    The language uses pointers and libc in a way familiar to these developers.

    Answer

    C

  7. 7
    The session explicitly warned that this unsafe Rust variant should not be used for
    _____
    applications.
    Hint

    These applications require strong safety guarantees.

    Answer

    security critical

  8. 8
    The programming activity was characterized primarily as
    _____
    programming rather than production software development.
    Hint

    It was undertaken for experimentation and enjoyment.

    Answer

    recreational

  9. 9
    Before C, Ken Thompson created the
    _____
    programming language.
    Hint

    Its name precedes C alphabetically.

    Answer

    B

  10. 10
    The name C was explained as referring to its position after
    _____
    in the sequence of languages.
    Hint

    C comes immediately after this letter.

    Answer

    B

  11. 11
    B was characterized as a genuinely
    _____
    language because it is no longer used in practice.
    Hint

    This contrasts with languages such as COBOL that remain alive through legacy code.

    Answer

    dead

  12. 12
    The available B documentation was described as a user
    _____
    written by Ken Thompson.
    Hint

    It explains the language and provides example programs.

    Answer

    reference

  13. 13
    B programs look similar to C programs, but they generally do not specify variable
    _____
    .
    Hint

    The language was described as having only one general data category.

    Answer

    types

  14. 14
    The single type described for B is a machine
    _____
    .
    Hint

    It represents the machine's natural word-sized value.

    Answer

    word

  15. 15
    In B, variables are generally defined as variables of type
    _____
    .
    Hint

    This is the language's only general data type.

    Answer

    word

  16. 16
    B supports the keyword
    _____
    for variables whose storage is automatically managed with function scope.
    Hint

    The keyword later appeared in C as well.

    Answer

    auto

  17. 17
    The B reference was reported to be approximately
    _____
    pages long.
    Hint

    The number is a little over twenty.

    Answer

    21

  18. 18
    Automatic storage is allocated for each
    _____
    of a function.
    Hint

    This means each time the function is called.

    Answer

    invocation

  19. 19
    Automatic storage in the discussion was identified with
    _____
    storage.
    Hint

    It is allocated and released as functions enter and leave.

    Answer

    stack

  20. 20
    External storage is allocated before
    _____
    begins.
    Hint

    This storage exists before the program starts running.

    Answer

    execution

  21. 21
    External variables are available to
    _____
    functions.
    Hint

    Their visibility is broader than that of internal variables.

    Answer

    any and all

  22. 22
    Internal storage is local to a function but remains available across all
    _____
    of that function.
    Hint

    This behavior resembles a static local variable.

    Answer

    invocations

  23. 23
    The B keyword used to declare external names is
    _____
    .
    Hint

    It tells the compiler that a name is defined elsewhere.

    Answer

    extern

  24. 24
    B declarations must appear before the first
    _____
    of the declared variable.
    Hint

    The declaration needs to precede the variable's first appearance in an expression.

    Answer

    use

  25. 25
    An external name must also be externally
    _____
    somewhere in the program.
    Hint

    A declaration alone does not provide the implementation or storage.

    Answer

    defined

  26. 26
    The B example used the external function
    _____
    to output a character.
    Hint

    This function also exists in the C runtime library.

    Answer

    putchar

  27. 27
    The value passed to putchar was interpreted as an integer containing an
    _____
    code.
    Hint

    This character encoding maps integers to printable characters.

    Answer

    ASCII

  28. 28
    In a minimal Crust program, disabling the standard library requires the crate-level attribute
    _____
    .
    Hint

    The attribute name combines the word for absence with the standard library abbreviation.

    Answer

    no_std

  29. 29
    A Crust program without the usual Rust entry-point setup may require the crate-level attribute
    _____
    .
    Hint

    This indicates that the normal Rust-generated main entry point is not being used.

    Answer

    no_main

  30. 30
    To link Crust code with C functions, the declarations were marked as
    _____
    C.
    Hint

    This specifies the foreign calling convention and external linkage.

    Answer

    extern

  31. 31
    The attribute used to prevent Rust from changing an exported symbol's name was
    _____
    .
    Hint

    It preserves the exact linker-visible name.

    Answer

    no_mangle

  32. 32
    The build process first emitted an
    _____
    file instead of directly producing the final executable.
    Hint

    This intermediate file contains compiled machine code for later linking.

    Answer

    object

  33. 33
    The C implementation file was compiled with GCC's
    _____
    option to produce an object file.
    Hint

    This option compiles without linking a final executable.

    Answer

    -c

  34. 34
    To include implementations from the single-header C library, the macro
    _____
    was defined.
    Hint

    The macro name combines the library name with the word indicating that definitions should be emitted.

    Answer

    knob implementation

  35. 35
    The C structure layout expected by foreign code was requested with the representation
    _____
    .
    Hint

    This representation makes the Rust structure compatible with C layout conventions.

    Answer

    C

  36. 36
    The string builder used in the project was described as a dynamic
    _____
    .
    Hint

    It stores a growable sequence of elements and tracks count and capacity.

    Answer

    array

  37. 37
    The first major phase of a compiler highlighted in the session was
    _____
    .
    Hint

    This phase converts source characters into lexical units.

    Answer

    tokenization

  38. 38
    The library selected for tokenizing the B source was
    _____
    .
    Hint

    It is an existing C lexer that can be integrated through FFI.

    Answer

    STB Lex

  39. 39
    A lexer return value of zero was used to indicate
    _____
    .
    Hint

    This signals that no more tokens remain.

    Answer

    end of file

  40. 40
    Tokens with values less than 256 were treated as individual
    _____
    characters.
    Hint

    Their numeric values correspond directly to character codes.

    Answer

    ASCII

  41. 41
    The lexer stored identifier text in a dedicated
    _____
    store.
    Hint

    This buffer preserves the spelling of names recognized by the lexer.

    Answer

    string

  42. 42
    The compiler's helper for checking that the next token has a required value was called
    _____
    .
    Hint

    It reports an error when the received token differs from the required one.

    Answer

    expect

  43. 43
    The compiler reported the source file, line number, and character
    _____
    when diagnosing errors.
    Hint

    This identifies the position within a line.

    Answer

    offset

  44. 44
    The first compiler version intentionally implemented only a small
    _____
    of the B language.
    Hint

    It was not intended to support the entire language in one session.

    Answer

    subset

  45. 45
    The compiler was developed incrementally by first compiling a simple example and then adding more
    _____
    .
    Hint

    Each new capability expanded the initial minimal compiler.

    Answer

    features

  46. 46
    The initial B compiler represented local variables as storage allocated on the
    _____
    .
    Hint

    This storage is adjusted when entering and leaving a function.

    Answer

    stack

  47. 47
    The stack pointer register used to allocate space for local variables on x86-64 was
    _____
    .
    Hint

    Its name begins with R and ends with the abbreviation for stack pointer.

    Answer

    RSP

  48. 48
    The register used as a stable reference point for local-variable offsets was
    _____
    .
    Hint

    This register is commonly called the base or frame pointer.

    Answer

    RBP

  49. 49
    The x86-64 function prologue saved the old
    _____
    before establishing a new frame base.
    Hint

    The same register was restored in the function epilogue.

    Answer

    RBP

  50. 50
    In the simplified compiler, each B word occupied
    _____
    bytes on x86-64.
    Hint

    A 64-bit word contains this many bytes.

    Answer

    8

  51. 51
    Under the x86-64 calling convention used, the first integer argument was placed in register
    _____
    .
    Hint

    This is the first register in the sequence used for integer arguments.

    Answer

    RDI

  52. 52
    The generated B compiler used the C runtime so that functions such as putchar could be called through
    _____
    .
    Hint

    This library supplies standard C runtime functions.

    Answer

    libc

  53. 53
    The assembly backend generated output in the
    _____
    format for x86-64 object files.
    Hint

    This executable and linkable format is common on Unix-like systems.

    Answer

    ELF

  54. 54
    The assembly directive used to place executable instructions in the code section was
    _____
    .
    Hint

    It introduces a named region such as text.

    Answer

    section

  55. 55
    The procedure linkage table, abbreviated
    _____
    , can be used to call external functions in position-independent code.
    Hint

    It is a table used for indirect linkage to external procedures.

    Answer

    PLT

  56. 56
    The global offset table, abbreviated
    _____
    , supports access patterns used in position-independent code.
    Hint

    It stores addresses or offsets for globally referenced symbols.

    Answer

    GOT

  57. 57
    The program exited with a value returned through the x86-64 register
    _____
    .
    Hint

    This register is conventionally used for integer return values.

    Answer

    RAX

  58. 58
    The completed prototype supported recursive calls because it could generate multiple
    _____
    and call them by name.
    Hint

    A recursive program invokes the same kind of callable unit from within itself.

    Answer

    functions

  59. 59
    The compiler initially handled a function with one argument by loading that argument into the first calling-convention
    _____
    .
    Hint

    The specific register used was RDI.

    Answer

    register

1 of 59
Question 1 of 59

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent