Releases: perlang-org/perlang
v0.5.0
[0.5.0] - 2024-08-12
- The fifth public release of Perlang. This release is a major milestone for the project, as it marks the first release where interpreted mode and the REPL has been removed and the focus has shifted completely to compiled mode. While the REPL was a very nice feature, it is not yet feasible to implement it in compiled mode. We hope to bring it back in the future, but with an LLVM-powered backend (emitting native code on-the-fly).
- All changes below were made by @perlun
Breaking changes
- The REPL has been removed.
- Interpreted mode has been removed, and compiled mode is now the default; the
PERLANG_EXPERIMENTAL_COMPILATION
environment variable is no longer required. Some features are still not available in compiled mode; these will print an error or throw an exception if you attempt to use them. - The
-e
option has been removed. This was a feature that was only available in interpreted mode.
Added
Compiled mode
BigInt::pow
: Detect negative exponents and throw an exception [#450]- Implement native
ASCIIString
andUTF8String
classes [#451] - Wrap
ASCIIString
instd::shared_ptr<T>
[#453] - Add
-c
flag for "compile and assemble only" [#455] - Remove
using namespace
in generated C++ code [#458] - Add partial inline C++ support [#462]
- Detect method being redefined [#464]
- Make compiled mode be the default and drop interpreted mode [#465]
- Support ASCII-to-UTF8 string reassignment in compiled mode [#466]
- Minor test improvements [#467]
- Support string concatenation in compiled mode [#470]
- Support string+integer concatenation in compiled mode [#472]
- Support more types in
string+int
andint+string
concatenation [#473] - Fix
ASCIIString
+ASCIIString
concatenation to returnASCIIString
[#474] - Support
string+bigint
andbigint+string
concatenation [#475] - Support
string
+float/double and float/double+string
concatenation [#477] - Enable string bounds checking test [#478]
- Support
ASCIIString+string
andUTF8String+string
concatenation [#480] - Fix bug in C++ preprocessor parsing [#481]
- Add
-o
flag for overriding the compiled output path [#482] - Add
--idempotent
flag [#486] - Remove
char_at()
kludge [#493] - Add implicitly typed
int
arrays [#494] - Add explicitly typed
int[]
arrays [#496]
Changed
Data types
General
- Remove REPL code [#446]
- Remove
-e <script>
option [#447] - Remove custom
IConsole
implementations [#456] - Use
VisitorBase
everywhere applicable [#459] - Minor stdlib cleanups [#476]
- Convert
ClrType
property setter to method [#489] - Make
Initializer
property be nullable [#490]
Maintenance
Fixed
Tests
v0.4.0
[0.4.0] - 2024-03-30. The Easter Egg release. 🥚
-
The fourth public release of Perlang. The most significant change in this release is the introduction of (experimental) AOT-compiled mode, where your Perlang programs are transformed on-the-fly to native binaries. At the moment, experimental compilation is only supported on Linux. Enable it using one of the following means:
PERLANG_EXPERIMENTAL_COMPILATION=true
(environment variable)~/.perlang_experimental_compilation
(an empty file)
Once this is done, running
perlang <program.per>
should compile the program to a native binary automatically and then run the binary instead of running it using the Perlang interpreter. If you are curious, you can look atprogram.cc
to see its intermediate C++ representation. (This intermediate representation is a temporary implementation detail; the long-term plan is to compile straight to native code using LLVM.)To follow the development of the experimental compilation mode more in detail, please see issue [#406].
-
For more details on how to install Perlang on your own machine, see
https://perlang.org/download/. -
All changes below were made by @perlun
Added
Experimental compilation
- Add C++-based stdlib project [#407]
- Add first steps towards experimental compiler [#409]
- Preserve exact floating point representation [#412]
- Add
BigInt
support for compiled mode [#418] - Initial support for
**
operator in compiled mode [#420] - Use correct error message for unsupported operand types [#421]
- Support
**
forBigInt
values [#422] - Replace
BigInt
lib withlibtommath
implementation [#425] - Run more tests in compiled mode [#427]
- Implement modulo operator for
BigInt
[#432] - Support
<<
and>>
for bigint in compiled mode [#440] - Detect stdlib bundled with Perlang binaries [#444]
- Include
stdlib
in Linux-based.tar.gz
snapshots [[#445][445]]
Changed
Data types
- Implement
AsciiString
for ASCII-only strings [#377] - Implement
Utf8String
for strings with non-ASCII content [#385] - Use better format in
float
anddouble
conversion to string [#414]
General
- Enable nullability checks for the
Program
class [#386] - Use Perlang strings and native C functions for writing to stdout [#389]
Maintenance
- Bump TngTech.ArchUnitNET.xUnit from 0.5.0 to 0.10.5 [#366]
- Bump xunit from 2.4.1 to 2.4.2 [#369]
- Bump JetBrains.Annotations from 2020.2.0-eap to 2022.3.1 [#374]
- Remove Moq dependency [#380]
- Bump Microsoft.NET.Test.Sdk from 17.4.1 to 17.9.0 [#426]
- Bump Microsoft.CodeAnalysis from 4.4.0 to 4.8.0 [#428]
- Bump coverlet.collector from 1.3.0 to 6.0.1 [#430]
- Bump FluentAssertions from 6.10.0 to 6.12.0 [#434]
- Bump xunit.runner.visualstudio from 2.4.5 to 2.5.7 [#437]
- Bump xunit from 2.4.2 to 2.7.0 [#438]
- Bump TngTech.ArchUnitNET.xUnit from 0.10.5 to 0.10.6 [#442]
- Bump coverlet.collector from 6.0.1 to 6.0.2 [#443]
Fixed
- Make
int == double
use value-type semantics [#413]
Tests
v0.3.0
[0.3.0] - 2023-02-26
- The third public release of Perlang. The most notable changes are the added support for the
float
data type, and that the system has been upgraded to .NET 7. - The REPL is also noticeably nicer to use now, particularly for those of us used to bash/Emacs-like keybindings. [#354], [#356]
- API docs on the website was broken since the v0.2.0 release for unknown reasons. [#344] has more details.
- Based on community feedback, the project README was also slightly improved. [#371]
- All changes below were made by @perlun
Added
Data types
- Add support for
float
data type [#353]
General
Upgrade to .NET 7 RC1 [#347], superseded by [#351]- Upgrade
System.CommandLine
to 2.0.0-beta4.22272.1 [#350] - Upgrade to .NET 7 RTM [#351]
- Add support for
string
andIDictionary
indexing [#363]
Changed
- Quote types names in error message emitted when attempting to reassign a variable to an incoercible type. [#343]
- Use
getline.cs
for line-editing in REPL [#354] - Minor
getline.cs
improvements [#356]
Maintenance
- Bump Microsoft.CodeAnalysis from 2.6.0.0 to 4.4.0 [#358]
- Bump xunit.runner.visualstudio from 2.4.3 to 2.4.5 [#359]
- Bump Microsoft.NET.Test.Sdk from 16.7.1 to 17.4.1 [[#362][362]]
- Bump FluentAssertions from 6.4.0 to 6.10.0 [#365]
Fixed
Tests
- Continued adding more tests for functionality being added to the system. The number of tests increased from 1586 tests in the previous release to 1921 tests in version 0.2.0. This is partly caused by [#353], which added support for the
float
data type. Each primitive data type supported requires a significant number of tests to be added for the "meta-tests" to complete; these ensure that no data types get added to the system without properly defined semantics for all operator/primitive type combinations.
v0.2.0
[0.2.0] - 2022-06-11
- The second public release of Perlang. Most notable changes are the added support for
uint
andulong
data types, as well as increased test coverage for binary operators (+
,-
,*
and so forth). As of this release, our test suite covers all supported (numeric) type combinations. - All changes below were made by @perlun
Added
Data types
- Allow assignment from
int
todouble
[#300] - Add support for
uint
data type [#307] - Allow coercions from
long
to `double [#336] - Add support for
ulong
data type [#337]
Changed
- Refactor number parsing to use
*Literal
types [#308] - Make operand type checks be compile-time errors [#329]
Fixed
- Fix broken support for certain negative integer literals [#302]
- Support division between
float
andint
[#311] - Improved type combination support with binary operators [#327]
- Fix binary operator support for
int
+long
[#328]
Tests
- Greatly increased the test coverage in general. The number of tests increased from 537 tests in the previous release to 1586 tests in version 0.2.0.
- Improve coverage of binary operator type combinations [#313]
- Add test to ensure
BinaryoperatorData
covers all numeric type combinations [#316] - Add full type coverage for
+
and-
operators [#317] - Add full type coverage for
*
and/
operators [#318] - Add full type coverage for
-=
and+=
operators [#319] - Add full type coverage for
==
and!=
operators [#320] - Add full type coverage for
<
and<=
operators [#321] - Add full type coverage for
>
and>=
operators [#322] - Add full type coverage for
**
operator [#323] - Add full type coverage for
%
operator [#324] - Add full type coverage for
<<
and>>
operator [#325] - Verify expected types in binary operator tests [#326]
- De-duplicate
ReservedKeywordsTests
; improve coverage to cover all reserved words [#331] - Make
BinaryOperatorDataTests
faster [#332] - Add test for ensuring binary operators support all primitive types [#333]
v0.1.1
v0.1.0
[0.1.0] - 2022-02-27. 🇺🇦 We stand with Ukraine 🇺🇦
-
The first public release of Perlang. 🎉 Over 200 pull requests were merged to form this version. This changelog will regretfully not go into all of them, but will list some of the major achievements.
-
A basic interpreter for the Lox language was written, first in Java (by following @munificent's great tutorial), then rewritten in C# by @perlun. This provided the foundation of the Perlang code base. A stable, well-documented interpreter for a dynamic language that could be extended to provide what we wanted.
One important difference between the Lox language and Perlang as it currently stands is that Perlang doesn't support user-defined classes. I originally had support for defining classes (but not methods) in the language, but I decided to take it away because it was confusing to be able to define a class but not define methods in it as in other OOP-based languages. For now,
class
is a reserved keyword.The reason I was hesitant to add class support is that I felt that a class in Perlang would rightfully be a CLR class within the runtime, i.e. a proper .NET type. By doing it like that, it would be possible to interop between Perlang and .NET code easily; otherwise it would be hard to e.g. subclass a .NET type from Perlang and use the result as a parameter when calling a .NET/C# method. Making it be a proper, dynamically defined .NET type (with methods dynamically defined) seemed rather complex though. For now, there is also no compelling reason forcing us to add class support. User-defined functions (supported in both Lox and Perlang) are good-enough as basic building blocks for Perlang programs at this stage.
The text below tries to briefly highlight some of the features added/changed compared to the Lox code base. For the full details, see the list of merged pull requests in this release.
In addition to the features listed below, a significant effort was made to bring the project web site to a reasonable MVP state. The web site is a good entry point to the project: please help me proof-read the text and submit pull requests (or issues) if you find anything there that seems obviously wrong. There is a nice little "Improve this Doc" link on each web page that takes you right to the corresponding .md
file in the GitHub repo.
Added
Operators
- Add support for postfix increment and decrement [#17]
- Implement
**
exponential operator [#133] - Implement shift left (
<<
) and shift right (>>
) operators [#247]
Language features
- Support
int
literals in addition todouble
s [#40] - Implement support for optional typing [#54]
- Support for binary, octal and hexadecimal literals [#219, #220, #217]
- Support underscores in integer literals [#221]
- Move away from relying on dynamic for unary prefix/postfix operators [#227]
- When #40 was first implemented, the
dynamic
approach was used since it made the implementation much simpler. However, it turned out to be more and more problematic and we managed to eventually rewrite all boolean operators to use predictable, fixed type handling instead.
- When #40 was first implemented, the
- Warn on ambiguous combination of boolean operators [#256]
Data types
CI
- Add CI & config for publishing packages on each
master
commit [#20] - Use build matrix for release publishing [#244]
- Run tests on all supported platforms [#257]
Platform support
- Publish packages for
linux-x64
,osx-x64
,win-x64
[#20] - Add
osx-arm64
builds to the list of supported architectures [#136] - Add
linux-arm
support [#242] - Add
linux-arm64
support [#243]
General
Changed
and
andor
was changed to&&
and||
[#253]
Fixed
(Note: these bugs were both introduced and fixed in this version. They are noted here for the sake of completeness. The list below is a very small subset of the full list which contains no less than 60 (!) bug fixes.)
- Detect invalid numbers in the REPL [#137]
- 'System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types' when executing Perlang program from R2R binary [#199]
- 'System.OverflowException: Value was either too large or too small for a UInt64' on integer assignment [#205]
BigInteger ** BigInteger
causes TargetInvocationException [#224]- Operator '+' cannot be applied to operands of type 'System.Numerics.BigInteger' and 'double' [#226]
- Fix integer expansions to
bigint
[#234] - Make number-to-string conversions use invariant culture. [#261]
Special thanks
Thanks to @slovdahl who helped verify that the linux-arm
and linux-arm64
ports worked correctly on various Raspberry Pi devices.