We are pleased to announce the release of BoxLang 1.0.0-Beta 10! BoxLang Betas are released weekly. This is our tenth marker and we are incredibly excited to bring you a very big release. This gives us a huge push forwards towards compatibility with other engines and many more new features we have always wanted in our language. Enjoy!
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, ColdFusion, 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.
![](https://boxlang.ortusbooks.com/~gitbook/image?url=https%3A%2F%2F1598982152-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4ENvvb4b3Cmrr1qKj7y4%252Fuploads%252FL5VMJotG20gl7EIl2UeH%252Fimage.png%3Falt%3Dmedia%26token%3D6c520ec3-8c4c-4aa8-a07b-ad82f37ef3e0&width=768&dpr=4&quality=100&sign=3ccee147125d124a237a9a6e9f92d89dc2639e18b76f11912cd6ca0a69b6af06)
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-beta-10
New Features
BL-435 transpile queryGetRow() to queryRowData()
Ths is a compatibility feature for CFML engines so they can use the queryGetRow()
BIF which internally funnels to the queryRowData
()
method.
BL-436 Ini files support
CFML engines always had half baked support for working with INI files. We now have full support and a fluent way to interact with ini
files. This is really important for those building IoT solutions or interacting with micro processor devices. To get started use the boxlang installer install-bx-module bx-ini
or if using CommandBox: install bx-ini
Here is a typical ini file example:
[General]
appName=MyApplication
version=1.2.3
author=John Doe
boxlang=rocks
[Database]
host=localhost
port=5432
username=dbuser
password=dbpass
dbname=mydatabase
[Logging]
logLevel=DEBUG
logFile=/var/log/myapp.log
maxFileSize=10MB
[Features]
enableFeatureX=true
enableFeatureY=false
maxConnections=100
Here are the contributed functions in this module:
getIniFile( file )
: Reads an ini file and returns the IniFile object. If the file does not exist, it will create it.getProfileSection( iniFile, section )
: Gets a section from the ini file as a structgetProfileSections( iniFile )
: Gets all the sections from the ini file as a struct of structsgetProfileString( iniFile, section, entry )
: Gets an entry from a section in the ini file, if it does not exist, it will return an empty stringsetProfileString( iniFile, section, entry, value )
: Sets an entry in a section in the ini file, if the section does not exist, it will create itremoveProfileSection( iniFile, section )
: Removes a section from the ini fileremoveProfileString( iniFile, section, entry )
: Removes an entry from a section in the ini file
The IniFile
object is a fluent object that allows you to work with ini files in a very easy way. Here is an example of how to use it:
// Get the ini file
var iniFile = getIniFile( "test.ini" );
iniFile.createSection( "mySettings" );
// Set a string
iniFile.setEntry( "section1", "entry1", "value1" );
// Get a string
var value = iniFile.getEntry( "section1", "entry1" );
// Remove a string
iniFile.removeEntry( "section1", "entry1" );
// Remove a section
iniFile.removeSection( "section1" );
BL-437 JSStringFormat BIF
This BIF is now complete to provide JavaScript escaping when using BoxLang as the template processor:
<script>
let info = "#JSStringFormat( "An example string value with ""quoted"" 'text'" )#"
</script>
BL-439 xml component
We have now finalized XML support in BoxLang with a beautiful xml
component:
<bx:xml variable="myVar">
<root>
<foo attr="brad" />
<foo attr="luis" />
<foo attr="jon" />
<root>
</bx:xml>
BL-442 getVariable() & BL-443 setVariable()
These two functions now exist in the compat
module. It allows you to set and get variables in the variables
scope. This can also be used to retrieve dynamic variable names or set dynamic variable names:
setVariable( prepVar(), "hello" )
println( getVariable( getVar() ) )
BL-444 Add getClientVariablesList() to compat
Legacy client
scope support added to the compat module
BL-448 New getDescendantsOfType() AST method with predicate
This is an internal method of our contexts to allow us to retrieve things easily with predicates.
BL-449 Implement single quote escapes in queries and preserveSingleQuotes
We thought this was going to be an easy one. preserveSingleQuotes()
is now built for the core language to assist when building dynamic SQL and escaping quotes smartly.
BL-450 Allow .cfm and .cfs files from the boxlang CLI runner
Our BoxLang runner now allows for the CLI execution of cfm
and cfs
files directly along side BoxLang templates.
boxlang task.cfm
boxlang script.cfs
BL-440 Add isNumericDate BIF
This BIF is now in the core thanks to a client migration.
BL-441 Add getHTTPTimeString BIF to web-support
Our web support package gets a new BIF thanks to a client migration
BL-143 Writedump label support
WriteDump in BoxLang now get beautiful labels!
![](https://boxlang.ortusbooks.com/~gitbook/image?url=https%3A%2F%2F1598982152-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4ENvvb4b3Cmrr1qKj7y4%252Fuploads%252Ffpt474NIAq8W5cqCGkzx%252Fimage.png%3Falt%3Dmedia%26token%3Dfae3d520-1525-4544-b120-4853c4e81f78&width=768&dpr=4&quality=100&sign=67a67be5&sv=1)
BL-447 java.math.BigInteger caster
We have a new caster for BigInteger and BigDecimal to help us with precise mathematics in BoxLang.
Improvements
BL-425 When doing class serialization make sure to identify which properties have `serialize=false` on them
Our serializer to binary for classes now respects the serialize
annotation on properties.
class{
// serializable
property name;
// not serializable
property boolean isLoggedIn deafult=false serializable=false
}
BL-426 content component can have body
BL-429 Enhance error messages for parsing invalid tag code
Bugs
BL-427 MalformedInputException: Input length = 1 when parsing CFC
BL-428 component detection can be tricked if there is a tag comment line starting with the word "component"
BL-432 Regression: Can't run files via BoxRunner due to new action command logic
BL-451 Sometimes trying to shutdown runtime throws NPE if it was never started fully
BL-452 pretty print visitor outputting extra " on tag catch block
BL-453 pretty print visitor doesn't handle array notation invocation
Add Your Comment