@rupert,
its also a great resource for the documentation of Elm āas isā
Yes, that has gone through quite a few iterations and as it just reflects something that is very stable, it is probably mostly accurate and useful for programmers at all sorts of levelsā¦
I donāt like everything I see in the RFC, particularly towards the end as it gets into HKT and RankN types
Iām still not sure about these either, but wanted to include them in the RFC to bring them up for discussion. For RankNTypes, there is one specific case where they actually make the syntax easier in that one can declare a type as ātype MyType = Construct (a ā b)ā with an implicit āforallā for a
and b
(or however many āfreeā type variables there might be) that lets these type variables stand for types of any rank, which is handy for a few uses so that one can just use MyType
without a Type assigned to the Type variable. It is said that RankNTypes can cause Type Inference to be undecidable for a few cases without type signatures, but I have used this in Haskell (with the forall
) and never had this problem, perhaps because I always use type signatures at the global level as is the recommended practice.
As to HKTās, for my purposes their only use is in creating higher order types of Abilities/Capabilities/type classes. Richard Feldman has stated he is against them too, and may get away with it in that he doesnāt think Roc needs the mutation monad chains such as ST and that the compiler can just decide when mutation can automatically be determined as in-place because the mutated container is never referenced again. That may not be powerful enough for a more general purpose language, which is the only instance in which I would propose these be used. For instance, if the language is to be self-hosting, it would need some equivalent ability like IORef (or STRef) to implement UnionFind efficiently. It adds little to the syntax, especially as you may have noticed, I donāt propose that users be able to create custom Capabilities so their use would be limited to the Core package. Abilities are still an unimplemented proposal in Roc, so its hard to say how it will pan out there, as well.
Even limiting Capabilities to predefined ones still adds a little to the complexity of the language as we still need to document how Capabilities can be added to new custom Typeās (other than the automatic default Capabilities that all qualifying Typeās will have); in actual fact, the language can live without them as does F#/Fable at the cost of extra boilerplate code. However, no Capabilities or limited Capabilities would mean that HKTās arenāt neededā¦
Do notation sugar?
The need for do notation sugar comes up for mutation function chain calls, which are onerous to write without it. Itās not so bad if implemented like Rocās ābackpassingā which works pretty well for Roc and could work well for the new language.
If we need them, remember that I propose that all of these features be optional add-onās and donāt need to be learned if you donāt use them, so wonāt impact existing Elm codeā¦
Roc has taken the general āprovide only one way to do thingsā to the extreme in only being able to declare functions in the way that anonymous functions are, etc., yet still provides if/then/else and something like case/of (and even adds condition guards, which I am not proposing although they can be useful); Every language designer has to make a choice, I chose those things for discussion because they are features that can be optional and donāt have to be learned or used, and even more to the point, donāt require new keywords.
Was the ommision of the WebGL GLSL syntax from the language reference deliberate?
This should actually be included in the Elm Reference as current Elm supports it, and we are going to have to support it to be backward compatible to Elm. My document doesnāt cover it because I have had to learn it from looking at the current Elm compiler implementation, but it turns out that itās not too bad. Although fully documenting it as part of the language would defeat your āIt all fits on a single slideā criteriaā¦
Actually, there is a new standard called WebGPU which may supersede WebGL that is likely going to have to be adopted if/when the new language goes mainstream in a few yearsā¦