0.0.54
Installation
Grab one of the assets below. See the installation instructions from the readme
Known issues
- binary installer doesn't work on Rocky or Alma Linux: #19
- fixed in 0.0.55
- syntran crashes on Windows intermittently: #16
- shared library disclaimer: https://github.com/JeffIrwin/syntran/blob/main/doc/shared-libs.md
What's new
- added "jumping" control flow statements:
break
(fortran's loopexit
)continue
(fortran loopcycle
)
- added several non-decimal integer literals:
- hex literals, e.g.
0xff
- octal literals, e.g.
0o77
- binary literals, e.g.
0b11
- hex literals, e.g.
- added underscore
_
as a numeric visual separator, e.g.1_000_000
or0xDEAD_BEEF
- added literal type suffixes after apostrophes to override default type inference:
- small numbers are
i32
by default, e.g.42
- this can be ambiguous for hex literals, e.g.
0xffff_ffff
is-1
as a 32-bit integer by default - to make a 64-bit integer, use
0xffff_ffff'i64
, which is4294967295
- to explicitly clarify the default,
0xffff_ffff'i32
is still-1
- suffixes can be used after decimal literals too, but they provide no functionality that wasn't previously available with the
i32()
andi64()
casting fns - note that
i64(0xffff_ffff)
is still-1
because the literal0xffff_ffff
is interpreted as-1
by the lexer long before thei64()
function is evaluated
- small numbers are
- overloaded the
exp()
fn forf32
array andf64
array arguments - added many new intrinsic (built in) fns:
cos()
,sin()
,tan()
acos()
,asin()
,atan()
cosd()
,sind()
,tand()
acosd()
,asind()
,atand()
log()
,log10()
,log2()
abs()
sqrt()
product()
of a numeric arraynorm2()
of a float arraydot()
for dot product of two numeric arrays- all of the new fns have the same overloaded signatures as
exp()
, i.e. they can take (and return) anyf32
orf64
scalar or array of any rank, unless noted otherwise - i'm falling behind on documentation, but you can assume that all of these functions are the same as the standard fortran ones if i haven't provided any further description
Roadmap
As a complement to the new hex literals, I am working on bitwise operations, i.e. shifting, bitwise and, or, xor, and not. Unfortunately I don't have time to comfortably finish before December, so expect PR #18 to be merged in late December or early next year
Advent of Code is in December. I will do it in syntran again this year and then add those solutions to test coverage. This will at the very least double the test coverage of scripts longer than a dozen lines (fpm test long
as opposed to the shorter unit tests in fpm test test
). There is a good chance that I may find and fix some bugs during AOC or add features to be able to complete the challenge