Skip to content

Releases: samarium-lang/Samarium

Samarium 0.6.2

19 Jun 10:20
8308b64
Compare
Choose a tag to compare

Changed

  • Session names now only allow a limited set of characters ([a-zA-Z0-9_\-])

Fixed

  • :session load will no longer crash on a non-existent session

Samarium 0.6.1

18 Jun 11:42
f1243d4
Compare
Choose a tag to compare

Changed

  • Rewrote REPL config handling to not use the configzen library

Samarium 0.6.0

14 Jun 21:26
80d6ca8
Compare
Choose a tag to compare

Added

  • =>! now accepts strings
  • Added an exception note for string.split
  • Allowed adding notes for !!!
  • Command system for the REPL
  • Data classes
  • Function composition
  • Made the semicolon optional for !, !!!, *, **
  • math.max and math.min now work with varargs
  • String+
  • -String
  • ~Table
  • The REPL now automatically displays most expressions

Changed

  • String ++ -Number now throws a type error (ambiguous operation)

Fixed

  • Fixed function conversion when @exporting
  • Fixed internal name of math.round
  • Fixed math.sqrt using an incorrect variable name
  • Fixed multiline string handling in the REPL
  • Fixed REPL quitting on syntax error
  • math.round now correctly provides a default value for ndigits
  • The transpiler now correctly disallows literals around identifiers
  • types.Boolean should now correctly interract with external types
  • Various minor fixes to the transpiler

Samarium 0.5.3

21 Apr 15:31
073e00f
Compare
Choose a tag to compare

Fixed

  • Fixed entrypoint argc check template

Samarium 0.5.2

21 Apr 03:45
9685e6c
Compare
Choose a tag to compare

Fixed

  • Corrected types.Number type alias name

Samarium 0.5.1

07 Apr 22:25
ac74bf6
Compare
Choose a tag to compare

Added

  • ~ is now equal to -1 when not followed by a value (e.g. ~; or ~<, but not ~x or ~/\)

Fixed

  • Implicit null is no longer placed before ~ (meaning that e.g. >~< is no longer invalid syntax)

Samarium 0.5.0

02 Apr 20:21
e5c2b60
Compare
Choose a tag to compare

Added

  • collections.Queue now supports membership checking
  • collections.Set now uses the built-in set-based Array operations (working with small sets can be up to 3,600x faster)
  • Files are now iterable
  • iter.filter and iter.map now adapt to functions based on their number of parameters
  • math.is_int
  • math.ceil
  • math.floor
  • math.round
  • math.to_bin (to replace Integer$)
  • Number type (in place of the Integer type):
    • supports floats
    • x$ now floors the number
    • x -- y now does true division rather than floor division
  • Number literals, using ` as the decimal point (meaning that it's no longer ignored by the tokenizer)
  • Nulls can now be cast to Numbers
  • Parallel assignment
  • random.sample now supports slices
  • Set-based Array operations:
    • -x returns a copy of x with duplicates removed
    • x -- y ("difference") tries removing elements of y from x, even if they're not present
    • x --- y removes all duplicates of y in x
    • x | y ("union") creates an array with elements that appear in either x or y (duplicates possible)
    • x & y ("intersection") creates an array with elements that appear in both x and y (duplicates possible)
    • x ^ y ("symmetric difference") creates an array with elements that appear in either x or y, but not both (duplicates possible)
  • Slices are now hashable
  • String -- String (old String - String behavior)
  • String++ (equivalent to String ++ /\)
  • string.split now accepts multiple separators
  • String→Number now supports scientific notation
  • string.split_lines
  • Strings can have their characters shifted by adding or subtracting Integers
  • types.Frozen

Changed

  • Flipped argument order for iter.reduce
  • Improved Array/Slice/String index typechecking
  • Improved CLI error messages
  • Improved error messages
  • Improved File.__str__
  • Improved implicit null detection
  • Improved slice transpilation
  • random.shuffle now does type checking againast slices
  • String - String now removes only the first occurence
  • The main function is no longer required
  • Two or more consecutive logical NOTs are now considered a syntax error

Fixed

  • Comments are now correctly tokenized
  • Fixed ... special method not being detected
  • Fixed Slice→Array construction
  • Fixed some yield statements crashing the transpiler
  • Functions are now correctly displayed in Arrays/Tables
  • Logical NOT (~~) no longer lets Python's bool slip in
  • Multiline strings are now correctly tokenized
  • Number ++ String is no longer detected as an invalid operation
  • Slices are now correctly detected as objects directly after scope exit
  • String.__repr__ now correctly handles escape sequences
  • Type(a) != B no longer yields incorrect results
  • UserAttrs can no longer show up when using x!?
  • Varargs functions now work correctly with recursive functions and decorators

Removed

  • collections.StaticArray
  • Integer type

The Examples page was also updated with new examples.

Thanks to @DancingGrumpyCat for improving the documentation!

Samarium 0.4.0

01 Dec 05:02
3a46ed1
Compare
Choose a tag to compare

Added

  • Array%
  • Enum%
  • io module:
    • io.Bytes
    • io.inputcast
    • io.read_until
  • iter.cycle by @Lunarmagpie
  • New import system, including:
    • import aliases
    • inline imports
  • New special method syntax
  • Partial Python Interoperability by @Endercheif
  • start parameter for math.sum, thus allowing to sum non-Integers
  • Static methods (~'* keyword)
  • string.ordinal
  • string.split() now supports separators of length greater than 1, and also handles empty separators
  • Strings of length greater than 1 can now be cast into Arrays of Integers
  • Subtracting strings
  • Support for ^L, ^[[A, ^[[B, ^[[C, ^[[D in the REPL
  • to_bit methods for:
    • Enum
    • File
    • Iterator
    • Module
  • Types and functions are now hashable
  • Zip >< operator
  • Zip type

Changed

  • Flipped argument order for:
    • iter.map
    • iter.filter
    • iter.filter_false
  • Greatly improved error messages
  • Improved collections.Set methods:
    • Replaced union with |
    • Replaced intersection with &
    • Replaced difference with -
    • Removed is_subset in place of ::, :::, >, <, >:, <: operator support
  • Improved function to string conversion
  • Improved implicit null detection
  • Improved readline error handling
  • Improved slice object detection
  • Improved string integer parsing
  • Improved variable type verification
  • Rewrote the objects (should be 10–50% faster than Samarium 0.3.1 🚀)
  • Replaced the native tokenizer with a crossandra tokenizer (~3x faster tokenization 🚀)
  • Updated to_string methods of:
    • collections.ArithmeticArray
    • collections.Deque
    • collections.Queue
    • collections.Set

Fixed

  • collections.Set.#new_set_size now takes unsized sets into consideration
  • Constructing Slices from Type now correctly works
  • Error message shown when trying to run an unknown file is now written to stderr, not stdout
  • Syntax errors now cannot be caught

Removed

  • collections.Set.values() (use collections.Set.items)
  • English special method names
  • iter.zip (use the >< operator)
  • iter.enumerate (use the >< operator with <<>>)
  • Some dead code :)
  • string.format (use String's --- operator)

Also big thanks to @qexat & @Celeo for code improvements! ❤️

Samarium 0.3.1

23 Sep 02:55
Compare
Choose a tag to compare

Fixed

  • Added missing cases for implicit null

Removed

  • Unused imports & variables in the standard library
  • Unused slots in built-in types

Samarium 0.3.0

21 Sep 18:01
Compare
Choose a tag to compare

Added

  • ** (the yield statement)
  • Array support for string.format
  • Better error messages
  • datetime module by @Endercheif
  • Enums
  • iter.chunks
  • iter.flatten
  • iter.sorted
  • Iterators
  • Memory address lookup
  • Private variables
  • snake_case support
  • Substring support for iter.find_all

Changed

  • # for assert has been replaced by !!
  • @@ now returns the Unix timestamp
  • @@@ now returns the date and time array
  • Classes can now be used as entry points
  • Improved hashing speed
  • Improved iter module speed by making it use Iterators over Arrays
  • Moved from termcolor to Dahlia
  • Rewrote the transpiler
  • Slice objects are now iterable and can be used as ranges (about 3–7x faster than iter.range 🚀)
  • Slices now use .. instead of ** for the step delimiter (<<x..y**z>> would be <<x..y..z>>)
  • Class special method names were changed to snake_case
  • Standard Library function names were changed to snake_case
  • Standard Library constant names were changed to SCREAMING_SNAKE_CASE
  • to_string method doesn't need to be defined for the object to be printable (defaults to <ClassName@MemoryAddress>)

Fixed

  • Nested slicing

Removed

  • _ as a null token
  • iter.range (use slices)
  • iter.sort (use iter.sorted)