Releases: samarium-lang/Samarium
Releases · samarium-lang/Samarium
Samarium 0.6.2
Samarium 0.6.1
Changed
- Rewrote REPL config handling to not use the
configzen
library
Samarium 0.6.0
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
andmath.min
now work with varargsString+
-String
~Table
- The REPL now automatically displays most expressions
Changed
String ++ -Number
now throws a type error (ambiguous operation)
Fixed
- Fixed function conversion when
@export
ing - 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 forndigits
- 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
Fixed
- Fixed entrypoint argc check template
Samarium 0.5.2
Fixed
- Corrected
types.Number
type alias name
Samarium 0.5.1
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
Added
collections.Queue
now supports membership checkingcollections.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
anditer.map
now adapt to functions based on their number of parametersmath.is_int
math.ceil
math.floor
math.round
math.to_bin
(to replaceInteger$
)- Number type (in place of the Integer type):
- supports floats
x$
now floors the numberx -- 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 ofx
with duplicates removedx -- y
("difference") tries removing elements ofy
fromx
, even if they're not presentx --- y
removes all duplicates ofy
inx
x | y
("union") creates an array with elements that appear in eitherx
ory
(duplicates possible)x & y
("intersection") creates an array with elements that appear in bothx
andy
(duplicates possible)x ^ y
("symmetric difference") creates an array with elements that appear in eitherx
ory
, but not both (duplicates possible)
- Slices are now hashable
String -- String
(oldString - String
behavior)String++
(equivalent toString ++ /\
)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 slicesString - 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'sbool
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 sequencesType(a) != B
no longer yields incorrect resultsUserAttrs
can no longer show up when usingx!?
- 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
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 formath.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
Type
s 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
- Replaced
- 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
Slice
s fromType
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()
(usecollections.Set.items
)- English special method names
iter.zip
(use the><
operator)iter.enumerate
(use the><
operator with<<>>
)- Some dead code :)
string.format
(useString
's---
operator)
Also big thanks to @qexat & @Celeo for code improvements! ❤️
Samarium 0.3.1
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
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 tokeniter.range
(use slices)iter.sort
(useiter.sorted
)