Skip to content

Hello World

The simplest Ragul program — assign a string and print it.

program-ours-effect
    greeting-into  "Hello, World!"-it.
    greeting-print-doing.
program-nk-hatás
    üdvözlet-be  "Helló, világ!"-t.
    üdvözlet-képernyőre-va.

Run it:

ragul run examples/hu/01_hello.ragul
# or
ragul futtat examples/hu/01_hello.ragul

Output:

Hello, World!

What's happening

  • program-ours-effect (program-nk-hatás) — declares an effect scope named program. The -effect / -hatás suffix marks it as eager: everything inside executes in order, top to bottom.
  • greeting-into "Hello, World!"-it. — assigns the string into the root greeting. The compiler infers type Szöveg (string).
  • greeting-print-doing. — pipes greeting to the -print (képernyőre) channel and executes it with -doing (-va).

Variation — with concatenation

program-ours-effect
    name-into     "Ragul"-it.
    greeting-into "Hello, "-it.
    output-into   greeting-name-concat-it.
    output-print-doing.
program-nk-hatás
    név-be  "Ragul"-t.
    üdvözlet-be  "Helló, "-t.
    kimenet-be  üdvözlet-név-összefűz-t.
    kimenet-képernyőre-va.

Output:

Hello, Ragul

The -concat / -összefűz suffix concatenates two strings. The second string is passed inline in the chain: greeting-name-concat-it reads as "greeting, concatenated with name".


Download — English · Download — Hungarian