The on-wiki version of this newsletter can be found here: https://www.wikifunctions.org/wiki/Wikifunctions:Status_updates/2024-02-28 -- Type proposal for natural numbers https://www.wikifunctions.org/wiki/File:Three_Baskets_with_Apples.svg
We are getting close to having all the pieces in place to open up the next type to the community: natural numbers! Natural numbers, that is the numbers used for counting, are already in high demand, as witnessed by functions such as the String length https://www.wikifunctions.org/view/en/Z11040 function.
We have prepared a type proposal https://www.wikifunctions.org/wiki/Wikifunctions:Type_proposals/Natural_number. This type proposal is also meant as a template for future type proposals, which should eventually be coming from the community, not the development team. Input and discussion both of the format of the type proposal as well as the actual proposal for natural numbers is welcome.
Note that we will launch numbers without immediate support for renderers and parsers https://meta.wikimedia.org/wiki/Abstract_Wikipedia/Updates/2023-09-20, which reduces the Wikifunctions community's ability to provide them in translated form. This is temporary, and we are also working hard on getting renderers and parsers implemented. That will allow Wikifunctions to display and understand numbers in the way most appropriate for each language, but it will not be available immediately when we launch natural numbers. Recent Changes in the software
This week we have refreshed the design of the "meta-data" dialog which opens when you click the "Details" control next to a function call result, or the “info” icon (circle around “i”) next to a test result (T341127 https://phabricator.wikimedia.org/T341127). We now group the different pieces of information together in collapsed "accordions", and summarise some of the groups to help you understand them at a glance.
Thanks to GrounderUK, who found a mysterious bug that meant the pipe character ("|") would be swallowed when trying to run tests on draft Implementations or Test cases, but would work when saved. This was due to a complication in MediaWiki's API handling, and we've worked around it for now (T358089 https://phabricator.wikimedia.org/T358089). We found and fixed a UX bug on the initialisation of blank custom objects, where only the first key would be initialised with the correct type, while the others were initialised as references (T355497 https://phabricator.wikimedia.org/T355497).
As part of our long-term vision for Wikifunctions, we want to support not just multiple programming languages (currently Python and JavaScript, with more to come later), but also provide a consistent, understandable way to upgrade versions of these languages and help the Wikifunctions community migrate – so we can spot *e.g.* code that works in ES2019 JavaScript https://www.wikifunctions.org/view/en/Z607 but needs to be improved to also work in ES2020 JavaScript https://www.wikifunctions.org/view/en/Z608. An important part of that plan is having consistent references for each version, so we have been slowly improving our stack to use ZID references rather than strings, and as of this week our UX now will understand both, and new code will use ZIDs (T287153 https://phabricator.wikimedia.org/T287153). In future, we will use a bot to mass-move all uses to just ZIDs.
We, along with all Wikimedia-deploy code like the Vector skin's search bar, are using the latest version of the Codex UX library, v1.3.3, as of this week. Though we do not believe the library upgrade will have any user-visible changes in our use on Wikifunctions, please comment on the Project chat or file a Phabricator task if you spot an issue. This version of the library provides a new feature in how the lookup control works ( T350946 https://phabricator.wikimedia.org/T350946), which unblocks a minor improvement to pre-populate the Object selector with common types, which we hope to do soon (phab:T343564 https://phabricator.wikimedia.org/T343564). Wiki Mentor Africa https://www.wikifunctions.org/wiki/File:WMA-wikifunctions_Flyer.jpg
On this Saturday, March 2nd, at 16:00 UTC https://zonestamp.toolforge.org/1709395200, Luca Martinelli and Denny Vrandečić will present at an event in the Wiki Mentor Africa https://www.wikidata.org/wiki/Wikidata:Wiki_Mentor_Africa program, and on Sunday, March 3rd, at 16:00 UTC https://zonestamp.toolforge.org/1709395200, Hogü-456 will follow up with a hands-on demonstration. You can register for that event on the Wiki Mentor Africa event Website for the Introduction to Wikifunctions https://meta.wikimedia.org/wiki/Event:WMA_Introduction_to_Wikifunctions. A research agenda regarding AI and the knowledge commons
Last week, Denny attended a convening to discuss a research agenda regarding the effect of current progress in machine learning on projects in the knowledge commons, such as Wikipedia. The resulting draft for a research agenda and more details on this event are published on Meta https://meta.wikimedia.org/wiki/Artificial_intelligence/Bellagio_2024. Function of the Week: Or (Z10184)
“Or https://www.wikifunctions.org/view/en/Z10184” is a binary Boolean function. A binary function is one that takes two arguments. A Boolean function is one where all arguments and the return type are Boolean, that is, each of them is either true or false. A binary Boolean function is a function that takes two arguments of type Boolean and returns a Boolean.
“Or” is also known as the logical disjunction https://en.wikipedia.org/wiki/Logical_disjunction, and there are Wikipedia articles https://www.wikidata.org/wiki/Q1651704 about it in 46 language editions of Wikipedia.
“Or” returns false only if both of the arguments are false. Otherwise it returns true. This is meant to be a rigorous formulation of the natural language use of “or”, which usually means that either one of the two parts connected by the or may be given. Or both.
“Or” is useful to connect two conditions together. For example, if we want to know if a word ends with a vowel https://www.wikifunctions.org/view/en/Z11961 or a y.
Since each Boolean argument can only have two possible values, and there are two arguments, there are exactly four possible combinations of values the function can take. Accordingly, there are four tests on the function: true or true https://www.wikifunctions.org/view/en/Z10192, true or false https://www.wikifunctions.org/view/en/Z10195, false or true https://www.wikifunctions.org/view/en/Z10198, and false or false https://www.wikifunctions.org/view/en/Z10200.
The function has three implementations:
- in Python https://www.wikifunctions.org/view/en/Z10186, using the Python keyword or - in JavaScript https://www.wikifunctions.org/view/en/Z10201, using the || operator - a composition https://www.wikifunctions.org/view/en/Z13469 using the if https://www.wikifunctions.org/view/en/Z802 function: if the first argument is true, return true, or else return the second argument
Think through the composition and see if you understand the logic: does it indeed lead to the desired result for all four possible inputs?
abstract-wikipedia@lists.wikimedia.org