QL

Open Stories and Issues

_isEmpty should give a warning when used with ExactlyOne: That is, _isEmpty can never be true with ExactlyOne, by definition, so using it there indicates an error.
Add the Map Collection to QL: This is a huge feature, and would be significant effort to add, but it's generally useful, and I've been thinking about it since the early days.
As a QL author, I can use pattern matching: QL is a pure functional programming language. Every functional programming language winds up needing pattern-matching. So we should at least begin to design for this, on the theory that we will need it eventually.
As a Querki Dev, I can declare and use a typeclass: Not quite sure what this means yet, but use plus and sum as a good example.
As a Querki Dev, I can declare the signature of a function: Currently, I check parameters in an ad hoc way, when we are executing. Instead, the function should declare a list of params, with each one's name and type.
As a Querki Dev, I can write asynchronous functions: Of course, we do this already, but it's horrible. This story is to do it right.
Can't place QL comments before operators: That is, you can't have a comment on the line before a line that starts with | or &
Follow-on mutable functions don't seem to work: Not sure of the details here, but noting it for investigation.
Function calls with bound names fail: Not sure what the problem is, but it's thoroughly reproducible.
I can define an Edit Button: This is to deal with a major usability bug in the Page Header Property -- there is no way to add an Edit button to it!
I can replace *any* Property Value with a QL Expression: Huge, powerful and terrifying, but clearly correct. This would be the Querki equivalent of the common notion that, at the interface layer, a property can be either a value or a function.
I should be able to change Property Names more easily: Trying to refactor an oft-used Property Name is really painful. Can the system find where the Property is being referenced by name inside of QL contexts and automatically update it?
I should be able to construct a Model Value in code: This is the thin end of a wedge, but I really want to be able to specify, eg, a Duration of 2 years inline in the Carolingian Officers' Space. At the moment, I have to construct pointless Things just to hold values that I am using in code.
I should be able to debug my complex QL Expressions: Intriguing suggestion from Eric: a _debug() function that you can stick into the middle of an expression, which outputs information about the current context.
I should be able to declare the List format for my Model: That is, it would be really useful to be able to say, "When showing a List of Recipes, show them like this".
I should be able to easily create a complex link in QL: Put the underscore operator from QText into QL.
I should be able to easily manage how Links to my Things render: This comes up in A Respectful Calm. The Display Name is a gender-neutral version of the Character's name, like "I Zubin", so when I link to a Character that's how it shows up. But I'd really like to be able to instead display the Full Name Property when linking like that -- it's usually what I want.
I should be able to place comments in far more places in QL: The problem is, I can't put comments inside, eg, parameter lists.
I should be able to preserve closures across a _QLButton: Specifically, bindings from outside should work inside the button.
I should be able to put "print" statements into my code: Requested by Eric, to aid in debugging.
I should be able to set a default value for a bound name: The use case for this (really, the only valid use case) is querystring parameters, to be able to define a default value iff the name is not already defined.
I should be able to specify a Validation Filter for a Link Property: This would be a Function on a Link Property. When you edit a value of that Property, only values passing this filter would be offered.
I should be able to use an OID in QL: Since OIDs are the only reliable, stable way to refer to another Thing, it should be possible to use them instead of Name in a QL Expression.
I should be able to use bound names as Function parameters: Ran into problems using them for a user-defined Function.
I should be able to use dot in place of arrow whenever it's intuitive: For example, in my Vacation Photos Space, I tried to say [[Picture._thumbnail]], and it broke cryptically, confusing me for weeks. Of course, [[Picture -> _thumbnail]] worked fine, but if I can get confused by this, it is highly likely that normal users will.
I should be able to write lambdas / comprehensions in QL: I'm hitting a lot of mildly complex cases where I'm trying to write a QL expression and being forced to do it as multiple functions in order to get $_context and parameters. These should be lambda expressions, dammit!
If I pass parameters to a function that doesn't take any, I should get an error: Inspired by _textLength producing weird results , where Alexx wrote _textLength(Notes), and got mystifying results; the problem was that _textLength didn't (at the time) take parameters, so that param was being ignored silently. This shouldn't be silent -- it should be an error.
Inconsistency in how bound names and parallelism are handled: Need to think about how this works, but it's easy to write broken code currently.
Invocation should be based on the State Monad: This is to fix the "elem" problem -- the fact that you have to manually remember, after calling something like contextBundlesAndElements, to use the elem later in the for comprehension. If you goof, you get multiplicative horror. We need this to be automatic.
Need a better way to create an optional comma-delimited list: For example, look at the AKA field in my Songbook Space. There isn't a great way in QL to say, "if this list/set is non-empty, show it with this boldfaced label and then the contents, comma-delimited".
Not being able to combine Tags and Things reliably in a List is a hassle: This shows up in the Cooks Guild Space -- in Source, I want to be able to display a comma-delimited list of Contents, Time Periods and Cultures. But the first is a Link, and the others are Tags, and QL chokes when I try to combine them in a list.
Period Games Board Game page is now timing out: This has been running slow for a long time, but it's now actually failing. I would bet dollars to donuts that this is the last straw, requiring me to rewrite the QL rendering pipeline.
Possibly rewrite the QL engine in terms of Reactive Streams?: Not necessarily literally akka-streams, or anything like that, but at least conceptually, turning the QL engine into a streaming one makes oodles of sense.
Problem with bound names, filters and expressions: This one is mysterious, and the recipe is complex, but I've found a case where filtering is mysteriously failing.
QL needs a match function: There are times when you really want a switch or match function. Just as a simple example, in the Respectful Calm Space, there are several functions that want to match on Character Gender and produce different Text as a result. This is classic "match" in the Scala sense, but you currently have to do it with annoying nested _if's.
QL should give an error if a value is bound and never used: If I bind a value to a name and then don't do anything with it, that's almost by definition a bug. We should be detecting that and pointing it out somehow.
Recursive local functions can cause Querki to hang!: Not sure exactly how, but they clearly aren't getting the depth-50 cutoff reliably.
Rewrite the internal QL pipeline: This one is still deeply hypothetical, and huge, but the potential performance gains are sufficiently huge as to be worth really digging down and dealing with it.
Single-character name bindings should be legal: It looks like, if you say +$i in a QL expression, you get a cryptic parse error. I think the issue is that you can't have a single-character name?
Switch to a more conventional parameter-passing scheme by default?: Of all the features in QL, the way we handle parameters -- late-bound, instead of early-bound as in almost all languages -- has proven to be the most problematic. Can/should we change that?
The _QL functions shouldn't require a Thing as their context: Specifically, Eric is trying to put _QLInput into the Page Header of an unrefied Tag, and it's crapping out because the _QLInput isn't receiving a Thing.
Think through the security of Undelete: The undelete capability is quite powerful, especially now that undeleteThing() exists. It's arguably too powerful. Figure out what the rules should be, and implement them.
Users of a Space should have a Profile: Profiles / profile pages are ubiquitous on any sort of interactive website, for several good reasons: (1) if the site is remotely social, people want a sense of "who is this other user?" - creating a sense of community requires creating a sense of personhood. (2) websites very often want to present the user with relevant preferences.
When a failed link goes to a property, it falls back to the default instead of showing an error: Noticed by a player in ARC. There are several places in Aiden O'Malley's character sheet that refer to M Caoilinn, but that's hard to spell. So it often came out as, eg, [[M Caolinn -> Full Name]]. That should display an error, since we're trying to resolve a Property of an Unknown Tag. But in fact, it is showing the Full Name of Aiden!
When using a function that edits or creates a Thing, I should be able to specify a return-to parameter: I don't always want to go to the just-edited/created Thing; sometimes I want to view a different Thing (and possibly a particular View on that Thing).
_tagRefs -> _bulleted is not giving the expected behavior.

Closed Stories and Issues

_and and _or don't process List parameters correctly: If you pass Lists as parameters to _and or _or, only the first element of each List is used, not the entire thing. This is as-documented, but bad for some use cases, so it should be fixed.
if(isEmpty(<foo>),xxx,<bar>)
'Xxx' was just a placeholder for while I worked on getting foo and bar correct. Once 'xxx' was displaying when expected, O tried removing it, leaving:
if(isEmpty(<foo>),,<bar>)
When I tried refreshing my test Event, I got a vague message about an unexpected error being logged.
_isEmpty fails silently if given bad argument : If you give _isEmpty (and probably mamy other functions) a misspelled Thing Name as an argument, it just evaluates to false.
_showSome should be able to use bound names: _showSome can involve some pretty involved QL, and not being able to use bound names means you have to repeat a whole bunch of it, making it really painful to update.
._self causes QL to crash: Eric originally reported this as a more complex QL expression, but the essence of the bug is that, if you say ._self in a QL expression (with nothing before the dot), the parser crashes.
An empty element in a List Literal causes it to fail: The simple reproducer is <_if(false, 1), 2, 3> -- I expect that to display 2 3, but it actually shows Expecting type Unknown Type, but actually got type Whole Number Type.
Computed Name should beat Link Name: Eric observes that, if you set the Link Name on a Thing, that shows instead of the Computed Name -- and that's not usually what you want.
Error reporting for typos inside QL expressions is craptastic: In general, our error reporting is weak, but it is awful inside of parameters.
Extra . causes page to hang: This seems like it has to be some sort of weird parsing error in QL, but damned if I know what offhand.
From a Model Value, I should be able to access the enclosing Thing: This is a subtle but significant problem pointed out by Eric. Sometimes, when you are building a sophisticated Model Type, you really want to be able to access contextual information that exists on the enclosing Bundle. For example, in his highly-customized Review Types, he wants to be able to display the current Average -- but the Average Property is on the Thing, not on the Review, and the Review currently has no way of getting to the enclosing Thing, even in workaround.
Functions appear to be multiplying their results: Discovered in Kate's Cross Stitch Space, and reproduced in New MySQL Space as Function Testing Thing.
Handling of unknown names in QL is inconsistent: This the the straw that breaks the camel's back for the current behavior of, There is no Thing named "Foo" -- might be a typo?
I can display a button which, when pressed, causes some QL to be evaluated and shown in a modal dialog: This is intended to become a new mechanism to show a button and cause something to happen. We need that from time to time, and as usual we might as well play fair.
I can have a new Thing point back to the creating Thing: I've found that I often wind up with parent-child relationships between Things; in particular, I often want to put a button on Parent that says, "Create a new Child". All of which works decently well (using _createButton or _createInstanceLink), but with one problem: the Child doesn't start out with the pointer back to the Parent. I have to set that back-link manually, which is a hassle.
I should be able to cause Property changes in QL: Crossing the Rubicon here: introduce a _changeProperties() function that updates the Space.
I should be able to create a Date or Duration literal: Currently, these are way too hard to create. In particular, Duration usually wants to be a literal in practice.
I should be able to do the standard Wiki thing of "link to something that don't exist yet": It's not as stupidly critical as in a normal wiki - in some Spaces it's nearly irrelevant - but for others it's a major limiter.
I should be able to easily show a block of QL: Requested by Eric, but heavens knows I want it too -- showing some QL as text is way too much of a pain in the ass.
I should be able to have comments mid-Expression: Comments aren't working in some places where they obviously should be. Why not?
I should be able to make a text string uppercase / lowercase: Straightforward enough. Relevant for formatting/display, and possibly for comparison?
I should be able to specify a Display Name in QL: Currently, there is no way to use a Display Name in QL. This is inconvenient, especially for use with Tags. It would be damned useful to be able to give an Unknown Name that was actually a Display Name.
I should be able to specify a List Literal in QL: In particular, there should be a way for me to provide several elements for a parameter to a QL function.
I should be able to specify a negative numeric literal: Eric needs to be able to subtract, so he needs, eg, _plus(-4). And really, there's no reason why we don't already support negative numbers.
I should be able to specify large integer literals: I hit this during testing, where I needed a larger-than-Int literal.
I should be able to test whether a given name is bound in-scope: Eric points out that he needs this in order to test whether a page's query parameter is properly set up, and show a good error if not.
I should be able to use Functions in a natural OO way: See the Other Details, but the high concept is that I should be able to use Functions as Methods properly, including overriding them in sub-Models.
I should be able to use named parameters in QL: Currently, it is awkward to deal with complex parameter lists in QL: you can have optionals, but there is no good way to define a lot of parameters with defaults, and only specify one or two.
I should be able to use straightforward logical operators: It is incredibly annoying to have to use _and, _or and _not all the time! There should be syntax for this.
Need a way to compare numbers in _equals (Numeric Literals in QL): As discussed in email, there doesn't yet seem to be a way to use _equals with actual numbers. "it's also been on the to-do list for ages, to add numeric literals to QL..."
QL Functions can run indefinitely: Currently, it is fairly easy to write a QL expression that runs for Way Too Long -- far longer than the Gateway will allow. It's probably possible to write an infinite loop, although we try to avoid that. That's not okay.
QL processing needs to become asynchronous: This is big and ugly, but will become necessary. QL processing currently happens synchronously, but that's going to become a major scaling problem eventually.
Referencing a Property through a Tag doesn't work as expected: That is, if I say My Tag -> My Prop, that doesn't work even if My Tag is reified.
Syntax errors should be contained: Currently, if a page has a syntax error, it generally blows the entire page -- there's little context, and it gets really annoying. Really, the syntax error should be isolated to the current "level" -- in particular, a syntax error in a QL expression should only affect that expression, and not blow the page.
View Source fails to render List Literals: Noticed while looking at Eric's Space -- his parameters to _search look empty. This turns out to be because they are List Literals, and are undoubtedly not getting escaped properly for display.
When a Text Property refers to itself, the world explodes: This is the underlying problem behind the GBLS disaster, and is a P0 bug.