Skip to main content

6 posts tagged with "release"

View All Tags

RocketLang v0.23.0 is released

ยท 4 min read

Breaking Changesโ€‹

caution

This release includes breaking changes to integer and string conversion methods.

Removed Base Parameters from .to_s() and .to_i()โ€‹

The .to_s() and .to_i() methods no longer accept optional base parameters. This functionality was broken and has been removed in favor of the new explicit .base() and .to_base() methods.

Before (v0.22.x and earlier):

num = 1234
num.to_s(2) // Would convert to binary string
num.to_s(8) // Would convert to octal string

str = "1010"
str.to_i(2) // Would parse as binary

Now (v0.23.0):

// Integers now carry base information internally
num = "0b1010".to_i() // Integer with base 2, value 10
num.to_s() // Returns "0b1010" (preserves base representation)
num.base() // Returns 2

// Use .to_base() for base conversion
num.to_base(8) // Returns 0o12 (octal integer)
num.to_base(16) // Returns 0xa (hexadecimal integer)
num.to_base(16).to_s() // Returns "0xa" (hex string)

// String parsing automatically detects and preserves base
str = "0b1010"
int_val = str.to_i() // Integer with base 2, value 10
int_val.base() // Returns 2

This change makes integer conversion behavior more predictable and fixes bugs related to base handling.

New Featuresโ€‹

Matrix Object Typeโ€‹

You can now work with matrices natively in RocketLang. This release introduces a new matrix object type with support for matrix multiplication, addressing issue #64.

// Create matrices from nested arrays
m1 = [[1, 2], [3, 4]].to_m()
m2 = [[5, 6], [7, 8]].to_m()

// Matrix multiplication
result = m1 * m2

// Element-wise operations
sum = m1 + m2
diff = m2 - m1

puts(result)
// Output:
// 2x2 matrix
// โ”Œ โ”
// โ”‚ 19.0 22.0 โ”‚
// โ”‚ 43.0 50.0 โ”‚
// โ”” โ”˜

See Matrix for more information about matrix operations and methods.

Variable Unpacking on Assignmentโ€‹

You can now unpack multiple return values directly into variables, making it easier to work with functions that return multiple values (issue #112).

// Unpack multiple values at once
a, b, c = some_function()
x, y = [1, 2]

This feature greatly simplifies code that needs to handle multiple return values.

Optional Parentheses for Control Expressionsโ€‹

Control flow expressions are now more flexible. Following issue #203, you can now omit parentheses around conditions in if, while, and other control structures.

// Both styles are now valid
if condition
puts("No parentheses needed!")
end

if (condition)
puts("Parentheses still work too!")
end

Integer Base Handlingโ€‹

Integers now carry their base information internally and provide new methods to work with different number bases:

  • .base() - Returns the base of an integer (2, 8, 10, or 16)
  • .to_base(INTEGER) - Converts an integer to a different base representation
// Integers now remember their base when created from strings
binary_num = "0b1010".to_i()
binary_num.base() // Returns 2

// Convert between bases while preserving the value
octal = binary_num.to_base(8) // Returns 0o12
hex = binary_num.to_base(16) // Returns 0xa

See Integer for more information.

Improvementsโ€‹

Better puts Behaviorโ€‹

The puts function has been improved (some would say it was broken before) to behave more consistently across different scenarios (fixing issue #170).

Bug Fixesโ€‹

Integer Downcast Preventionโ€‹

Fixed an issue where integers could be incorrectly downcast, potentially leading to data loss. Your numeric operations are now safer and more reliable.

Array .pop() Safetyโ€‹

Fixed a panic that occurred when calling .pop() on an empty array (issue #166). The method now handles empty arrays gracefully.

Dependency Updatesโ€‹

All dependencies have been updated to their latest versions, ensuring better security and performance.

Documentation Updatesโ€‹

The documentation site has been updated to Docusaurus 3.9, providing a better reading experience and improved navigation.


Check out the full changelog for a complete list of changes and contributors.

RocketLang v0.22.1 is released

ยท 2 min read

New Featuresโ€‹

elif Statementโ€‹

You can now use elif (also known as "else if") to create cleaner conditional logic with multiple conditions. This enhancement was contributed by MarkusFreitag in PR #198.

a = "test"
if a.type() == "BOOLEAN"
puts("is a boolean")
elif a.type() == "STRING"
puts("is a string")
elif a.type() == "INTEGER"
puts("is an integer")
else
puts("unknown type")
end

You can chain as many elif statements as needed, making complex conditional logic more readable and maintainable than nested if statements.

See If / elif / else for more information.

Infrastructure Updatesโ€‹

Go 1.24โ€‹

RocketLang now uses Go 1.24, bringing performance improvements and the latest language features to the interpreter.

Docusaurus 3.7 and React 19โ€‹

The documentation site has been upgraded to Docusaurus 3.7 with React 19, providing a faster and more modern documentation experience.

GoReleaser v2โ€‹

The release process has been updated to use GoReleaser v2, ensuring more reliable and efficient builds.

Security Updatesโ€‹

Several dependencies have been updated to address security vulnerabilities:

  • express: 4.18.1 โ†’ 4.19.2
  • ua-parser-js: 0.7.31 โ†’ 0.7.37
  • @babel/traverse: 7.18.10 โ†’ 7.23.4
  • json5: 2.2.1 โ†’ 2.2.3

Check out the full changelog for a complete list of changes and contributors.

RocketLang v0.22.0 is released

ยท 3 min read

We're excited to announce RocketLang v0.22.0, featuring significant improvements to array handling, better error messages, and the introduction of the rocket-range syntax for loops.

Breaking Changesโ€‹

caution

This release includes breaking changes to array method names.

Array Method Renames: .yeet() and .yoink() โ†’ .pop() and .push()โ€‹

To improve code readability and align with common programming conventions, we've renamed the array manipulation methods:

  • .yoink() is now .pop() - Removes and returns the last element
  • .yeet() is now .push() - Adds an element to the end

Before (v0.21.x and earlier):

a = [1, 2, 3]
a.yeet(4) // Add element
last = a.yoink() // Remove last element

Now (v0.22.0):

a = [1, 2, 3]
a.push(4) // Add element
last = a.pop() // Remove last element

While the old names were fun, the new names are more intuitive for developers familiar with other programming languages.

New Featuresโ€‹

Array .sum() Methodโ€‹

Calculate the sum of numeric array elements with the new .sum() method:

numbers = [1, 2, 3, 4, 5]
total = numbers.sum() // Returns 15

mixed = ['1', 2, 2.5]
mixed.sum() // Returns 5.5 (strings are converted)

The method handles integers, floats, and numeric strings automatically.

Array .join() Methodโ€‹

Join array elements into a string with an optional separator:

words = ["Hello", "RocketLang", "World"]
words.join() // Returns "HelloRocketLangWorld"
words.join(" ") // Returns "Hello RocketLang World"
words.join(", ") // Returns "Hello, RocketLang, World"

numbers = [1, 2, 3]
numbers.join("-") // Returns "1-2-3"

Rocket-Range Syntaxโ€‹

Introduce cleaner range syntax for foreach loops with the new rocket-range operator (->):

// Exclusive range (0 to 4)
foreach i in 0 -> 5
puts(i)
end

// Inclusive range (0 to 5)
foreach i in 0 => 5
puts(i)
end

// With stepping using the ^ operator
foreach i in 0 -> 10 ^ 2
puts(i) // 0, 2, 4, 6, 8
end

See Foreach for more information.

Improvementsโ€‹

Enhanced Error Messagesโ€‹

Error messages now include precise file:line:pos information, making debugging much easier. You'll see exactly where errors occur in your code with accurate line and position information.

Type Conversion Refactoringโ€‹

Internal type conversion methods have been refactored for better consistency and reliability across different object types.

Bug Fixesโ€‹

break Support in while Loopsโ€‹

The break statement now works correctly in while loops, contributed by MarkusFreitag in PR #168.

i = 0
while i < 10
if i == 5
break
end
puts(i)
i = i + 1
end

Infrastructure Updatesโ€‹

Go 1.21โ€‹

RocketLang now uses Go 1.21, bringing performance improvements and the latest language features.


Check out the full changelog for a complete list of changes and contributors.

RocketLang v0.18 is released

ยท 2 min read

Improvementsโ€‹

Add JSON Literalโ€‹

It is now possible to parse a string via the JSON literal and creating an RocketLang object (array or hash) from it.

๐Ÿš€ > JSON.parse('{"test": 123}')
=> {"test": 123.0}

๐Ÿš€ > JSON.parse('["test", 123]')
=> ["test", 123.0]

See JSON for more information.

Support for Single Quotes (')โ€‹

You can now use single-quotes to create a string additionally to the already existing double-quotes. This allows more flexibility in creating rich content like json.

'test "string" with doublequotes'

Escape double-quotes in double-quoted stringโ€‹

caution

This feature is in an early beta stage and does not support other escape sequences

Inside a string created with double-quotes " you can escape a single double-quote to create strings more flexible.

"te\"st" == 'te"st'

Removedโ€‹

next and break argumentโ€‹

This version removes the ability in break and next to submit an argument as it did not work reliable and intuitive.

In order to update your program to this version you need to make the following adjustments:

foreach i in 5
if (i == 2)
next(i)
end
puts(i)
end

foreach i in 5
if (i == 2)
break(i)
end
puts(i)
end

needs to change to:

foreach i in 5
if (i == 2)
next
end
puts(i)
end

foreach i in 5
if (i == 2)
break
end
puts(i)
end

RocketLang v0.17 is released

ยท One min read

Improvementsโ€‹

Introduce NIL Objectโ€‹

Up to this version some functions were returning NULL. Now a proper NIL object has been added which replaces all existing NULLs and is now also createable like every other object by the user.

See NIL for more information.

Removedโ€‹

NULL has been replaced by NILโ€‹

As stated above, NIL is replacing NULL.

RocketLang v0.16 is released

ยท 2 min read

Featuresโ€‹

HTTP builtin addedโ€‹

The HTTP builtin has been added which allows to create a builtin webserver and handle incoming requests.

See HTTP for more information.

Add Ability to marshal Objects to JSON Stringsโ€‹

You can now use .to_json() to various objects in order to convert them to their JSON respresentation.

See JSON for more information.

Support for Next and Breakโ€‹

Within a loop you can now use break and next for complex control flows.

foreach i in 5
if (i == 2)
next("next")
end
puts(i)
end

foreach i in 5
if (i == 2)
break("break")
end
puts(i)
end

// Returns

0
1
3
4
0
1
"break"

Allow String Multiplicationโ€‹

Support for repeating a string by a given number using the * operator has been added.

๐Ÿš€ > "test" * 2
=> "testtest"

Allow Integer Iterationโ€‹

info

Contribution by RaphaelPour

An Integer can now be iterated.

๐Ÿš€ > foreach i in 5 { puts(i) }
0
1
2
3
4
=> 5

Support for Modulo Operatorโ€‹

Modulo has been added as valid operator.

๐Ÿš€ > 5 % 3
=> 1

Support for Ternery Operatorโ€‹

It is now possible to use the ? operator.

๐Ÿš€ > 4 > 3 ? true : false
=> true

While Loopโ€‹

info

Contribution by MarkusFreitag

Support for while has been added.

๐Ÿš€ > a = 0
๐Ÿš€ > while (a != 4)
puts(a)
a = a + 1
end
// which prints
0
1
2
3
=> nil

Improvementsโ€‹

Add Shorthand to convert Float to Integerโ€‹

info

Contribution by RaphaelPour

The .plz_i() method has been added to the Float object.

๐Ÿš€ > a = 123.456
=> 123.456
๐Ÿš€ > a.plz_i()
=> 123

Fix Object Index and add support for Index Rangeโ€‹

info

Contribution by MarkusFreitag

The index operator [] has been fixed for many objects and now supports also ranges.

a = [1, 2, 3, 4, 5]
puts(a[2])
puts(a[-2])
puts(a[:2])
puts(a[:-2])
puts(a[2:])
puts(a[-2:])
puts(a[1:-2])

// should output
[1, 2]
[1, 2, 3]
[3, 4, 5]
[4, 5]
[2, 3]
[1, 2, 8, 9, 5]

Return written bytes on FILE.writeโ€‹

If you write to a file it now returns the written bytes instead of true.

Removedโ€‹