News
Subscribe with RSS to keep up with the latest news. For site changes, see the changelog kept with the code base.
Returning multiple values: semantics
June 03, 2023This is an announcement of an upcoming feature. Please see the previous post for syntactic aspect of WCPL multiple values support.
read moreReturning multiple values: syntax
May 27, 2023This is an announcement of an upcoming feature.
read moreConditional compilation
May 25, 2023To support a wider set of scenarios where WCPL code is also compiled by a regular C compiler (which is not that hard due to WCPL being basically a subset of C), WCPL supports a limited set of conditional compilation constructs. The goal was to allow the insertion of fragments targeting various C compilers and platforms to be ignored by WCPL compiler on line-by-line basis.
read moreGeneric macros, countof()
May 24, 2023In addition to variadic macros, WCPL supports the generic
construct that is
traditionally used in so-called cover macros that expand to calls of different
functions based on types of their argument(s). The construct itself does not have
to be used in macros, although in practice it rarely appears anywhere else.
Variadic macros, countof()
May 23, 2023Although WCPL macros, having a completely different nature from C macros (expression-based vs. token-based), are limited compared to their C counterparts, some of advanced features of C macros are supported in a form that allows for interoperability. One such feature is variadic macros, i.e. macros accepting variable number of arguments.
read moreWCPL macros
May 22, 2023WCPL has a simple macro mechanism that mimics most frequent patterns used by C macro writers while being implemented via an entirely different mechanism. While C macros manipulate sequences of tokens, WCPL macros manipulate complete expressions; substitution is done on the level of abstract syntax trees. Although it makes it impossible to use some advanced tricks empoyed by C macro experts, such as introducing unpaired braces, substituting types, and glueing identifiers from individual parts, most popular macro patterns still can be employed, and made to behave in the same way between WCPL and C.
read moreFunctions with variable arguments, countof()
May 21, 2023WCPL fully supports <stdarg.h>
header defining a type and three macros for
advancing through an array of values supplied as the value of the ...
(ellipsis)
argument. Internally, this argument comes last in the argument list and has the
va_list
type, defined internally as follows:
New packaging of bundled libraries
May 08, 2023Starting with version 1.04
, all bundled libraries (see lib
folder) are embedded inside the executable,
so using them needs no -L
/-I
options. All embedded library files are logged as belonging to res://
pseudo-directory (a compressed archive inside l.c
); res://lib/
is always used as a fallback search
location, so explicit locations given via -L
have priority and can override built-in versions if
needed.
The embedded archive is generated with the help of baz
archiver (see https://github.com/false-schemers/baz);
the command is:
baz cvfz l.c --exclude="src" --exclude="lib/include/NDEBUG" --exclude="README.md" --zopfli=1000 wcpl/lib
It uses external zopfli
* compressor to get excellent compression rates for .wo
files, so the whole
built-in archive adds only about 90K to size of the executable.
* [zopfli]: https://github.com/google/zopfli
Welcome to WCPL
January 24, 2023This is a test. I will be posting some notes on WCPL design here.
read moreWant to see more? See the News Archive.