LFortran - modern interactive LLVM-based Fortran compiler
lfortran [OPTIONS] [files...] [SUBCOMMAND]
program bench3 | |
implicit none | |
integer :: c | |
c = 0 | |
call g1(c) | |
call g2(c) | |
call g3(c) | |
call g4(c) | |
call g5(c) | |
call g6(c) |
// Compile with: | |
// g++ -O3 -march=native -o mydelta mydelta.cpp | |
// Use it like: | |
// git diff | ./mydelta | |
#include <iostream> | |
#include <string> | |
#include <regex> | |
// ANSI escape codes for colors |
Image |
/* The Computer Language Benchmarks Game | |
https://salsa.debian.org/benchmarksgame-team/benchmarksgame/ | |
contributed by Martin Jambrek | |
based off the Java #2 program contributed by Mark C. Lewis and modified slightly by Chad Whipkey | |
*/ | |
#include <cmath> | |
#include <cstdio> | |
#include <cstdlib> |
#include <stdio.h> | |
int main() | |
{ | |
#define REPEAT(count, action) REPEAT_HELPER(count, action) | |
#define REPEAT_HELPER(count, action) \ | |
REPEAT_##count(action) | |
#define REPEAT_1(action) action(1) | |
#define REPEAT_2(action) action(2) REPEAT_1(action) | |
#define REPEAT_3(action) action(3) REPEAT_2(action) |
module semigroup_m | |
!! A semigroup is a type with a sensible operation for combining two objects | |
!! of that type to produce another object of the same type. | |
!! A sensible operation has the associative property (i.e. (a + b) + c == a + (b + c)) | |
!! Given this property, it also makes sense to combine a list of objects of | |
!! that type into a single object, or to repeatedly combine an object with | |
!! itself. These operations can be derived in terms of combine. | |
!! Examples include integer (i.e. +), and character (i.e. //) | |
implicit none | |
private |
PROGRAM Calibration | |
IMPLICIT NONE | |
INTEGER :: total_sum, first_digit, last_digit, calibration_value | |
CHARACTER(100), DIMENSION(:), ALLOCATABLE :: calibration_document | |
INTEGER :: i, len_line, char_value, status | |
! Initialize total sum | |
total_sum = 0 |
program XX | |
requirement is_binary_op(T, op) | |
type, deferred :: T | |
function op(lhs, rhs) result(res) | |
type(T), intent(in) :: lhs, rhs | |
type(T) :: res | |
end function | |
end requirement |
program expr2 | |
implicit none | |
integer :: y, z | |
z = f(y) | |
print *, z, y | |
contains |