Other C solutions. #include "hello_world.h"
const char *hello(void)
{
return "Hello, World!";
}
Other Clojure solutions. (ns hello-world)
(defn hello [] "Hello, World!")
Other Elixir solutions. defmodule HelloWorld do
@doc """
Simply returns "Hello, World!"
"""
@spec hello :: String.t()
def hello do
"Hello, World!"
end
end
Other Elm solutions. module HelloWorld exposing (helloWorld)
helloWorld : String
helloWorld =
"Hello, World!"
Other Haskell solutions. module HelloWorld
( hello
) where
hello :: String
hello = "Hello, World!"
Other Javascript solutions. //
// This is only a SKELETON file for the 'Hello World' exercise. It's been provided as a
// convenience to get you started writing code faster.
//
export function hello() {
return "Hello, World!";
}
Other Nim solutions. proc hello*: string =
"Hello, World!"
Other Ocaml solutions. let hello = "Hello, World!"
Other Prolog solutions. % Please visit https://exercism.io/tracks/prolog/installation
% for instructions on setting up prolog.
% Visit https://exercism.io/tracks/prolog/tests
% for help running the tests for prolog exercises.
% Replace the goal below with
% your implementation.
hello_world('Hello World!').
Other Python solutions. def hello():
return "Hello, World!"
Other Racket solutions. #lang racket
(define (hello) "Hello, World!")
(provide hello)
Other Roc solutions. module [hello]
hello : Str
hello = "Hello, World!"
Other Rust solutions. // The &'static here means the return type has a static lifetime.
// This is a Rust feature that you don't need to worry about now.
pub fn hello() -> &'static str {
"Hello, World!"
}