Post History
Many programming languages have the concept of keywords, special syntax items that are not just identifiers reserved by some library, but words reserved by the language itself. The challenge is to...
Question
code-golf
#2: Post edited
- Many programming languages have the concept of _keywords_, special syntax items that are not just identifiers reserved by some library, but words reserved by the language itself.
- The challenge is to write a minimal program for a language with such keywords, with as few characters as possible (code golf), while at the same time using every single keyword from the language.
The program need not do anything meaningful or perform any particular input/output, but it most compile cleanly with a conforming compiler and execute without run-time errors/crashes. Non-standard extensions and alternative non-standard keywords shall not be used.- ---
- Example, all keywords from the C language (as per the current C17 standard):
- ```c
- auto
- break
- case
- char
- const
- continue
- default
- do
- double
- else
- enum
- extern
- float
- for
- goto
- if
- inline
- int
- long
- register
- restrict
- return
- short
- signed
- sizeof
- static
- struct
- switch
- typedef
- union
- unsigned
- void
- volatile
- while
- _Alignas
- _Alignof
- _Atomic
- _Bool
- _Complex
- _Generic
- _Imaginary
- _Noreturn
- _Static_assert
- _Thread_local
- ```
- Many programming languages have the concept of _keywords_, special syntax items that are not just identifiers reserved by some library, but words reserved by the language itself.
- The challenge is to write a minimal program for a language with such keywords, with as few characters as possible (code golf), while at the same time using every single keyword from the language.
- The program need not do anything meaningful or perform any particular input/output, but it must compile cleanly with a conforming compiler and execute without run-time errors/crashes. Non-standard extensions and alternative non-standard keywords shall not be used.
- ---
- Example, all keywords from the C language (as per the current C17 standard):
- ```c
- auto
- break
- case
- char
- const
- continue
- default
- do
- double
- else
- enum
- extern
- float
- for
- goto
- if
- inline
- int
- long
- register
- restrict
- return
- short
- signed
- sizeof
- static
- struct
- switch
- typedef
- union
- unsigned
- void
- volatile
- while
- _Alignas
- _Alignof
- _Atomic
- _Bool
- _Complex
- _Generic
- _Imaginary
- _Noreturn
- _Static_assert
- _Thread_local
- ```
#1: Initial revision
Keyword golfing
Many programming languages have the concept of _keywords_, special syntax items that are not just identifiers reserved by some library, but words reserved by the language itself. The challenge is to write a minimal program for a language with such keywords, with as few characters as possible (code golf), while at the same time using every single keyword from the language. The program need not do anything meaningful or perform any particular input/output, but it most compile cleanly with a conforming compiler and execute without run-time errors/crashes. Non-standard extensions and alternative non-standard keywords shall not be used. --- Example, all keywords from the C language (as per the current C17 standard): ```c auto break case char const continue default do double else enum extern float for goto if inline int long register restrict return short signed sizeof static struct switch typedef union unsigned void volatile while _Alignas _Alignof _Atomic _Bool _Complex _Generic _Imaginary _Noreturn _Static_assert _Thread_local ```