The latest release of BoxLang, Beta 23, marks a significant step forward in our journey to create the ultimate dynamic language for the JVM. Packed with powerful new features, important bug fixes, and thoughtful optimizations, this update is designed to make your development experience smoother, faster, and more reliable, especially after now starting to take 100s of comments and bug reports from our community.
Modularity takes center stage in this release with the ability to define BoxLang components (aka Tags) within modules and a new version-checking mechanism that ensures module compatibility. Database interactions are now more intuitive with enhancements to the Generic JDBC Driver, and the introduction of the getSemver()
function brings a robust tool for managing semantic versioning with precision and ease.
Debugging and performance have also seen major improvements. The dump
function now outputs directly to the console in scripting contexts, simplifying debugging workflows, while significant optimizations in functions like len()
and the DateTimeCaster
improve execution speed and efficiency. We've also addressed critical issues around argument handling, JDBC URL creation, and logging performance, ensuring a more stable and predictable environment for your applications.
Please continue to test your applications as we continue to push forwards towards stable release this winter.
What is BoxLang?
BoxLang is a modern dynamic JVM language that can be deployed on multiple runtimes: operating system (Windows/Mac/*nix/Embedded), web server, lambda, iOS, android, web assembly, and more. BoxLang combines many features from different programming languages, including Java, CFML, Python, Ruby, Go, and PHP, to provide developers with a modern and expressive syntax.
It is also a drop-in replacement for Adobe ColdFusion and Lucee Engines.
How to get started?
Visit our docs at https://boxlang.ortusbooks.com and get coding today. If you want to try it out on the web then go to our online REPL at https://try.boxlang.io. You can also checkout our YouTube playlist: https://www.youtube.com/playlist?list=PLNE-ZbNnndB-40LvAbeSeT2Oi3V2gm_B8
Release Notes
Here are the latest release notes: https://boxlang.ortusbooks.com/readme/release-history/1.0.0-beta23
đ New Features
- Component in BX for Modules (BL-750)
Modules in BoxLang just got a serious upgrade! You can now build components for BoxLang using BoxLang. No more Java ma!
/**
* This is a BoxLang only Component
*
* Annotations you can use on a component:
* <pre>
* // The alias of the Component, defaults to the name of the Class
* @BoxComponent 'myComponentAlias'
* @BoxComponent [ 'myComponentAlias', 'anotherAlias' ]
* @AllowsBody [boolean=false]
* @RequiresBody [boolean=false]
* </pre>
*
* The runtime injects the following into the variables scope:
* - boxRuntime : BoxLangRuntime
* - log : A logger
* - functionService : The BoxLang FunctionService
* - interceptorService : The BoxLang InterceptorService
* - moduleRecord : The ModuleRecord instance
*
* The runtime also injects the following helpers into the variables scope:
* - newBuffer() : Create and return a new StringBuffer
* - newBuilder() : Create and return a new StringBuilder
* - processBody( context, body, [buffer] ) : Process the body of a component
* - getName() : Get the name of the component
*/
@BoxComponent 'HolaComponent'
@AllowsBody true
@RequiresBody false
class{
/**
* The execution of this Component
*
* <pre>
* <bx:holaComponent>This is my output</bx:holaComponent>
* </pre>
*
* @param context The context of the execution (IBoxContext)
* @param attributes The attributes of the component that were passed in
* @param body The body of the component that you can pass to `processBody(context, body, [buffer])` for execution and buffer retreival
* @param executionState The execution state of the component. Each component get's one as an isolated state.
*
* @return A BodyResult instance or null for a default result return.
*/
function invoke( required context, Struct attributes, any body, Struct executionState ){
// A buffer to capture the body output
var buffer = newBuffer();
var bodyResult = processBody( context, body, buffer );
// // If there was a return statement inside our body, we early exit now
if ( bodyResult.isEarlyExit() ) {
return bodyResult;
}
// // reverse the buffer contents and place into a string
var newContent = buffer.reverse().toString();
// // output it to the page buffer
context.writeToBuffer( newContent );
}
}
- Module Compatibility Check (BL-768)
TheModuleService
now includes a powerful compatibility check for the "boxlang" version in yourbox.json
. This ensures that your modules are running on a supported version of BoxLang, avoiding unexpected runtime issues. Just add theminimumVersion
to thebox.json
under theboxlang
section and it will tell the Module Service which supported minimum version your module will work on.
"boxlang": {
"minimumVersion": "1.0.0",
"moduleName": "test",
}
- Generic JDBC Driver Enhancement (BL-771)
We've added a default URL delimiter to the Generic JDBC Driver. This improvement makes BoxLang more adaptable to various database configurations, simplifying JDBC URL handling for databases with unique delimiter requirements. - New
getSemver()
BIF (BL-777)
Introducing thegetSemver()
built-in function! You can now quickly parse or construct semantic versioning (semver) strings and work with them asSemver
objects for enhanced version management. The new BIF will parse and give you aSemver
object to work with. You can also use it to build fluent semantic version strings.
var version = GetSemver( "1.2.3-alpha+20151212" )
var version = GetSemver( "1.2.3-alpha" )
var version = GetSemver( "1.2.3" )
var version = GetSemver( "1.2.3+20151212" )
var version = GetSemver( "1.2.3-alpha.1" )
var version = GetSemver( "1.2.3-alpha.beta" )
var version1 = GetSemver( "1.2.3" )
var version2 = GetSemver( "1.2.4" )
var version3 = GetSemver( "1.3.0" )
version1.compare( version2 ); // -1
version1.compare( version3 ); // -1
version2.compare( version3 ); // -1
var version = GetSemver().withMajor( 1 ).withMinor( 2 ).withPatch( 3 ).withPreRelease( "alpha" ).toSemver()
var versionString = GetSemver().withMajor( 1 ).withMinor( 2 ).withPatch( 3 ).withPreRelease( "alpha" ).toString()
đ§ Improvements
- Console Output for
dump
in Scripting Contexts (BL-769)
Debugging just got easier! By default, thedump
function now outputs to the console when running in scripting contexts, making it seamless to debug CLI scripts. - Optimized
len()
Function (BL-770)
Thelen()
function is now smarter and faster! We've removed unnecessary date parsing, resulting in better performance.
đ Tasks
- Query Options Completion (BL-116)
We've implemented unfinished query options, giving you more control and flexibility when working with data queries.
đ Bug Fixes
abort
incfdump
Tag (BL-761)
Resolved an issue where usingabort
in conjunction with thecfdump
tag caused unexpected errors.- Whitespace Handling in HTTP Responses (BL-763)
Improved handling of whitespace in responses where theContent-Type
header was not yet set, ensuring better compatibility with various HTTP clients. - Positional vs Named Arguments (BL-765)
Fixed inconsistent behavior when handling arguments passed by position versus named. - Invalid JDBC URLs (BL-772)
Corrected the handling of thedsn
key for JDBC drivers, ensuring compatibility withcfconfig
replacements and producing valid JDBC URLs. - Improved DateTime Performance (BL-774)
Enhanced the performance of theDateTimeCaster
andDateTime
object instantiation when working with strings. - Endless Recursion in
onSessionStart()
(BL-775)
Addressed an issue where theonSessionStart()
event could cause infinite recursion under certain conditions. debugmode
inboxlang.json
(BL-776)
Fixed a problem where thedebugmode
flag was not being utilized as expected.- Servlet Debug Mode Reconfiguration (BL-778)
Resolved issues with reconfiguring debug mode in servlet-based environments. - Logging Performance (BL-779)
Overhauled theLoggingInterceptor
to prevent inefficient recreation of appenders and loggers, especially under heavy stress. - Missing
application
Argument in Logging (BL-780)
Thewritelog
andlog
components now properly support theapplication
boolean argument.
Why Upgrade?
This release has powerful new features, performance enhancements, and critical bug fixes. Whether you're a developer building complex applications or managing modular systems, Beta 23 makes your BoxLang experience smoother and more efficient.
Ready to dive in? đ Update to Beta 23 now and take your BoxLang projects to the next level!
Add Your Comment