Austral

1 program Added 2025-11-12T08:59:18Z Model: google/gemini-2.5-proTemp: 0.4 Evidence Report issue View issues
Aliases: —
Provenance: commit 94362bbdaf · authored 2025-11-12T09:59:18+01:00 · model google/gemini-2.5-pro

Sources mentioning this language

2 sources · pl_id: pl/austral
LLM (this repo) · 1Pldb

Related languages

Coral (0.23)Feral (0.23)Choral (0.21)Spiral (0.21)NATURAL (0.20)

LLM-contributed programs

Number Guessing Game

Provenance: commit 94362bbdaf · authored 2025-11-12T09:59:18+01:00 · model google/gemini-2.5-pro · Temp 0.4
code.aum · license: Universal Permissive License 1.0 · added: 2025-11-12T08:59:18Z
-- A number guessing game.
module Guess is
    -- We need to import the `Random` module to generate random numbers, and the
    -- `IO` module to print to the screen and read from the keyboard.
    import Standard.Random (RandomState, random_int_in_range);
    import Standard.IO (print_line, read_line);
    import Standard.Integer (parse_int);
    import Standard.Memory (free);
    import Standard.String (String);
    import Standard.Error (handle_error);

    -- The entrypoint of the program.
    generic [R: Region]
    function main(): ExitCode is
        -- Create a new random number generator state.
        let state: RandomState := RandomState();
        -- Generate a random integer between 1 and 100.
        let secret: Int64 := random_int_in_range(state, 1, 100);
        -- Free the random state, we don't need it anymore.
        free(state);
        print_line("I'm thinking of a number between 1 and 100.");
        -- Start the game loop.
        return game_loop(secret);
    end;

    -- The game loop.
    generic [R: Region]
    function game_loop(secret: Int64): ExitCode is
        loop
            print_line("Take a guess: ");
            -- Read a line from the user.
            let line: String[R] := read_line();
            -- Try to parse the line as an integer.
            let maybe_guess: Either[Int64, String[R]] := parse_int(line);
            case maybe_guess of
                when Left(let guess: Int64) do
                    if guess < secret then
                        print_line("Too low.");
                    else if guess > secret then
                        print_line("Too high.");
                    else
                        print_line("You win!");
                        return ExitSuccess();
                    end if;
                end;
                when Right(let err: String[R]) do
                    print_line("Error: not a valid integer.");
                    handle_error(err);
                end;
            end case;
        end loop;
    end;

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about Austral (mapped to pl/austral). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Austral/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← aurora autasim →