News for hackers. Stuff that matters.
Re:LFortran: Modern interactive LLVM-based Fortran compiler by baggy_trough on Thursday July 02, 2020 @03:28PM (#23717015)
Not much of a Fortran yet without arrays, complex numbers, or strings.
Re:LFortran: Modern interactive LLVM-based Fortran compiler by certik on Thursday July 02, 2020 @06:33PM (#23718890)
LFortran author here. We will get there. I spent a lot of time in the last year bootstrapping our efforts around https://fortran-lang.org/, which was very successful. I have shifted my focus on LFortran again now.
Re:LFortran: Modern interactive LLVM-based Fortran compiler by enriquto on Friday July 03, 2020 @03:14AM (#23721750)
> Not much of a Fortran yet without arrays, complex numbers, or strings.

A fortran without strings would still be a fortran, for many people. In fact, it could arguably be "a better fortran". Without complex numbers or arrays, not at all.

Re:LFortran: Modern interactive LLVM-based Fortran compiler by dm319 on Thursday July 02, 2020 @06:13PM (#23718726)
fortran - one of only a handful of languages that natively supports multidimensional arrays, maybe the only low level one?
Re:LFortran: Modern interactive LLVM-based Fortran compiler by BitterAmethyst on Friday July 03, 2020 @04:27AM (#23722135)
Not a low-level one but the CLR natively supports multidimensional arrays although I don't think they are exposed to C#.

I've written some F# code and for some trivial cases I was benchmarking there was some interesting performance differences between a native multi-dimensional array and an array-of-arrays version.

It wasn't important enough to look into so I don't know if the difference is due to quirks of the CLRs implementation or due to memory access patterns.

Re:LFortran: Modern interactive LLVM-based Fortran compiler by cjhanks on Thursday July 02, 2020 @09:42PM (#23720268)
Julia, R, and MATLAB. But yeah, it's not common. I end up reinventing this wheel about once a year.
Re:LFortran: Modern interactive LLVM-based Fortran compiler by Someone on Friday July 03, 2020 @05:59AM (#23722643)
Plankalkül (https://en.wikipedia.org/wiki/Plankalkül), Superplan (https://en.wikipedia.org/wiki/Superplan; never implemented) Pascal, Modula, Oberon, COBOL, ALGOL 60, dBase, Visual Basic (not all ‘low-level’)

(and probably many others)

Re:LFortran: Modern interactive LLVM-based Fortran compiler by ironmagma on Thursday July 02, 2020 @06:21PM (#23718790)
C kind of does, right? A multidimensional array in C isn't just an array of pointers.
Re:LFortran: Modern interactive LLVM-based Fortran compiler by dm319 on Friday July 03, 2020 @01:28PM (#23725797)
Is that more of a jagged / ragged array, or array of arrays? Sometimes these are called multidimensional arrays, but these are not the same thing. Dimensions and lengths of the dimensions should be a property of the multidimensional object.

[1] https://stackoverflow.com/questions/597720/what-are-the-diff...

Re:LFortran: Modern interactive LLVM-based Fortran compiler by ironmagma on Friday July 03, 2020 @01:38PM (#23725875)
I was talking about

  int a[2][3];
in C. Is that jagged? I wouldn’t have thought so, since AFAIK you could only store 6 elements in that and no fewer. Interestingly you cannot take the value of &&a[0][0], assign it to an

  int **b;
pointer b, and then access it via b[0][0] because it’s stored as a contiguous block of integers rather than an array of pointers that point to arrays as you might expect.
Re:LFortran: Modern interactive LLVM-based Fortran compiler by dm319 on Friday July 03, 2020 @03:47PM (#23726894)
Yes, that's a jagged/ragged/array-of-array, and most languages support them. There isn't a requirement for the arrays to be the same length. There are many arguments about the pros and cons of each, and how different they are the closer to assembly you get. Golang had a proposition to include multidimensional arrays [1], there were lots of arguments. I think the different perspectives depend on what you want to use it for and how much numerical processing you do.

[1] https://github.com/golang/go/issues/6282

Re:LFortran: Modern interactive LLVM-based Fortran compiler by ironmagma on Friday July 03, 2020 @05:03PM (#23727616)
According to this thread, it is not a true jagged array because each row has the same number of columns and each column the same number of rows. You can initialize it as a jagged array but it will still allocate it like a matrix.

https://stackoverflow.com/questions/1083658/do-jagged-arrays...

> the array will still have the shape [2][3]. If you want a true jagged array, you will have to create it dynamically.

Re:LFortran: Modern interactive LLVM-based Fortran compiler by dm319 on Friday July 03, 2020 @05:53PM (#23727967)
Ah ok, I was discriminating between a true multidimensional array and array-of-array (which can be ragged).
Re:LFortran: Modern interactive LLVM-based Fortran compiler by CyberDildonics on Thursday July 02, 2020 @09:24PM (#23720118)
That's ridiculous, you can make a C++ class and overload operator() like Eigen to easily make a multi-dimensional array.
Re:LFortran: Modern interactive LLVM-based Fortran compiler by baggy_trough on Thursday July 02, 2020 @10:49PM (#23720607)
"natively"
Re:LFortran: Modern interactive LLVM-based Fortran compiler by CyberDildonics on Friday July 03, 2020 @01:03PM (#23725596)
What is different to fortran's multi-dimensional arrays? The interface can be almost identical and the memory layout in C++ can be whatever you want it to be.
Re:LFortran: Modern interactive LLVM-based Fortran compiler by enriquto on Friday July 03, 2020 @03:12AM (#23721743)
By that reasoning, all turing-complete languages support multi-dimensional arrays.
Re:LFortran: Modern interactive LLVM-based Fortran compiler by CyberDildonics on Friday July 03, 2020 @11:04AM (#23724613)
I don't think every turing complete language lets you create an interface and memory layout that would be identical to fortran.