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
configzenlibrary
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.maxandmath.minnow work with varargsString+-String~Table- The REPL now automatically displays most expressions
Changed
String ++ -Numbernow throws a type error (ambiguous operation)
Fixed
- Fixed function conversion when
@exporting - Fixed internal name of
math.round - Fixed
math.sqrtusing an incorrect variable name - Fixed multiline string handling in the REPL
- Fixed REPL quitting on syntax error
math.roundnow correctly provides a default value forndigits- The transpiler now correctly disallows literals around identifiers
types.Booleanshould 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.Numbertype alias name
Samarium 0.5.1
Added
~is now equal to-1when not followed by a value (e.g.~;or~<, but not~xor~/\)
Fixed
- Implicit null is no longer placed before
~(meaning that e.g.>~<is no longer invalid syntax)
Samarium 0.5.0
Added
collections.Queuenow supports membership checkingcollections.Setnow uses the built-in set-based Array operations (working with small sets can be up to 3,600x faster)- Files are now iterable
iter.filteranditer.mapnow adapt to functions based on their number of parametersmath.is_intmath.ceilmath.floormath.roundmath.to_bin(to replaceInteger$)- Number type (in place of the Integer type):
- supports floats
x$now floors the numberx -- ynow 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.samplenow supports slices- Set-based Array operations:
-xreturns a copy ofxwith duplicates removedx -- y("difference") tries removing elements ofyfromx, even if they're not presentx --- yremoves all duplicates ofyinxx | y("union") creates an array with elements that appear in eitherxory(duplicates possible)x & y("intersection") creates an array with elements that appear in bothxandy(duplicates possible)x ^ y("symmetric difference") creates an array with elements that appear in eitherxory, but not both (duplicates possible)
- Slices are now hashable
String -- String(oldString - Stringbehavior)String++(equivalent toString ++ /\)string.splitnow 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.shufflenow does type checking againast slicesString - Stringnow 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'sboolslip in - Multiline strings are now correctly tokenized
Number ++ Stringis 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) != Bno longer yields incorrect resultsUserAttrscan 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%iomodule:io.Bytesio.inputcastio.read_until
iter.cycleby @Lunarmagpie- New import system, including:
- import aliases
- inline imports
- New special method syntax
- Partial Python Interoperability by @Endercheif
startparameter formath.sum, thus allowing to sum non-Integers- Static methods (
~'*keyword) string.ordinalstring.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,^[[Din the REPL to_bitmethods for:EnumFileIteratorModule
Types and functions are now hashable- Zip
><operator Ziptype
Changed
- Flipped argument order for:
iter.mapiter.filteriter.filter_false
- Greatly improved error messages
- Improved
collections.Setmethods:- Replaced
unionwith| - Replaced
intersectionwith& - Replaced
differencewith- - Removed
is_subsetin 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_stringmethods of:collections.ArithmeticArraycollections.Dequecollections.Queuecollections.Set
Fixed
collections.Set.#new_set_sizenow takes unsized sets into consideration- Constructing
Slices fromTypenow 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
datetimemodule by @Endercheif- Enums
iter.chunksiter.flatteniter.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
itermodule 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_stringmethod 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)