Skip to content

0.0.54

Compare
Choose a tag to compare
@JeffIrwin JeffIrwin released this 16 Nov 01:04
· 17 commits to main since this release

Installation

Grab one of the assets below. See the installation instructions from the readme

Known issues

What's new

  • added "jumping" control flow statements:
    • break (fortran's loop exit)
    • continue (fortran loop cycle)
  • added several non-decimal integer literals:
    • hex literals, e.g. 0xff
    • octal literals, e.g. 0o77
    • binary literals, e.g. 0b11
  • added underscore _ as a numeric visual separator, e.g. 1_000_000 or 0xDEAD_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 is 4294967295
    • 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() and i64() casting fns
    • note that i64(0xffff_ffff) is still -1 because the literal 0xffff_ffff is interpreted as -1 by the lexer long before the i64() function is evaluated
  • overloaded the exp() fn for f32 array and f64 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 array
    • norm2() of a float array
    • dot() 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) any f32 or f64 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