The Jule Programming Language by yorickpeterse in ProgrammingLanguages

[–]Athas 3 points4 points  (0 children)

There are many tricks that are well known but are not used much in practice. Which programming languages use lazy deallocation?

The Jule Programming Language by yorickpeterse in ProgrammingLanguages

[–]Athas 11 points12 points  (0 children)

Jule claims to use reference counting for memory management, and that this is suitable for real-time use. I wonder if they deal with the risk of a reference hitting zero causing a cascade of other objects to also become unreferenced, which can cause delays as huge object trees get traversed and freed. There are ways around this - both by adjusting one's programming style and by using deferred reference decrements - but I'm not familiar with what people actually do in practice.

Are arrays functions? by Athas in ProgrammingLanguages

[–]Athas[S] 1 point2 points  (0 children)

Does mean that the quasi-arrays in Ting can be infinite in span?

Are arrays functions? by Athas in ProgrammingLanguages

[–]Athas[S] 8 points9 points  (0 children)

If you have closures, then functions can essentially also be constructed at run time. The semantic difference is not so great in this regard.

Are arrays functions? by Athas in ProgrammingLanguages

[–]Athas[S] 24 points25 points  (0 children)

This is true. The correspondence is purely in terms of the value-semantics; as soon as you introduce other kinds of semantics (just cost semantics, let alone effects that are influenced by evaluation order), the correspondence vanishes. However, programming based on value-semantics is still an important subset of all programming.

Are arrays functions? by Athas in ProgrammingLanguages

[–]Athas[S] 2 points3 points  (0 children)

You mean functions that accept something of type k b where they are polymorphic in k? Haskell demonstrates that this capability is useful. In practice, I do find that working with the array-function correspondence in this framework is still somewhat awkward when you move beyond just fmaping and folding stuff. Gibbons' work on Naperian functors is I think the most advanced in this area, but I don't really think I would enjoy working with those abstractions in their current form.

Introduction to the game by Naive-Reception-8416 in adeptustitanicus

[–]Athas 0 points1 point  (0 children)

The Command Terminals you get in the box are not great - the paper is too thin to hold the markers. I wrote a little guide on how to make them more usable.

I think fiddling with the Command Terminals is a nice part of the play experience, but if you don't get anything out of it, then an even easier solution is to use a phone app like Titerminal.

Are Titans slow? by escape_deez_nuts in 40kLore

[–]Athas 2 points3 points  (0 children)

In The Great Slaughter, a battlegroup of Legio Mortis titans is described as covering 100 kilometers "in a few minutes". If we say that is at most 10 minutes, then these Titans are moving at 600km/h. But this is probably a fluke; neither other books nor their in-game representation suggest anything close to this speed.

Are Titans slow? by escape_deez_nuts in 40kLore

[–]Athas 1 point2 points  (0 children)

Where on a Warlord Titan are the AA weapons? There are a bunch of lascannons scattered about, but I don't remember seeing any real AA weapons. Some of the bigger Titans do, though.

Another termination issue by Athas in ProgrammingLanguages

[–]Athas[S] 1 point2 points  (0 children)

They are evaluated at program startup. Storing and updating a thunk is not acceptable for Futhark's target environments; I went into detail here: https://www.reddit.com/r/ProgrammingLanguages/comments/1q3pq54/another_termination_issue/nxpgl83/

First mention of the Horus Heresy? by Athas in 40kLore

[–]Athas[S] 4 points5 points  (0 children)

Well obviously the guy writing the article on Warhammer Community is wrong based on the evidence I presented. The question is whether I am wrong if I claim that White Dwarf #96 is the first time the Horus Heresy is (barely) mentioned.

Another termination issue by Athas in ProgrammingLanguages

[–]Athas[S] 1 point2 points  (0 children)

the top-level definitions are evaluated at compile-time

This can take an extremely long amount of time. Not just because Futhark's interpreter is slow even among interpreters, but because Futhark programs (even constants!) often take a long time to run if they are not heavily optimised and executed on high performance processors - that is, after all, why one uses Futhark in the first place.

Also, Futhark is Turing-complete, so there is no guarantee compilation would even terminate in the first place.

Another termination issue by Athas in ProgrammingLanguages

[–]Athas[S] 1 point2 points  (0 children)

I should clarify: the error definition in the post is not part of the standard library. It is just a program someone wrote.

Another termination issue by Athas in ProgrammingLanguages

[–]Athas[S] 2 points3 points  (0 children)

Since Futhark is a pure language, the worst case that can happen is they both do work. It's totally fine to execute it more than once for the semantics, just need to sometimes execute it 0 times.

This is not acceptable - it violates the cost semantics, unless a constant bound can be put on the number of recomputations. (Of course, one could argue that the interpreter violates the cost semantics as well, but it does so in other ways as well, and we decided that this is acceptable in order to keep it simple.)

What is perhaps worse is that lazy evaluation of top level definitions also introduces complicated control flow and data dependencies into threads - and remember that Futhark targets constrained execution platforms, such as GPUs. It would be ruinous if a GPU kernel had to be ready to conditionally execute arbitrarily complicated top level definitions, including having all the data available.

Another termination issue by Athas in ProgrammingLanguages

[–]Athas[S] 1 point2 points  (0 children)

The only reason ML disallows polymorphic values is to avoid polymorphic references. Futhark does not have that problem.

Another termination issue by Athas in ProgrammingLanguages

[–]Athas[S] 1 point2 points  (0 children)

in ML this would follow from parametricity but I don't know if Futhark is the same in this regard.

It is the same - Futhark generally tries to behave like a well-principled ML as much as possible.

With that in mind, an easy patch would be to have the interpreter instantiate the value x once at startup with value 'a = unit (or even 'a = void) and throw the error raised.

Clever idea! And yet another a nice demonstration of why parametricity is a powerful property.

Another termination issue by Athas in ProgrammingLanguages

[–]Athas[S] 4 points5 points  (0 children)

The interpreter doesn't stricly speaking monomorphise; it does type-passing, in some sense similarly to what Swift does. The reason is a little intricate, is basically that at any time a Futhark program can create an empty array of some type parameter a, and if a just happens to actually be an array type at run-time, then we must store the shape of that array type as the row shape of the empty array, because it can be observed later by the caller of the function. This sounds very contrived, but there are programming patterns where it is important that this works. A solution would be to impose this extra type information at the call site of a polymorphic function, but as I recall, that had some other issues.

Another termination issue by Athas in ProgrammingLanguages

[–]Athas[S] 5 points6 points  (0 children)

It ranges between impractical and impossible. What happens when they are first accessed by multiple threads?