Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

80%
+6 −0
Challenges 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...

6 answers  ·  posted 2y ago by Lundin‭  ·  last activity 1y ago by H_H‭

Question code-golf
#2: Post edited by user avatar Lundin‭ · 2023-01-02T09:19:24Z (almost 2 years ago)
Typo
  • 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 by user avatar Lundin‭ · 2022-02-04T12:19:10Z (over 2 years ago)
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

```