The Safe-C Programming Language

The Safe-C programming language was created in 2011.

It is the result of a single-person's effort to modernize the C programming language by applying the lessons learned since 1970 in the field of programming language design.

The language's main objectives are :
  1. speed
  2. reliability and memory safety (by checking array indexes, pointers, etc ..)

A Safe-C compiler for Windows is available at this link.

The following Safe-C tutorials are available :

The standard Safe-C library includes the following components :

aesAES cryption
arithmsimple arithmetic (abs, min, max)
base64base64 encoding
bintreebalanced binary trees (AVL)
consolewriting/reading on the dos console box
crcmd5, sha2, adler and crc checksums
dbdatabase (insert/delete/update/retrieve, transations on .db files - documentation)
desDES cryption
directxlayer for using DirectX 10 & 11
drawdraw in a memory buffer (line, circle, text, image)
exceptionexception handling
filestext and binary files, directories, disk.
ftpfile transfer protocol (ftp) - client and server
guigraphic user interface (windows, listboxes, etc ..) with a main window using component directx
hashhash table, dictionary (key to value)
httpinternet client and serveur (login, virtual html pages, ..)
imagecompression and decompression (jpg, gif, png, ..), image treatment
inifilereading of .ini files
integeroperations on large unsigned integers
linear_algebraoperations on vectors and matrices
mathmath functions (sin, cos, ..)
netcardinformation about network cards (windows-specific)
odbcinterface to sql databases using odbc 3.0
opusaudio codec (see
pdfcreate PDF files
randomgeneration of random numbers
registryread/write a key from registry (windows-specific)
rsaasymmetric encryption
serviceWindows Services - background processes (windows-specific)
shortcutprogram installation, create a shortcut on desktop
smtpsending e-mails using protocol smtp
sortingsorting of arrays (bubblesort, heapsort, quicksort)
soundmicrophone and speaker
stringscharacters and strings (strcpy, sprintf, ..)
systemsystem information (PC name, memory, nb of CPUs)
tcpipnetwork connection by tcpip (ipv4 and ipv6)
textstorage of a text composed of lines
threadparallel threads, synchronisation, timers
tracingtrace files
urlinternet url
utfconversion between ascii, utf-8 and utf-16
vpegvideo compression for nearly static images
webcaminterface for video source
winuser interface to create windows, buttons, listboxes, ..
xmlxml reader
zipdata compression : zip, unzip

as well as the following Windows API components :

win/windowslow-level interface with Windows
win/directx11low-level interface with DirectX 11
win/direct_showlow-level interface with DirectShow

The "Safe-C Reference Manual" is a normative description of the Safe-C language for people who wish to develop a Safe-C compiler.

The complete source code of the compiler and all libraries is available here

If you're interested in programming language design, I can recommend you the following books that helped me a lot :

[1] The Theory and practice of Compiler Writing (Jean-Paul Tremblay, Paul G. Sorenson) 1987 Mc Graw Hill ISBN 0-07Y66616-4, especially chapter 3 Programming-Language Design
[2] A Guide to Modula-2 (Kaare Christian) 1987 Springer Verlag ISBN 0-387-96242-5
[3] Programming Languages (Allen B.Tucker) 1987 McGrawHill ISBN 0-07-Y66617-2
[4] Der Einstieg in C (Paul M.Chirlian) 1985 Markt&Technik ISBN 3-89090-086-0
[5] Understanding Ada, a Software Engineering Approach (Gary Bray, David Pokrass) 1988 John Wiley & Sons ISBN 0-471-87833-2
[6] Software Engineering with Ada (Grady Booch) 1987 Benjamin/Cummings Publishing Company ISBN 0-8053-0604-8
[7] Ada, un apprentissage (M.Gauthier) 1989 Dunord ISBN 2-04-018836-3
[8] Reference Manual for the Ada Programming Language (United States Department of Defense) ANSI/MIL-STD-1815-A (available on the internet) (the original 1983 design is cleaner than the updated 1995 version)
[9] C# Programming Language ISO/IEC23270
[10] GNAT: The GNU Ada Compiler 1984
[11] C Programming Language JTC1/SC22/WG14 N843 1998
[12] C Programming Language ISO/IEC 9899:201x 2008
[13] The Java™ Language Specification 1996-2005
[14] An Overview of Objective Modula-2 Benjamin Kowarsch 2009
[15] C Programming Language (Brian W.Kernighan, Dennis M.Ritchie)
[16] C# Language Specification ECMA-334 4th Edition / June 2006
[17] A History of C++: 1979-1991 Bjarne Stroustrup AT&T Bell Laboratories

If you have questions or need technical support :


answer in 24 hours.


April 2013
- new component 'opus' which is a very good open-source audio codec.
- new compiler version with a new warning in case of unused 'use' clause.

July 2013
- modernisation of components 'random', 'integer', 'rsa', 'directx', 'win/windows'.

December 2013
- new component 'gui' to manage windows.

March 2014
- new component 'printer'.

May 2014
- new components 'smtp' to send emails and 'pdf' to create PDF files.

Nov 2014
- rewriting of the tutorial "Programming in Safe-C" which has now 18 chapters and 3 annexes.

Dec 2014
- new component 'odbc' for sql database.

Dec 2015
- tiny improvements in various components. Libraries are now mature and stable.

March 2016
- component DirectX 10 & 11.

May 2016
- new option to save/load a jpg with alpha channel (does not follow jpeg standard).

March 2017
- new component 'set'.

July 2017
- improvement component 'directx'.

September 2017
- new component 'hash'.

October 2017
- new component 'shortcut'.

- creation of the Planet 3D software on