Official Golf blog
Updated on 2025-08-14
Note: This blog is a replacement for golf-lang.blogspot.com; please bookmark this page going forward.
- Golf 3.0.1: Major Golf rewrite brings no-sudo installation, better performance and many new features (2025-08-13)
- Golf now installs without sudo in a local home folder. New gginst.sh utility is used to install Golf without sudo.
- Golf is now source-only. The reason is performance and transparency; Golf generates C code for user applications, and then links (via Link Time Optimization, LTO) with Golf code. It's as if your code is directly compiled and optimized across whole program with Golf code. This can produce significant performance gains.
- To use features that depend on other FOSS libraries, you need to install those libraries and you need sudo for that, which has nothing to do with Golf. The same goes for SELinux support. You can still use Golf without those features. Note that Golf installed can install them for you, or if you use them, it will tell you exactly how to install them yourself.
- Making Golf from source will now use N parallel processes, where N is the number of available processors (you can always override this with -j option)
- Added V=1 option when compiling Golf from source to show all the details. By default now Golf makes from source in a clean manner of brevity, without clutter.
- Golf now compiles into Devel and Release binaries. Devel is much faster to develop Golf applications with, however Release includes additional optimizations (including Link-Time-Optimization, or LTO) which can speed up the run-time execution considerably.
- Golf now uses LTO for Release executables to achieve maximum performance with a whole-program optimization.
- When gcc version changes, Golf will now automatically recompile itself in order to always produce the fastest LTO object modules and executables possible - even a 1% improvement in performance matters!
- Golf now statically links its own libraries as well as a few critical-path ones (FastCGI and Libbacktrace) for better performance.
- FastCGI library source code has been significantly altered to be completely integrated and statically linked with Golf. All low-level functions (and many application-level) in this library have been rewritten, many removed, and some functions and data added for maximum performance with Golf. This resulted in about 10% overall improvement in Golf application server performance.
- Reporting errors in Golf has been completely reworked to statically link with libbacktrace (or a portion of it anyway), that reliably brings the full stack of any error (application-induced such as with report-error, application-caused such as with memory violation, or an internal Golf one) every time. Also, the performance of producing the post-mortem stack of a request and seamless continuation of the server's functioning without any interruption, has been improved many folds, since we don't execute any external programs any more to perform this task. The stack trace shows exact Golf file names and line numbers (or C files if used in extended mode).
- Added proper visual indentation for Golf's statements. Golf already has full syntax highlighting in Vim, and now it has proper indentation (automatic for statements as if-true, start-loop, run-query etc.). This makes programming faster and easier with Golf.
- Added hundreds of new functional tests for Golf.
- Refactoring of all Golf code for performance with LTO.
- Fixed man pages rendering for escape characters, and certain combination of characters (including quotes) that were not previously rendered properly. In addition to man, in case it's not installed, you can also use gg --man to the same effect.
- gg -e N now shows last N backtraces, for clarity and ease of understanding
- gg --devel is now default, using development binaries. gg --release will produce release executables.
- gg --verbose will show details of making application
- gg --client-timeout=N option will set the timeout for a client to send any data after connecting to Golf server.
- --plain-diag option in gg has been removed
- -t option in gg has been removed
- Added significant performance improvements in building Golf applications.
- New ggcli fastcgi client is added. It can be used to connect to a FastCGI server, deliver request and obtain the response. This is formerly cgi-fcgi utility from FastCGI library re-written from the ground up.
- New performance improvements in native code created, including CPU prefetching.
- Error reporting was made more robust and simpler, with the intention of being able to find error and correct it faster and easier.
- Memory subsystem for Golf has been rewritten for better performance, memory footprint and reliability. Accessing memory in Golf now has no de-referencing and the locality of accessing length of string is now direct (i.e. no need for fetching it via pointer as most languages do). As a result, memory access in Golf is now much faster.
- Rewritten parameter access for better performance, close to C's stack.
- 107 is now the exit code when Golf's program is in trouble (memory violation, unchecked negative status, Golf issue etc)
- Bug fixed in compilation with {} not recognized correctly in edge cases.
- Fixed issues when some internal memory is allocated and status of allocation unchecked.
- Fixed bugs with process-scoped memory, where it wouldn't hold value in some case, or memory wouldn't be freed when it was supposed to.
- Golf strings now support all escape sequences as in C, including Unicode characters.
- Added new format specifiers, such as %hd, %hhd and their octal and hexadecimal equivalents.
- Constant strings are now represented as native linker data-section data without any overhead, while still recognized by Golf's memory subsystem.
- Fixed bugs in comparisons in if-true in some cases.
- Added [] operators for hash and arrays to be used in string expressions.
- Improved performance of compilation of .golf files.
- Improved performance of call-handler significantly; recursive example runs 50x faster, close to C performance.
- get-app statement now has stack-depth clause to obtain current maximum stack depth.
- Added set-app statement; currently sets stack-depth to limit the number of recursions (or just plain handler calls).
- Added scan-string to search strings for other strings or characters; supports range searches within a string.
- Added default-value clause to set-param; this provides default value for a parameter in case none is provided. If no parameter is provided and no default value is given, your program will error out. This helps with writing stable well-defined applications. The default values apply only to string, number and boolean values. Parameters of other types that aren't set will raise an error.
- set-bool now uses simple equal sign (=) instead of from-condition clause. This allows easy setting of boolean variables from comparisons and boolean expressions.
- Added $ operator which allows a number (or number expression) to be automatically converted to a string in any expression.
- Added # operator which allows a string (or string expression) to be automatically converted to a number in any expression.
- Added @ operator which allows a substring to be automatically converted to a string.
- Added os-user and os-dir clauses to get-sys statement.
- Added user, application, user-directory and socket-file clauses to get-app statement.
- Added get-upload statement to get information about uploaded files in an easier and more streamlined fashion.
- Overall rewrote parts of many subsystems for higher performance.
- Improved error reporting with message being smaller and easier to read; full error report is then available if more information is needed.
- Major new Golf version coming out soon (2025-08-12)
A new version of Golf is coming soon, bringing many new features, better performance and stability.
Going forward, Golf will install locally in a user's home folder, and will not require sudo privileges.
The improvements will include stack depth control (for recursion for instance), better support for file uploading, default values for input parameters, many new string statements and expressions, new formats of output, new number expression (such as binary), better usage of hashes and arrays, much better error handling/message and run-time stack trace (using libbacktrace directly), many new optimizations such as new fast memory system, prefetching and other significant performance improvements. Also, quite a few bugs have been fixed as well.
Stay tuned for details.
Copyright (c) 2019-2025 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.