Skip to content

Latest commit

 

History

History
91 lines (75 loc) · 6.76 KB

v0.1.0.md

File metadata and controls

91 lines (75 loc) · 6.76 KB

[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 to doubles [#40]
  • 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.
  • Warn on ambiguous combination of boolean operators [#256]

Data types

  • Add long datatype [#210]
  • Add bigint type [#238]

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

  • Build with .NET 5.0 [#126]
  • Upgrade to .NET 6 [#223]

Changed

  • and and or 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.